RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ transaction.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 12 Jul 2007 - 12:00:06 CEST
Message-Id: <20070712100006.E02D83484F1@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   12-Jul-2007 12:00:06
  Branch: HEAD                             Handle: 2007071211000501

  Modified files:
    rpm                     CHANGES
    rpm/lib                 transaction.c

  Log:
    - insure that RPMFILE_EXISTS is set for %config files.

  Summary:
    Revision    Changes     Path
    1.1455      +1  -0      rpm/CHANGES
    1.326       +12 -20     rpm/lib/transaction.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1454 -r1.1455 CHANGES
  --- rpm/CHANGES	11 Jul 2007 11:22:22 -0000	1.1454
  +++ rpm/CHANGES	12 Jul 2007 10:00:05 -0000	1.1455
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: insure that RPMFILE_EXISTS is set for %config files.
       - jbj: revert the _GetPass() hack-a-round.
       - jbj: set a default 0022 umask value always (#83006).
       - rse: remove the already obsolete rpm.c
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/transaction.c
  ============================================================================
  $ cvs diff -u -r1.325 -r1.326 transaction.c
  --- rpm/lib/transaction.c	10 Jul 2007 17:18:12 -0000	1.325
  +++ rpm/lib/transaction.c	12 Jul 2007 10:00:06 -0000	1.326
  @@ -104,7 +104,6 @@
       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 @@
   	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 @@
   
   	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));
  @@ .
Received on Thu Jul 12 12:00:06 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.