diff options
author | jbj <devnull@localhost> | 2002-08-15 18:50:46 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-08-15 18:50:46 +0000 |
commit | c7881d801745b4c156a8aa2afc17b95f97481e34 (patch) | |
tree | 9c3b9d3cdbf8dd88bb6f9f6b2b4df87422d2f0da /lib/rpmts.c | |
parent | 622e40678461d27bc8f8b45061bdc4d866a8bdf2 (diff) | |
download | librpm-tizen-c7881d801745b4c156a8aa2afc17b95f97481e34.tar.gz librpm-tizen-c7881d801745b4c156a8aa2afc17b95f97481e34.tar.bz2 librpm-tizen-c7881d801745b4c156a8aa2afc17b95f97481e34.zip |
- python: explicit method to set transFlags.
- python: stuff package name into a string for repackage callbacks.
- rollback: re-create empty transaction set for multiple rollbacks.
- fix: %%basename typo (Dmitry V. Levin<ldv@altlinux.org>).
- fix: queryformat segfaults (Dmitry V. Levin<ldv@altlinux.org>).
CVS patchset: 5639
CVS date: 2002/08/15 18:50:46
Diffstat (limited to 'lib/rpmts.c')
-rw-r--r-- | lib/rpmts.c | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c index da8a9567c..d06d658ee 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -546,6 +546,7 @@ void rpmtsCleanDig(rpmts ts) void rpmtsClean(rpmts ts) { rpmtsi pi; rpmte p; + if (ts == NULL) return; @@ -566,10 +567,35 @@ void rpmtsClean(rpmts ts) rpmtsCleanDig(ts); } +void rpmtsEmpty(rpmts ts) +{ + rpmtsi pi; rpmte p; + int oc; + + if (ts == NULL) + return; + +/*@-nullstate@*/ /* FIX: partial annotations */ + rpmtsClean(ts); +/*@=nullstate@*/ + + for (pi = rpmtsiInit(ts), oc = 0; (p = rpmtsiNext(pi, 0)) != NULL; oc++) { +/*@-type -unqualifiedtrans @*/ + ts->order[oc] = rpmteFree(ts->order[oc]); +/*@=type =unqualifiedtrans @*/ + } + pi = rpmtsiFree(pi); + + ts->orderCount = 0; + + ts->numRemovedPackages = 0; +} + rpmts rpmtsFree(rpmts ts) { rpmtsi pi; rpmte p; int oc; + if (ts == NULL) return NULL; @@ -579,15 +605,21 @@ rpmts rpmtsFree(rpmts ts) if (ts->nrefs > 0) return NULL; +/*@-nullstate@*/ /* FIX: partial annotations */ + rpmtsEmpty(ts); +/*@=nullstate@*/ + (void) rpmtsCloseDB(ts); (void) rpmtsCloseSDB(ts); + ts->removedPackages = _free(ts->removedPackages); + ts->availablePackages = rpmalFree(ts->availablePackages); ts->numAvailablePackages = 0; ts->dsi = _free(ts->dsi); - ts->removedPackages = _free(ts->removedPackages); + if (ts->scriptFd != NULL) { ts->scriptFd = fdFree(ts->scriptFd, "rpmtsFree"); ts->scriptFd = NULL; @@ -595,25 +627,16 @@ rpmts rpmtsFree(rpmts ts) ts->rootDir = _free(ts->rootDir); ts->currDir = _free(ts->currDir); - for (pi = rpmtsiInit(ts), oc = 0; (p = rpmtsiNext(pi, 0)) != NULL; oc++) { -/*@-type -unqualifiedtrans @*/ - ts->order[oc] = rpmteFree(ts->order[oc]); -/*@=type =unqualifiedtrans @*/ - } - pi = rpmtsiFree(pi); /*@-type +voidabstract @*/ /* FIX: double indirection */ ts->order = _free(ts->order); /*@=type =voidabstract @*/ + ts->orderAlloced = 0; if (ts->pkpkt != NULL) ts->pkpkt = _free(ts->pkpkt); ts->pkpktlen = 0; memset(ts->pksignid, 0, sizeof(ts->pksignid)); -/*@-nullstate@*/ /* FIX: partial annotations */ - rpmtsClean(ts); -/*@=nullstate@*/ - /*@-refcounttrans@*/ ts = _free(ts); /*@=refcounttrans@*/ /*@=usereleased@*/ |