RPM Community Forums

Mailing List Message of <rpm-cvs>

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

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 07 Feb 2008 - 22:48:30 CET
Message-Id: <20080207214830.32F57348479@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:   07-Feb-2008 22:48:30
  Branch: HEAD                             Handle: 2008020721482901

  Modified files:
    rpm                     CHANGES
    rpm/lib                 depends.c

  Log:
    - jbj: fix: (again) rpmtsCheck() needs to return 1 when problems
    exist.

  Summary:
    Revision    Changes     Path
    1.2143      +1  -0      rpm/CHANGES
    1.389       +15 -14     rpm/lib/depends.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2142 -r1.2143 CHANGES
  --- rpm/CHANGES	7 Feb 2008 20:11:08 -0000	1.2142
  +++ rpm/CHANGES	7 Feb 2008 21:48:29 -0000	1.2143
  @@ -1,4 +1,5 @@
   5.0.0 -> 5.1a1:
  +    - jbj: fix: (again) rpmtsCheck() needs to return 1 when problems exist.
       - jbj: install rpmcache in bindir, not pkglibdir.
       - jbj: fix: Fopen: heh, I swear I had a rpmExpand() on fmode somewhen ...
       - jbj: rpm.spec: nuke the xar.1 man page.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/depends.c
  ============================================================================
  $ cvs diff -u -r1.388 -r1.389 depends.c
  --- rpm/lib/depends.c	1 Feb 2008 19:45:53 -0000	1.388
  +++ rpm/lib/depends.c	7 Feb 2008 21:48:30 -0000	1.389
  @@ -2470,6 +2470,7 @@
       int xx;
       int terminate = 2;		/* XXX terminate if rc >= terminate */
       int rc = 0;
  +    int ourrc = 0;
   
       (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_CHECK), 0);
   
  @@ -2478,7 +2479,7 @@
   	rc = (rpmtsOpenDB(ts, rpmtsDBMode(ts)) ? 2 : 0);
   	closeatexit = (rc == 0);
       }
  -    if (rc >= terminate)
  +    if (rc && (ourrc = rc) >= terminate)
   	goto exit;
   
       ts->probs = rpmpsFree(ts->probs);
  @@ -2491,7 +2492,7 @@
        * are satisfied.
        */
       pi = rpmtsiInit(ts);
  -    while (rc < terminate && (p = rpmtsiNext(pi, TR_ADDED)) != NULL) {
  +    while (ourrc < terminate && (p = rpmtsiNext(pi, TR_ADDED)) != NULL) {
   	rpmds provides, requires, conflicts, dirnames, linktos;
   
   /*@-nullpass@*/	/* FIX: rpmts{A,O} can return null. */
  @@ -2516,13 +2517,13 @@
   	rc = checkPackageDeps(ts, rpmteNEVRA(p),
   			requires, conflicts, dirnames, linktos,
   			NULL, tscolor, 1);
  -	if (rc >= terminate)
  +	if (rc && (ourrc = rc) >= terminate)
   	    break;
   
   	provides = rpmteDS(p, RPMTAG_PROVIDENAME);
   	provides = rpmdsInit(provides);
   	if (provides != NULL)
  -	while (rc < terminate && rpmdsNext(provides) >= 0) {
  +	while (ourrc < terminate && rpmdsNext(provides) >= 0) {
   	    depName = _free(depName);
   	    depName = xstrdup(rpmdsN(provides));
   
  @@ -2540,18 +2541,18 @@
   	    if (checkDependentConflicts(ts, depName))
   		rc = 1;
   	}
  -	if (rc >= terminate)
  +	if (rc && (ourrc = rc) >= terminate)
   	    break;
       }
       pi = rpmtsiFree(pi);
  -    if (rc >= terminate)
  +    if (rc && (ourrc = rc) >= terminate)
   	goto exit;
   
       /*
        * Look at the removed packages and make sure they aren't critical.
        */
       pi = rpmtsiInit(ts);
  -    while (rc < terminate && (p = rpmtsiNext(pi, TR_REMOVED)) != NULL) {
  +    while (ourrc < terminate && (p = rpmtsiNext(pi, TR_REMOVED)) != NULL) {
   	rpmds provides;
   	rpmfi fi;
   
  @@ -2563,7 +2564,7 @@
   	provides = rpmteDS(p, RPMTAG_PROVIDENAME);
   	provides = rpmdsInit(provides);
   	if (provides != NULL)
  -	while (rc < terminate && rpmdsNext(provides) >= 0) {
  +	while (ourrc < terminate && rpmdsNext(provides) >= 0) {
   	    depName = _free(depName);
   	    depName = xstrdup(rpmdsN(provides));
   
  @@ -2571,23 +2572,23 @@
   	    if (checkDependentPackages(ts, depName))
   		rc = 1;
   	}
  -	if (rc >= terminate)
  +	if (rc && (ourrc = rc) >= terminate)
   	    break;
   
   	fi = rpmteFI(p, RPMTAG_BASENAMES);
   	fi = rpmfiInit(fi, 0);
  -	while (rc < terminate && rpmfiNext(fi) >= 0) {
  +	while (ourrc < terminate && rpmfiNext(fi) >= 0) {
   	    depName = _free(depName);
   	    depName = xstrdup(rpmfiFN(fi));
   	    /* Erasing: check filename against requiredby matches. */
   	    if (checkDependentPackages(ts, depName))
   		rc = 1;
   	}
  -	if (rc >= terminate)
  +	if (rc && (ourrc = rc) >= terminate)
   	    break;
       }
       pi = rpmtsiFree(pi);
  -    if (rc >= terminate)
  +    if (rc && (ourrc = rc) >= terminate)
   	goto exit;
   
       /*
  @@ -2603,7 +2604,7 @@
   	tscolor = 0;	/* XXX no coloring for transaction dependencies. */
   	rc = checkPackageDeps(ts, tsNEVRA, R, C, D, L, dep, tscolor, adding);
       }
  -    if (rc >= terminate)
  +    if (rc && (ourrc = rc) >= terminate)
   	goto exit;
   
   exit:
  @@ -2629,5 +2630,5 @@
       }
   #endif
   
  -    return rc;
  +    return ourrc;
   }
  @@ .
Received on Thu Feb 7 22:48:30 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.