[Frugalware-darcs] frugalware-current: pacman-2.9.7-14-x86_64

Christian Hamar alias krix krics at linuxforum.hu
Fri Oct 28 10:50:10 CEST 2005


Fri Oct 28 01:49:20 CEST 2005  Christian Hamar alias krix <krics at linuxforum.hu>
  * pacman-2.9.7-14-x86_64
    * Release bump
    * Removed old size annd progressbar patches
    * Added a reworked and extended patch for progressbar and package counting.
      - Rewrited pacsnyc.c to use "-" instead of " " at downloading
      - Fixed over 100% bug in progressbar
      - Added (1/20) like package counting at install/upgrade
      - Fixed some gcc warnings
  
diff -rN -u old-frugalware-current/source/base/pacman/FrugalBuild new-frugalware-current-1/source/base/pacman/FrugalBuild
--- old-frugalware-current/source/base/pacman/FrugalBuild	2005-10-28 10:48:43.000000000 +0200
+++ new-frugalware-current-1/source/base/pacman/FrugalBuild	2005-10-28 10:31:05.000000000 +0200
@@ -1,10 +1,10 @@
-# Last Modified: Wed, 19 Oct 2005 22:29:16 +0200
+# Last Modified: Fri, 28 Oct 2005 01:47:27 +0200
 # Compiling Time: 0.10 SBU
 # Maintainer: VMiklos <vmiklos at frugalware.org>
 
 pkgname=pacman
 pkgver=2.9.7
-pkgrel=13
+pkgrel=14
 pkgdesc="A .tar.bz2 based package manager with dependency support"
 url="http://www.archlinux.org/pacman"
 backup=(etc/{makepkg,pacman}.conf etc/pacman.d/{frugalware,frugalware-current,extra,extra-current})
@@ -41,11 +41,9 @@
 	$pkgname-$pkgver-mypkgs.diff \
 	$pkgname-$pkgver-regexfix.diff \
 	$pkgname-$pkgver-upgradedelay.diff \
-	$pkgname-$pkgver-size.diff \
 	$pkgname-$pkgver-distcc.diff \
-	$pkgname-$pkgver-progressbar.diff \
-	$pkgname-$pkgver-progressbar-fix1.diff \
-	$pkgname-$pkgver-fakerootkey_export.diff)
+	$pkgname-$pkgver-fakerootkey_export.diff \
+	$pkgname-$pkgver-progressbar-final1.diff)
 sha1sums=('2c8d89cab4ecef74598e6020716caf8c3c0dc77d' \
 	  '5037ed30cc765cdb8c2dbc85f344e6c299e23fff' \
 	  'caaed4d36fd8cc8789761270f5e6b372f329b83f' \
@@ -74,11 +72,9 @@
 	  '51a29d8e1b6a27ea39f3f624916607b1d589fadf' \
 	  '64cbc942bd89b3dd2214b18b345fa83534a013a1' \
 	  '4e7eea1068ff7c3fb011d9b8cf51b7e10c875f52' \
-	  'f6ee8ef16f581098d8da8099ba5c30ee2b6d7299' \
 	  'a7b9241f83162d048c727c1d37ec5b65ae6b22c1' \
-	  '0d6d031f83756f9980a4d25704448bbd18fad8cc' \
-	  'cf6e13ea803359ecfa6b75b52d123167ced41e5a' \
-	  'ffe0a9bfcd03ec5d8c23cb1a877e33c2e8075db1')
+	  'ffe0a9bfcd03ec5d8c23cb1a877e33c2e8075db1' \
+	  'cf67e23c76a07595749121b18487bfae000865e1')
 
 build()
 {
diff -rN -u old-frugalware-current/source/base/pacman/pacman-2.9.7-progressbar.diff new-frugalware-current-1/source/base/pacman/pacman-2.9.7-progressbar.diff
--- old-frugalware-current/source/base/pacman/pacman-2.9.7-progressbar.diff	2005-10-28 10:48:43.000000000 +0200
+++ new-frugalware-current-1/source/base/pacman/pacman-2.9.7-progressbar.diff	1970-01-01 01:00:00.000000000 +0100
@@ -1,147 +0,0 @@
-diff -Naur pacman-2.9.7.orig/scripts/makepkg pacman-2.9.7/scripts/makepkg
---- pacman-2.9.7.orig/scripts/makepkg	2005-10-17 17:15:02.898144750 +0200
-+++ pacman-2.9.7/scripts/makepkg	2005-10-17 17:15:19.835203250 +0200
-@@ -1092,6 +1092,7 @@
- echo "builddate = $builddate" >>.PKGINFO
- echo "packager = $packager" >>.PKGINFO
- echo "size = $size" >>.PKGINFO
-+echo "usize = $size" >>.PKGINFO
- if [ "$CARCH" != "" ]; then
- 	echo "arch = $CARCH" >>.PKGINFO
- fi
-diff -Naur pacman-2.9.7.orig/src/db.c pacman-2.9.7/src/db.c
---- pacman-2.9.7.orig/src/db.c	2005-10-17 17:15:02.898144750 +0200
-+++ pacman-2.9.7/src/db.c	2005-10-17 17:16:59.729446250 +0200
-@@ -377,6 +377,14 @@
- 				}
- 				trim(tmp);
- 				info->size = atol(tmp);
-+                        } else if(!strcmp(line, "%USIZE%")) {
-+				char tmp[32];
-+				if(fgets(tmp, sizeof(tmp), fp) == NULL) {
-+					FREEPKG(info);
-+					return(NULL);
-+				}
-+				trim(tmp);
-+				info->usize = (unsigned long)atol(tmp);
- 			} else if(!strcmp(line, "%LICENSE%")) {
- 				while(fgets(line, 512, fp) && strlen(trim(line))) {
- 					char *s = strdup(line);
-@@ -546,6 +554,8 @@
- 		fprintf(fp, "%s\n\n", info->packager);
- 		fputs("%SIZE%\n", fp);
- 		fprintf(fp, "%ld\n\n", info->size);
-+		fputs("%USIZE%\n", fp);
-+		fprintf(fp, "%ld\n\n", info->usize);
- 		fputs("%REASON%\n", fp);
- 		fprintf(fp, "%d\n\n", info->reason);
- 		fclose(fp);
-diff -Naur pacman-2.9.7.orig/src/package.c pacman-2.9.7/src/package.c
---- pacman-2.9.7.orig/src/package.c	2005-10-17 17:15:02.902145000 +0200
-+++ pacman-2.9.7/src/package.c	2005-10-17 17:17:25.783074500 +0200
-@@ -220,6 +220,10 @@
- 				char tmp[32];
- 				strncpy(tmp, ptr, sizeof(tmp));
- 				info->size = atol(tmp);
-+			} else if(!strcmp(key, "USIZE")) {
-+				char tmp[32];
-+				strncpy(tmp, ptr, sizeof(tmp));
-+				info->usize = atol(tmp);
- 			} else if(!strcmp(key, "LICENSE")) {
- 				info->license = list_add(info->license, strdup(ptr));
- 			} else if(!strcmp(key, "DEPEND")) {
-@@ -264,6 +268,7 @@
- 	pkg->sha1sum[0]     = '\0';
- 	pkg->arch[0]        = '\0';
- 	pkg->size           = 0;
-+	pkg->usize           = 0;
- 	pkg->scriptlet      = 0;
- 	pkg->force          = 0;
- 	pkg->reason         = REASON_EXPLICIT;
-@@ -423,6 +428,8 @@
- 	list_display("Replaces          :", pm);
- 	FREELIST(pm);
- 	printf("Size (compressed) : %ld\n", info->size);
-+	if (info->usize != NULL)
-+	    printf("Size (uncompressed) : %ld\n", info->usize);
- 	printf("Description       : ");
- 	indentprint(info->desc, 20);
- 	if (info->md5sum[0] != '\0' && info->md5sum != NULL) {
-diff -Naur pacman-2.9.7.orig/src/package.h pacman-2.9.7/src/package.h
---- pacman-2.9.7.orig/src/package.h	2005-10-17 17:15:02.902145000 +0200
-+++ pacman-2.9.7/src/package.h	2005-10-17 17:16:13.350547750 +0200
-@@ -57,6 +57,7 @@
- 	char sha1sum[41];
- 	char arch[32];
- 	unsigned long size;
-+	unsigned long usize;
- 	unsigned short scriptlet;
- 	unsigned short force;
- 	time_t date;
-diff -Naur pacman-2.9.7.orig/src/pacman.c pacman-2.9.7/src/pacman.c
---- pacman-2.9.7.orig/src/pacman.c	2005-10-17 17:15:02.902145000 +0200
-+++ pacman-2.9.7/src/pacman.c	2005-10-17 17:17:34.795637750 +0200
-@@ -121,6 +121,32 @@
- int maxcols = 80;
- int neednl = 0; /* for cleaner message output */
- 
-+static int disp_progress(char *pkgname, int percent) {
-+	/* char *pkgn[25]; */
-+	int i, hash;
-+    
-+	hash = percent/6.25;
-+
-+	/* snprintf(pkgn, 25, "%s", pkgname); */
-+	/* printf(" %s ", pkgn); */
-+
-+	if (strlen(pkgname)<25)
-+	    for (i=25-strlen(pkgname)-1; i>0; i--)
-+		printf(" ");
-+	
-+	printf("[");
-+	for (i = 16; i > 0; i--) {
-+	    if (i >= 16 - hash)
-+		printf("#");
-+	    else
-+		printf("-");
-+	}
-+	printf("] %3d%%\r", percent);
-+	fflush(stdout);
-+	return(1);
-+}
-+
-+
- int main(int argc, char *argv[])
- {
- 	int ret = 0;
-@@ -1556,6 +1582,7 @@
- int pacman_add(pacdb_t *db, PMList *targets, PMList *dependonly)
- {
- 	int i, ret = 0, errors = 0;
-+	double percent;
- 	register struct archive *archive;
- 	struct archive_entry *entry;
- 	char expath[PATH_MAX];
-@@ -1910,6 +1937,10 @@
- 		chdir(pmo_root);
- 
- 		for(i = 0; archive_read_next_header (archive, &entry) == ARCHIVE_OK; i++) {
-+                        if (info->usize != 0) { /* prevent division by zero */
-+			    percent = (double)archive_position_uncompressed(archive) / info->usize;
-+			    disp_progress(info->name, (int)(percent * 100));
-+			}
- 			int nb = 0;
- 			int notouch = 0;
- 			char *md5_orig = NULL;
-@@ -2223,7 +2254,10 @@
- 				db_write(db, depinfo, INFRQ_DEPENDS);
- 				freepkg(depinfo);
- 			}
--			printf("done.\n"); fflush(stdout);
-+
-+                        disp_progress(info->name, 100); /* Put progressbar to 100% */
-+                        printf("\n");
-+			fflush(stdout);
- 
- 			/* run the post-install/upgrade script if it exists  */
- 			snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", pmo_root, pmo_dbpath, db->treename, info->name, info->version);
diff -rN -u old-frugalware-current/source/base/pacman/pacman-2.9.7-progressbar-final1.diff new-frugalware-current-1/source/base/pacman/pacman-2.9.7-progressbar-final1.diff
--- old-frugalware-current/source/base/pacman/pacman-2.9.7-progressbar-final1.diff	1970-01-01 01:00:00.000000000 +0100
+++ new-frugalware-current-1/source/base/pacman/pacman-2.9.7-progressbar-final1.diff	2005-10-28 10:31:05.000000000 +0200
@@ -0,0 +1,248 @@
+diff -Naur pacman-2.9.7.orig/scripts/makepkg pacman-2.9.7/scripts/makepkg
+--- pacman-2.9.7.orig/scripts/makepkg	2005-10-28 01:45:33.434320750 +0200
++++ pacman-2.9.7/scripts/makepkg	2005-10-28 01:45:48.715275750 +0200
+@@ -1092,6 +1092,7 @@
+ echo "builddate = $builddate" >>.PKGINFO
+ echo "packager = $packager" >>.PKGINFO
+ echo "size = $size" >>.PKGINFO
++echo "usize = $size" >>.PKGINFO
+ if [ "$CARCH" != "" ]; then
+ 	echo "arch = $CARCH" >>.PKGINFO
+ fi
+diff -Naur pacman-2.9.7.orig/src/db.c pacman-2.9.7/src/db.c
+--- pacman-2.9.7.orig/src/db.c	2005-10-28 01:45:33.434320750 +0200
++++ pacman-2.9.7/src/db.c	2005-10-28 01:45:48.715275750 +0200
+@@ -377,6 +377,14 @@
+ 				}
+ 				trim(tmp);
+ 				info->size = atol(tmp);
++                        } else if(!strcmp(line, "%USIZE%")) {
++				char tmp[32];
++				if(fgets(tmp, sizeof(tmp), fp) == NULL) {
++					FREEPKG(info);
++					return(NULL);
++				}
++				trim(tmp);
++				info->usize = (unsigned long)atol(tmp);
+ 			} else if(!strcmp(line, "%LICENSE%")) {
+ 				while(fgets(line, 512, fp) && strlen(trim(line))) {
+ 					char *s = strdup(line);
+@@ -546,6 +554,8 @@
+ 		fprintf(fp, "%s\n\n", info->packager);
+ 		fputs("%SIZE%\n", fp);
+ 		fprintf(fp, "%ld\n\n", info->size);
++		fputs("%USIZE%\n", fp);
++		fprintf(fp, "%ld\n\n", info->usize);
+ 		fputs("%REASON%\n", fp);
+ 		fprintf(fp, "%d\n\n", info->reason);
+ 		fclose(fp);
+diff -Naur pacman-2.9.7.orig/src/package.c pacman-2.9.7/src/package.c
+--- pacman-2.9.7.orig/src/package.c	2005-10-28 01:45:33.434320750 +0200
++++ pacman-2.9.7/src/package.c	2005-10-28 01:45:48.715275750 +0200
+@@ -220,6 +220,10 @@
+ 				char tmp[32];
+ 				strncpy(tmp, ptr, sizeof(tmp));
+ 				info->size = atol(tmp);
++			} else if(!strcmp(key, "USIZE")) {
++				char tmp[32];
++				strncpy(tmp, ptr, sizeof(tmp));
++				info->usize = atol(tmp);
+ 			} else if(!strcmp(key, "LICENSE")) {
+ 				info->license = list_add(info->license, strdup(ptr));
+ 			} else if(!strcmp(key, "DEPEND")) {
+@@ -264,6 +268,7 @@
+ 	pkg->sha1sum[0]     = '\0';
+ 	pkg->arch[0]        = '\0';
+ 	pkg->size           = 0;
++	pkg->usize           = 0;
+ 	pkg->scriptlet      = 0;
+ 	pkg->force          = 0;
+ 	pkg->reason         = REASON_EXPLICIT;
+@@ -423,6 +428,8 @@
+ 	list_display("Replaces          :", pm);
+ 	FREELIST(pm);
+ 	printf("Size (compressed) : %ld\n", info->size);
++	if (info->usize != NULL)
++	    printf("Size (uncompressed) : %ld\n", info->usize);
+ 	printf("Description       : ");
+ 	indentprint(info->desc, 20);
+ 	if (info->md5sum[0] != '\0' && info->md5sum != NULL) {
+diff -Naur pacman-2.9.7.orig/src/package.h pacman-2.9.7/src/package.h
+--- pacman-2.9.7.orig/src/package.h	2005-10-28 01:45:33.434320750 +0200
++++ pacman-2.9.7/src/package.h	2005-10-28 01:45:48.715275750 +0200
+@@ -57,6 +57,7 @@
+ 	char sha1sum[41];
+ 	char arch[32];
+ 	unsigned long size;
++	unsigned long usize;
+ 	unsigned short scriptlet;
+ 	unsigned short force;
+ 	time_t date;
+diff -Naur pacman-2.9.7.orig/src/pacman.c pacman-2.9.7/src/pacman.c
+--- pacman-2.9.7.orig/src/pacman.c	2005-10-28 01:45:33.434320750 +0200
++++ pacman-2.9.7/src/pacman.c	2005-10-28 01:45:48.719276000 +0200
+@@ -121,6 +121,31 @@
+ int maxcols = 80;
+ int neednl = 0; /* for cleaner message output */
+ 
++static int disp_progress(char *pkgname, int percent, int howmany, int remain) {
++	int i, hash;
++    
++	if (percent > 100) { return (1); }
++	hash = percent/6.25;
++
++	printf("(%d/%d) %s", remain, howmany, pkgname);
++	if (strlen(pkgname)<35)
++	    for (i=35-strlen(pkgname)-1; i>0; i--)
++		printf(" ");
++
++	printf("[");
++	for (i = 16; i > 0; i--) {
++	    if (i >= 16 - hash)
++		printf("#");
++	    else
++		printf("-");
++	}
++	printf("] %3d%%\r", percent);
++	fflush(stdout);
++/*	sleep(1); */ /* Just for testing */
++	return(0);
++}
++
++
+ int main(int argc, char *argv[])
+ {
+ 	int ret = 0;
+@@ -884,9 +909,9 @@
+ 							FREELIST(l);
+ 						    }
+ 						    if(k != NULL) {
++							PMList *l;
+ 							vprint(":: %s is provided by :\n", targ);
+ 							if(pmo_verbose) list_display("   ", k);
+-							PMList *l;
+ 							l = k;
+ 							vprint(":: Using the first provider - %s\n", strdup((char*)l->data));
+ 					    		targets = list_add(targets, strdup((char*)l->data));
+@@ -895,7 +920,7 @@
+ 							fprintf(stderr, "nobody provides %s and not found in sync db\n", targ);
+ 							allgood = 0;
+ 						    }
+-						} // treename else end
++						} /* treename else end */
+ 					} else {
+ 					    fprintf(stderr, "%s: not present in \"%s\" repository\n", targ, treename);
+ 					    allgood = 0;
+@@ -1555,12 +1580,14 @@
+ 
+ int pacman_add(pacdb_t *db, PMList *targets, PMList *dependonly)
+ {
+-	int i, ret = 0, errors = 0;
++	int i, ret = 0, errors = 0, needdisp = 0;
++	double percent;
+ 	register struct archive *archive;
+ 	struct archive_entry *entry;
+ 	char expath[PATH_MAX];
+ 	char pm_install[PATH_MAX];
+ 	char rm_fname[PATH_MAX];
++	char *what;
+ 	pkginfo_t *info = NULL;
+ 	struct stat buf;
+ 	PMList *targ, *lp, *j, *k, *remove_list;
+@@ -1850,7 +1877,7 @@
+ 			if(is_pkgin(info, pm_packages)) {
+ 				int retcode;
+ 
+-				printf("upgrading %s... ", info->name);
++				asprintf(&what, "upgrading %s ", info->name);
+ 				neednl = 1;
+ 
+ 				/* we'll need the full record for backup checks later */
+@@ -1885,7 +1912,7 @@
+ 		}
+ 		
+ 		if(!pmo_upgrade) {
+-			printf("installing %s... ", info->name);
++			asprintf(&what, "installing %s ", info->name);
+ 			neednl = 1;
+ 			/* pre_install scriptlet */
+ 			if(info->scriptlet) {
+@@ -1917,6 +1944,12 @@
+ 			char pathname[PATH_MAX];
+ 			strncpy(pathname, archive_entry_pathname (entry), PATH_MAX);
+ 
++		        info->usize = info->size; /* Progress bar thing. Bad hack for usize.. */
++		        percent = (double)archive_position_uncompressed(archive) / info->usize;
++			if (needdisp == 0) {
++		    	    needdisp = disp_progress(what, (int)(percent * 100), list_count(targets), (list_count(targets) - list_count(targ) +1));
++			}
++
+ 			if(!strcmp(pathname, ".PKGINFO") || !strcmp(pathname, ".FILELIST")) {
+ 				archive_read_data_skip (archive);
+ 				continue;
+@@ -2107,7 +2140,7 @@
+ 				}
+ 				archive_entry_set_pathname (entry, expath);
+ 				if (archive_read_extract (archive, entry, ARCHIVE_EXTRACT_FLAGS) != ARCHIVE_OK) {
+-					printf ("%d\n",ARCHIVE_OK);
++					vprint("%d\n", ARCHIVE_OK);
+ 					logaction(stderr, "could not extract %s: %s", expath, strerror(errno));
+ 					errors++;
+ 				}
+@@ -2137,7 +2170,6 @@
+ 			}
+ 		}
+ 		archive_read_finish (archive);
+-		/* free (archive); */
+ 		
+ 		if(errors) {
+ 			ret = 1;
+@@ -2223,7 +2255,12 @@
+ 				db_write(db, depinfo, INFRQ_DEPENDS);
+ 				freepkg(depinfo);
+ 			}
+-			printf("done.\n"); fflush(stdout);
++
++                        disp_progress(what, 100, list_count(targets), (list_count(targets) - list_count(targ) +1)); /* Put progressbar to 100% */
++                        needdisp = 0;
++			printf("\n");
++			fflush(stdout);
++			FREE(what);
+ 
+ 			/* run the post-install/upgrade script if it exists  */
+ 			snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", pmo_root, pmo_dbpath, db->treename, info->name, info->version);
+@@ -2805,12 +2842,12 @@
+ 					printf("%s %s\n", info->name, info->version);
+ 				}
+ 			} else if(pmo_q_mypkgs) {
++				int match = 0;
+ 				info = db_scan(db, package, INFRQ_DESC | INFRQ_DEPENDS);
+ 				if(info == NULL) {
+ 					fprintf(stderr, "Package \"%s\" was not found.\n", package);
+ 					return(2);
+ 				}
+-				int match = 0;
+ 				for(i = databases; i; i = i->next) {
+ 					dbsync_t *dbs = (dbsync_t*)i->data;
+ 					for(j = dbs->pkgcache; j; j = j->next) {
+diff -Naur pacman-2.9.7.orig/src/pacsync.c pacman-2.9.7/src/pacsync.c
+--- pacman-2.9.7.orig/src/pacsync.c	2005-10-28 01:45:33.434320750 +0200
++++ pacman-2.9.7/src/pacsync.c	2005-10-28 01:46:06.476385750 +0200
+@@ -430,7 +430,7 @@
+ 						strncpy(out, server->path, 33);
+ 						printf("%s", out);
+ 						for(j = strlen(out); j < maxcols-64; j++) {
+-							printf(" ");
++							printf("-");
+ 						}
+ 						fputs("] 100%    LOCAL ", stdout);
+ 					} else {
+@@ -538,7 +538,7 @@
+ 				}
+ 			}
+ 		} else {
+-			(i < cur) ? printf("#") : printf(" ");
++			(i < cur) ? printf("#") : printf("-");
+ 		}
+ 	}
+ 	if(rate > 1000) {
diff -rN -u old-frugalware-current/source/base/pacman/pacman-2.9.7-progressbar-fix1.diff new-frugalware-current-1/source/base/pacman/pacman-2.9.7-progressbar-fix1.diff
--- old-frugalware-current/source/base/pacman/pacman-2.9.7-progressbar-fix1.diff	2005-10-28 10:48:43.000000000 +0200
+++ new-frugalware-current-1/source/base/pacman/pacman-2.9.7-progressbar-fix1.diff	1970-01-01 01:00:00.000000000 +0100
@@ -1,113 +0,0 @@
-diff -Naur pacman-2.9.7.orig/src/pacman.c pacman-2.9.7/src/pacman.c
---- pacman-2.9.7.orig/src/pacman.c	2005-10-18 14:42:41.729782500 +0200
-+++ pacman-2.9.7/src/pacman.c	2005-10-18 15:55:47.787894000 +0200
-@@ -122,18 +122,15 @@
- int neednl = 0; /* for cleaner message output */
- 
- static int disp_progress(char *pkgname, int percent) {
--	/* char *pkgn[25]; */
- 	int i, hash;
-     
- 	hash = percent/6.25;
- 
--	/* snprintf(pkgn, 25, "%s", pkgname); */
--	/* printf(" %s ", pkgn); */
--
--	if (strlen(pkgname)<25)
--	    for (i=25-strlen(pkgname)-1; i>0; i--)
-+	printf("%s", pkgname);
-+	if (strlen(pkgname)<35)
-+	    for (i=35-strlen(pkgname)-1; i>0; i--)
- 		printf(" ");
--	
-+
- 	printf("[");
- 	for (i = 16; i > 0; i--) {
- 	    if (i >= 16 - hash)
-@@ -143,6 +140,7 @@
- 	}
- 	printf("] %3d%%\r", percent);
- 	fflush(stdout);
-+/*	sleep(1); */ /* Just for testing */
- 	return(1);
- }
- 
-@@ -1588,6 +1586,7 @@
- 	char expath[PATH_MAX];
- 	char pm_install[PATH_MAX];
- 	char rm_fname[PATH_MAX];
-+	char *what;
- 	pkginfo_t *info = NULL;
- 	struct stat buf;
- 	PMList *targ, *lp, *j, *k, *remove_list;
-@@ -1877,7 +1876,8 @@
- 			if(is_pkgin(info, pm_packages)) {
- 				int retcode;
- 
--				printf("upgrading %s... ", info->name);
-+/*				printf("upgrading %s... ", info->name); */
-+				asprintf(&what, "upgrading %s ", info->name);
- 				neednl = 1;
- 
- 				/* we'll need the full record for backup checks later */
-@@ -1912,7 +1912,8 @@
- 		}
- 		
- 		if(!pmo_upgrade) {
--			printf("installing %s... ", info->name);
-+/*			printf("installing %s ", info->name); */
-+			asprintf(&what, "installing %s ", info->name);
- 			neednl = 1;
- 			/* pre_install scriptlet */
- 			if(info->scriptlet) {
-@@ -1937,10 +1938,6 @@
- 		chdir(pmo_root);
- 
- 		for(i = 0; archive_read_next_header (archive, &entry) == ARCHIVE_OK; i++) {
--                        if (info->usize != 0) { /* prevent division by zero */
--			    percent = (double)archive_position_uncompressed(archive) / info->usize;
--			    disp_progress(info->name, (int)(percent * 100));
--			}
- 			int nb = 0;
- 			int notouch = 0;
- 			char *md5_orig = NULL;
-@@ -1948,6 +1945,10 @@
- 			char pathname[PATH_MAX];
- 			strncpy(pathname, archive_entry_pathname (entry), PATH_MAX);
- 
-+		        info->usize = info->size; /* Progress bar thing. Bad hack for usize.. */
-+		        percent = (double)archive_position_uncompressed(archive) / info->usize;
-+		        disp_progress(what, (int)(percent * 100));
-+
- 			if(!strcmp(pathname, ".PKGINFO") || !strcmp(pathname, ".FILELIST")) {
- 				archive_read_data_skip (archive);
- 				continue;
-@@ -2138,7 +2139,7 @@
- 				}
- 				archive_entry_set_pathname (entry, expath);
- 				if (archive_read_extract (archive, entry, ARCHIVE_EXTRACT_FLAGS) != ARCHIVE_OK) {
--					printf ("%d\n",ARCHIVE_OK);
-+					vprint("%d\n", ARCHIVE_OK);
- 					logaction(stderr, "could not extract %s: %s", expath, strerror(errno));
- 					errors++;
- 				}
-@@ -2168,7 +2169,6 @@
- 			}
- 		}
- 		archive_read_finish (archive);
--		/* free (archive); */
- 		
- 		if(errors) {
- 			ret = 1;
-@@ -2255,9 +2255,10 @@
- 				freepkg(depinfo);
- 			}
- 
--                        disp_progress(info->name, 100); /* Put progressbar to 100% */
-+                        disp_progress(what, 100); /* Put progressbar to 100% */
-                         printf("\n");
- 			fflush(stdout);
-+			FREE(what);
- 
- 			/* run the post-install/upgrade script if it exists  */
- 			snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", pmo_root, pmo_dbpath, db->treename, info->name, info->version);
diff -rN -u old-frugalware-current/source/base/pacman/pacman-2.9.7-size.diff new-frugalware-current-1/source/base/pacman/pacman-2.9.7-size.diff
--- old-frugalware-current/source/base/pacman/pacman-2.9.7-size.diff	2005-10-28 10:48:43.000000000 +0200
+++ new-frugalware-current-1/source/base/pacman/pacman-2.9.7-size.diff	1970-01-01 01:00:00.000000000 +0100
@@ -1,147 +0,0 @@
-diff -Naur pacman-2.9.7.orig/Makefile.in pacman-2.9.7/Makefile.in
---- pacman-2.9.7.orig/Makefile.in	2005-10-04 23:59:52.000000000 +0200
-+++ pacman-2.9.7/Makefile.in	2005-10-05 00:00:33.000000000 +0200
-@@ -74,7 +74,7 @@
- 					$(OBJDIR)strhash.o \
- 					$(OBJDIR)rpmvercmp.o
- 
--all: libftp.a pacman vercmp convertdb man
-+all: libftp.a pacman vercmp convertdb cdu man
- 
- pacman: $(OBJECTS) libftp.a
- 	$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
-@@ -86,6 +86,9 @@
- convertdb: $(OBJDIR)convertdb.o $(OBJDIR)list.o $(OBJDIR)archive.o $(OBJDIR)util.o
- 	$(CXX) $(OBJDIR)convertdb.o $(OBJDIR)list.o $(OBJDIR)archive.o $(OBJDIR)util.o $(LDFLAGS) -o $@
- 
-+cdu: $(OBJDIR)cdu.o
-+	$(CXX) $(OBJDIR)cdu.o $(CXXFLAGS) $(LDFLAGS) -o $@
-+
- .c.o: $(SRCS)
- 	$(CXX) $(CXXFLAGS) -o $@ -c $<
- 
-@@ -101,11 +104,12 @@
- libftp.a:
- 	(cd libftp; make libftp.a)
- 
--install: pacman vercmp convertdb man
-+install: pacman vercmp convertdb cdu man
- 	$(INSTALL) -D -m0755 pacman $(DESTDIR)$(BINDIR)/pacman
- 	$(INSTALL) -D -m0755 pacman.static $(DESTDIR)$(BINDIR)/pacman.static
- 	$(INSTALL) -D -m0755 vercmp $(DESTDIR)$(BINDIR)/vercmp
- 	$(INSTALL) -D -m0755 convertdb $(DESTDIR)$(BINDIR)/convertdb
-+	$(INSTALL) -D -m0755 cdu $(DESTDIR)$(BINDIR)/cdu
- 	$(INSTALL) -D -m0755 $(SCRDIR)makepkg $(DESTDIR)$(BINDIR)/makepkg
- 	$(INSTALL) -D -m0755 $(SCRDIR)makeworld $(DESTDIR)$(BINDIR)/makeworld
- 	$(INSTALL) -D -m0755 $(SCRDIR)gensync $(DESTDIR)$(BINDIR)/gensync
-@@ -121,7 +125,7 @@
- 	(cd libftp; make clobber)
- 
- distclean: clean
--	rm -f pacman pacman.static convertdb vercmp
-+	rm -f pacman pacman.static convertdb vercmp cdu
- 	rm -f Makefile
- 	rm -f config.h config.status config.log
- 
-diff -Naur pacman-2.9.7.orig/scripts/gensync pacman-2.9.7/scripts/gensync
---- pacman-2.9.7.orig/scripts/gensync	2005-10-04 23:59:52.000000000 +0200
-+++ pacman-2.9.7/scripts/gensync	2005-10-05 00:01:24.000000000 +0200
-@@ -113,6 +113,9 @@
- 	echo "%CSIZE%" >>desc
- 	echo "$csize" >>desc
- 	echo "" >>desc
-+	echo "%USIZE%" >>desc
-+	echo "$usize" >>desc
-+	echo "" >>desc
- 	if [ ! -z $pkgmd5sum ]; then
- 		echo "%MD5SUM%" >>desc
- 		echo "$pkgmd5sum" >>desc
-@@ -218,6 +221,7 @@
- 	fi
- 	[ -f $pkgfile ] || die "missing package file: $pkgfile"
- 	csize=`du -b $pkgfile | cut -f1`
-+	usize=`cdu $pkgfile`
- 	if [ "$pkgname" == "pacman" ]; then
- 	    pkgmd5sum=`get_md5checksum $pkgfile`
- 	    [ -z $pkgmd5sum ] && die "error generating md5 checksum for $pkgfile"
-diff -Naur pacman-2.9.7.orig/scripts/updatesync pacman-2.9.7/scripts/updatesync
---- pacman-2.9.7.orig/scripts/updatesync	2005-10-04 23:59:52.000000000 +0200
-+++ pacman-2.9.7/scripts/updatesync	2005-10-05 00:01:45.000000000 +0200
-@@ -116,6 +116,9 @@
- 	echo "%CSIZE%" >>desc
- 	echo "$csize" >>desc
- 	echo "" >>desc
-+	echo "%USIZE%" >>desc
-+	echo "$usize" >>desc
-+	echo "" >>desc
- 	if [ ! -z $pkgmd5sum ]; then
- 		echo "%MD5SUM%" >>desc
- 		echo "$pkgmd5sum" >>desc
-@@ -243,6 +246,7 @@
- 	fi
- 	[ -f $pkgfile ] || die "missing package file: $pkgfile"
- 	csize=`du -b $pkgfile | cut -f1`
-+	usize=`cdu $pkgfile`
- 	if [ "$pkgname" == "pacman" ]; then
- 	    pkgmd5sum=`get_md5checksum $pkgfile`
- 	    [ -z $pkgmd5sum ] && die "error generating md5 checksum for $pkgfile"
-diff -Naur pacman-2.9.7.orig/src/cdu.c pacman-2.9.7/src/cdu.c
---- pacman-2.9.7.orig/src/cdu.c	1970-01-01 01:00:00.000000000 +0100
-+++ pacman-2.9.7/src/cdu.c	2005-10-05 00:00:33.000000000 +0200
-@@ -0,0 +1,56 @@
-+/*
-+ *  cdu.c
-+ * 
-+ *  Copyright (c) 2005 by Miklos Vajna <vmiklos at frugalware.org>
-+ * 
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
-+ *  USA.
-+ */
-+
-+#include <stdio.h>
-+#include <limits.h>
-+#include <archive.h>
-+#include <archive_entry.h>
-+
-+int main(int argc, char **argv)
-+{
-+	register struct archive *archive;
-+	struct archive_entry *entry;
-+	int i=0;
-+
-+	if(argc != 2)
-+	{
-+		printf("usage: %s archive_file\n", argv[0]);
-+		return(1);
-+	}
-+
-+	if ((archive = archive_read_new ()) == NULL)
-+		return(1);
-+	archive_read_support_compression_all (archive);
-+	archive_read_support_format_all (archive);
-+	
-+	if (archive_read_open_file (archive, argv[1], 10240) != ARCHIVE_OK)
-+	{
-+		perror("could not open package");
-+		return(1);
-+	}
-+
-+	while (archive_read_next_header (archive, &entry) == ARCHIVE_OK)
-+		i += archive_entry_size (entry);
-+
-+	archive_read_finish (archive);
-+	printf("%d\n", i);
-+	return(0);
-+}



More information about the Frugalware-darcs mailing list