summaryrefslogtreecommitdiff
path: root/lib/depends.c
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-08-28 11:49:00 +0200
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-08-28 11:49:00 +0200
commit27aa05cafc5ee733c2966fd3b1982924b60cb023 (patch)
tree09948458219aa165cd9161a641249c575b2da038 /lib/depends.c
parent061ab8dddc2a80555528662fd73c294112e7b346 (diff)
parentf13ab2f70138ac6ccf5574e44407152323e2c155 (diff)
downloadrpm-27aa05cafc5ee733c2966fd3b1982924b60cb023.tar.gz
rpm-27aa05cafc5ee733c2966fd3b1982924b60cb023.tar.bz2
rpm-27aa05cafc5ee733c2966fd3b1982924b60cb023.zip
hg sucks rocks
Diffstat (limited to 'lib/depends.c')
-rw-r--r--lib/depends.c12
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);