diff options
author | jbj <devnull@localhost> | 2001-10-31 22:19:42 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-10-31 22:19:42 +0000 |
commit | df89c3d2009d13e32b0aec7ccda28219d92d2c33 (patch) | |
tree | d2ccf298869d49e02488b09a79541dfc83ea5661 /lib/rpmal.c | |
parent | a15e74ecd67b7df026ce9bdb1204ef19ce5d4fde (diff) | |
download | librpm-tizen-df89c3d2009d13e32b0aec7ccda28219d92d2c33.tar.gz librpm-tizen-df89c3d2009d13e32b0aec7ccda28219d92d2c33.tar.bz2 librpm-tizen-df89c3d2009d13e32b0aec7ccda28219d92d2c33.zip |
Do tsort on transactionElement's, not availaiblePackage's.
CVS patchset: 5145
CVS date: 2001/10/31 22:19:42
Diffstat (limited to 'lib/rpmal.c')
-rw-r--r-- | lib/rpmal.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/lib/rpmal.c b/lib/rpmal.c index 2c65f4014..5eb690a33 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -26,6 +26,7 @@ typedef /*@abstract@*/ struct availableIndex_s * availableIndex; /*@access availableList@*/ /*@access availablePackage@*/ +/*@access tsortInfo@*/ /*@access rpmDepSet@*/ @@ -152,14 +153,6 @@ rpmDepSet alGetRequires(const availableList al, int pkgNum) /*@=immediatetrans =retexpose@*/ } -tsortInfo alGetTSI(const availableList al, int pkgNum) -{ - availablePackage alp = alGetPkg(al, pkgNum); - /*@-immediatetrans -retexpose@*/ - return (alp != NULL ? &alp->tsi : 0); - /*@=immediatetrans =retexpose@*/ -} - Header alGetHeader(availableList al, int pkgNum, int unlink) { availablePackage alp = alGetPkg(al, pkgNum); @@ -279,14 +272,6 @@ availableList alFree(availableList al) if ((p = al->list) != NULL) for (i = 0; i < al->size; i++, p++) { - { tsortInfo tsi; - while ((tsi = p->tsi.tsi_next) != NULL) { - p->tsi.tsi_next = tsi->tsi_next; - tsi->tsi_next = NULL; - tsi = _free(tsi); - } - } - p->provides.N = hfd(p->provides.N, -1); p->provides.EVR = hfd(p->provides.EVR, -1); p->requires.N = hfd(p->requires.N, -1); @@ -463,8 +448,6 @@ alAddPackage(availableList al, int pkgNum, p = al->list + pkgNum; p->h = headerLink(h); /* XXX reference held by transaction set */ - p->depth = p->npreds = 0; - memset(&p->tsi, 0, sizeof(p->tsi)); p->multiLib = 0; /* MULTILIB */ xx = headerNVR(p->h, &p->name, &p->version, &p->release); @@ -877,17 +860,16 @@ alAllSatisfiesDepend(const availableList al, return ret; } -availablePackage alSatisfiesDepend(const availableList al, +long alSatisfiesDepend(const availableList al, const char * keyType, const char * keyDepend, const rpmDepSet key) { - availablePackage ret; availablePackage * tmp = alAllSatisfiesDepend(al, keyType, keyDepend, key); if (tmp) { - ret = tmp[0]; + availablePackage ret = tmp[0]; tmp = _free(tmp); - return ret; + return (ret - al->list); } - return NULL; + return -1; } |