Sophie

Sophie

distrib > Mandriva > 2008.0 > x86_64 > by-pkgid > a35732d620cfac4812adc8d6b2992f07 > files > 51

rpm-4.4.8-22.1mdv2008.0.src.rpm

Index: lib/transaction.c
===================================================================
RCS file: /v/rpm/cvs/rpm/lib/transaction.c,v
retrieving revision 1.325
diff -u -b -B -w -p -r1.325 transaction.c
--- lib/transaction.c	10 Jul 2007 17:18:12 -0000	1.325
+++ lib/transaction.c	11 Jul 2007 20:42:39 -0000
@@ -104,7 +104,6 @@ static int handleInstInstalledFiles(cons
     uint_32 otecolor, tecolor;
     uint_32 oFColor, FColor;
     uint_32 oFFlags, FFlags;
-    struct stat sb, *st = &sb;
     const char * altNEVRA = NULL;
     rpmfi otherFi = NULL;
     rpmps ps;
@@ -177,24 +176,6 @@ static int handleInstInstalledFiles(cons
 	if (((FFlags | oFFlags) & RPMFILE_GHOST))
 	    continue;
 
-	/* Check for shared %config files that are installed and sparse. */
-	if ((FFlags | oFFlags) & RPMFILE_CONFIG) {
-	    if (!Lstat(rpmfiFN(fi), st)) {
-		if (FFlags & RPMFILE_CONFIG) {
-		    FFlags |= RPMFILE_EXISTS;
-		    if ((512 * st->st_blocks) < st->st_size)
-		 	FFlags |= RPMFILE_SPARSE;
-		    (void) rpmfiSetFFlags(fi, FFlags);
-		}
-		if (oFFlags & RPMFILE_CONFIG) {
-		    oFFlags |= RPMFILE_EXISTS;
-		    if ((512 * st->st_blocks) < st->st_size)
-		 	oFFlags |= RPMFILE_SPARSE;
-		    (void) rpmfiSetFFlags(otherFi, oFFlags);
-		}
-	    }
-	}
-
 	if (rpmfiCompare(otherFi, fi)) {
 	    int rConflicts;
 
@@ -1517,8 +1498,19 @@ rpmMessage(RPMMESS_DEBUG, _("computing f
 
 	numShared = 0;
  	fi = rpmfiInit(fi, 0);
-	while ((i = rpmfiNext(fi)) >= 0)
+	while ((i = rpmfiNext(fi)) >= 0) {
+	    struct stat sb, *st = &sb;
+	    uint_32 FFlags = rpmfiFFlags(fi);
 	    numShared += dbiIndexSetCount(matches[i]);
+	    if (!(FFlags & RPMFILE_CONFIG))
+		continue;
+	    if (!Lstat(rpmfiFN(fi), st)) {
+		FFlags |= RPMFILE_EXISTS;
+		if ((512 * st->st_blocks) < st->st_size)
+		     FFlags |= RPMFILE_SPARSE;
+		(void) rpmfiSetFFlags(fi, FFlags);
+	    }
+	}
 
 	/* Build sorted file info list for this package. */
 	shared = sharedList = xcalloc((numShared + 1), sizeof(*sharedList));