diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-08-28 11:00:42 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-08-28 11:00:42 +0300 |
commit | f3b816c3095b3b0dbc10c89155d13b8927ddad6d (patch) | |
tree | b206865b47fdd9ac31c49f5ff832bdea72c84568 | |
parent | 477205014975bfc953430c6c261ee635686cd176 (diff) | |
download | rpm-f3b816c3095b3b0dbc10c89155d13b8927ddad6d.tar.gz rpm-f3b816c3095b3b0dbc10c89155d13b8927ddad6d.tar.bz2 rpm-f3b816c3095b3b0dbc10c89155d13b8927ddad6d.zip |
Install packages with preferred color first (rhbz#214737)
Patch by Jeff Johnson.
-rw-r--r-- | lib/depends.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/depends.c b/lib/depends.c index 6ce2c3843..39150d3a7 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -1160,7 +1160,8 @@ static int orderListIndexCmp(const void * one, const void * two) /*@*/ /*@-mustmod@*/ static void addQ(/*@dependent@*/ rpmte p, /*@in@*/ /*@out@*/ rpmte * qp, - /*@in@*/ /*@out@*/ rpmte * rp) + /*@in@*/ /*@out@*/ rpmte * rp, + uint_32 prefcolor) /*@modifies p, *qp, *rp @*/ { rpmte q, qprev; @@ -1180,6 +1181,10 @@ static void addQ(/*@dependent@*/ rpmte p, q != NULL; qprev = q, q = rpmteTSI(q)->tsi_suc) { + /* XXX Insure preferred color first. */ + if (rpmteColor(p) != prefcolor && rpmteColor(p) != rpmteColor(q)) + continue; + if (rpmteTSI(q)->tsi_qcnt <= rpmteTSI(p)->tsi_qcnt) break; } @@ -1208,6 +1213,7 @@ int rpmtsOrder(rpmts ts) rpmds requires; int_32 Flags; int anaconda = rpmtsFlags(ts) & RPMTRANS_FLAG_ANACONDA; + uint_32 prefcolor = rpmtsPrefColor(ts); rpmtsi pi; rpmte p; rpmtsi qi; rpmte q; rpmtsi ri; rpmte r; @@ -1370,7 +1376,7 @@ rescan: if (rpmteTSI(p)->tsi_count != 0) continue; rpmteTSI(p)->tsi_suc = NULL; - addQ(p, &q, &r); + addQ(p, &q, &r, prefcolor); qlen++; } pi = rpmtsiFree(pi); @@ -1441,7 +1447,7 @@ rescan: /* XXX TODO: add control bit. */ rpmteTSI(p)->tsi_suc = NULL; - addQ(p, &rpmteTSI(q)->tsi_suc, &r); + addQ(p, &rpmteTSI(q)->tsi_suc, &r, prefcolor); qlen++; } tsi = _free(tsi); |