Grrr ... I fixed this problem and instantly broke it the same way by
changing
int terminate = 1;
to
int terminate = 2;
The terminate check controls whether an immediate exit is to be
performed.
When doing dependency/ordering checks, one wants all the problems,
not just the next problem, returned.
A later rc = 0, clobbered an earlier rc = 1 when I changed to
terminate = 2.
So 5.0.3 coming soon. But I'd like to get a little more burn-in time
please ...
73 de Jeff
On Feb 7, 2008, at 5:15 PM, Jeff Johnson wrote:
> 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
> 23:15:32
> Branch: rpm-5_0 Handle: 2008020722153101
>
> Modified files: (Branch: rpm-5_0)
> rpm CHANGES
> rpm/lib depends.c
>
> Log:
> - jbj: fix: (again) rpmtsCheck() needs to return 1 when problems
> exist.
>
> Summary:
> Revision Changes Path
> 1.2054.2.41 +1 -0 rpm/CHANGES
> 1.377.2.2 +15 -14 rpm/lib/depends.c
>
> ______________________________________________________________________
> ______
>
> patch -p0 <<'@@ .'
> Index: rpm/CHANGES
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2054.2.40 -r1.2054.2.41 CHANGES
> --- rpm/CHANGES 7 Feb 2008 18:09:54 -0000 1.2054.2.40
> +++ rpm/CHANGES 7 Feb 2008 22:15:31 -0000 1.2054.2.41
> @@ -1,4 +1,5 @@
> 5.0.2 -> 5.0.3:
> + - jbj: fix: (again) rpmtsCheck() needs to return 1 when
> problems exist.
> - rse: add support for QNX by adjusting to its 3-parameter
> based makedev(2)
> - proyvind: add sparcv9v2 (Niagara 2) architecture
> - proyvind: add arch macros for alpha and sparc
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/lib/depends.c
>
> ======================================================================
> ======
> $ cvs diff -u -r1.377.2.1 -r1.377.2.2 depends.c
> --- rpm/lib/depends.c 29 Jan 2008 13:42:58 -0000 1.377.2.1
> +++ rpm/lib/depends.c 7 Feb 2008 22:15:32 -0000 1.377.2.2
> @@ -2416,6 +2416,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);
>
> @@ -2424,7 +2425,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);
> @@ -2437,7 +2438,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. */
> @@ -2462,13 +2463,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));
>
> @@ -2486,18 +2487,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;
>
> @@ -2509,7 +2510,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));
>
> @@ -2517,23 +2518,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;
>
> /*
> @@ -2549,7 +2550,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:
> @@ -2575,5 +2576,5 @@
> }
> #endif
>
> - return rc;
> + return ourrc;
> }
> @@ .
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> CVS Sources Repository rpm-cvs@rpm5.org
Received on Thu Feb 7 23:20:52 2008