diff options
author | jbj <devnull@localhost> | 2002-05-19 18:42:25 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-05-19 18:42:25 +0000 |
commit | 2126e4ad09e175a4356a29ab03756dbbeb8c976f (patch) | |
tree | e16e86b43a42c9c7fda695b04189afc1d551661b /tools | |
parent | 38385c8d6323e3695e0b267ab7b2fcffff9f72b3 (diff) | |
download | rpm-2126e4ad09e175a4356a29ab03756dbbeb8c976f.tar.gz rpm-2126e4ad09e175a4356a29ab03756dbbeb8c976f.tar.bz2 rpm-2126e4ad09e175a4356a29ab03756dbbeb8c976f.zip |
- Grand Renaming of rpm data types.
CVS patchset: 5439
CVS date: 2002/05/19 18:42:25
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rpmsort.c | 85 | ||||
-rw-r--r-- | tools/tpkgid.c | 22 |
2 files changed, 54 insertions, 53 deletions
diff --git a/tools/rpmsort.c b/tools/rpmsort.c index 5b8acea5a..bee037f0f 100644 --- a/tools/rpmsort.c +++ b/tools/rpmsort.c @@ -5,6 +5,7 @@ #include <rpmurl.h> #include "rpmdb.h" +#include "rpmps.h" #include "rpmte.h" #include "rpmts.h" @@ -45,7 +46,7 @@ static int do_tsort(const char *fileArgv[]) { const char * rootdir = "/"; - rpmTransactionSet ts = NULL; + rpmts ts = NULL; const char ** pkgURL = NULL; char * pkgState = NULL; const char ** fnp; @@ -210,7 +211,7 @@ restart: if (numFailed) goto exit; if (!noDeps) { - rpmProblemSet ps; + rpmps ps; rc = rpmtsCheck(ts); @@ -218,20 +219,20 @@ restart: if (ps) { rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); printDepProblems(stderr, ps); - ps = rpmProblemSetFree(ps); + ps = rpmpsFree(ps); rc = -1; goto exit; } - ps = rpmProblemSetFree(ps); + ps = rpmpsFree(ps); } rc = rpmtsOrder(ts); if (rc) goto exit; - { rpmDepSet requires; - teIterator pi; transactionElement p; - teIterator qi; transactionElement q; + { rpmds requires; + rpmtei pi; rpmte p; + rpmtei qi; rpmte q; unsigned char * selected = alloca(sizeof(*selected) * (ts->orderCount + 1)); int oType = TR_ADDED; @@ -241,43 +242,43 @@ fprintf(stdout, "digraph XXX {\n"); fprintf(stdout, " rankdir=LR\n"); fprintf(stdout, "//===== Packages:\n"); - pi = teInitIterator(ts); - while ((p = teNext(pi, oType)) != NULL) { -fprintf(stdout, "//%5d%5d %s\n", teGetTree(p), teGetDepth(p), teGetN(p)); - q = teGetParent(p); + pi = rpmteiInit(ts); + while ((p = rpmteiNext(pi, oType)) != NULL) { +fprintf(stdout, "//%5d%5d %s\n", rpmteTree(p), rpmteDepth(p), rpmteN(p)); + q = rpmteParent(p); if (q != NULL) -fprintf(stdout, " \"%s\" -> \"%s\"\n", teGetN(p), teGetN(q)); +fprintf(stdout, " \"%s\" -> \"%s\"\n", rpmteN(p), rpmteN(q)); else { -fprintf(stdout, " \"%s\"\n", teGetN(p)); -fprintf(stdout, " { rank=max ; \"%s\" }\n", teGetN(p)); +fprintf(stdout, " \"%s\"\n", rpmteN(p)); +fprintf(stdout, " { rank=max ; \"%s\" }\n", rpmteN(p)); } } - pi = teFreeIterator(pi); + pi = rpmteiFree(pi); #ifdef NOTNOW fprintf(stdout, "//===== Relations:\n"); - pi = teInitIterator(ts); - while ((p = teNext(pi, oType)) != NULL) { + pi = rpmteiInit(ts); + while ((p = rpmteiNext(pi, oType)) != NULL) { int printed; - if ((requires = teGetDS(p, RPMTAG_REQUIRENAME)) == NULL) + if ((requires = rpmteDS(p, RPMTAG_REQUIRENAME)) == NULL) continue; memset(selected, 0, sizeof(*selected) * ts->orderCount); - selected[teiGetOc(pi)] = 1; + selected[rpmteiGetOc(pi)] = 1; printed = 0; - requires = dsiInit(requires); - while (dsiNext(requires) >= 0) { + requires = rpmdsInit(requires); + while (rpmdsNext(requires) >= 0) { int_32 Flags; const char * qName; fnpyKey key; alKey pkgKey; int i; - Flags = dsiGetFlags(requires); + Flags = rpmdsFlags(requires); - switch (teGetType(p)) { + switch (rpmteType(p)) { case TR_REMOVED: /* Skip if not %preun/%postun requires or legacy prereq. */ if (isInstallPreReq(Flags) @@ -300,7 +301,7 @@ fprintf(stdout, "//===== Relations:\n"); /*@switchbreak@*/ break; } - if ((qName = dsiGetN(requires)) == NULL) + if ((qName = rpmdsN(requires)) == NULL) continue; /* XXX can't happen */ if (!strncmp(qName, "rpmlib(", sizeof("rpmlib(")-1)) continue; @@ -310,15 +311,15 @@ fprintf(stdout, "//===== Relations:\n"); if (pkgKey == RPMAL_NOMATCH) continue; - for (qi = teInitIterator(ts), i = 0; - (q = teNextIterator(qi)) != NULL; i++) + for (qi = rpmteiInit(ts), i = 0; + (q = rpmteiNext(qi, 0)) != NULL; i++) { - if (teGetType(q) == TR_REMOVED) + if (rpmteType(q) == TR_REMOVED) continue; - if (pkgKey == teGetAddedKey(q)) + if (pkgKey == rpmteAddedKey(q)) break; } - qi = teFreeIterator(qi); + qi = rpmteiFree(qi); if (q == NULL || i == ts->orderCount) continue; @@ -326,38 +327,38 @@ fprintf(stdout, "//===== Relations:\n"); continue; selected[i] = 1; - if (teGetTree(p) == teGetTree(q)) { - int pdepth = teGetDepth(p); - int qdepth = teGetDepth(q); + if (rpmteTree(p) == rpmteTree(q)) { + int pdepth = rpmteDepth(p); + int qdepth = rpmteDepth(q); #if 0 if (pdepth == qdepth) continue; if (pdepth < qdepth) { if ((qdepth - pdepth) > 1) continue; - if (!strcmp(teGetN(q), "glibc")) continue; - if (!strcmp(teGetN(q), "bash")) continue; + if (!strcmp(rpmteN(q), "glibc")) continue; + if (!strcmp(rpmteN(q), "bash")) continue; } #endif if (pdepth > qdepth) { - if (!strcmp(teGetN(q), "glibc")) continue; - if (!strcmp(teGetN(q), "bash")) continue; - if (!strcmp(teGetN(q), "info")) continue; - if (!strcmp(teGetN(q), "mktemp")) continue; + if (!strcmp(rpmteN(q), "glibc")) continue; + if (!strcmp(rpmteN(q), "bash")) continue; + if (!strcmp(rpmteN(q), "info")) continue; + if (!strcmp(rpmteN(q), "mktemp")) continue; } } if (!printed) { -fprintf(stdout, "// %s\n", teGetN(p)); +fprintf(stdout, "// %s\n", rpmteN(p)); printed = 1; } -fprintf(stdout, "//\t%s (0x%x)\n", dsDNEVR(identifyDepend(Flags), requires), Flags); -fprintf(stdout, "\t\"%s\" -> \"%s\"\n", teGetN(p), teGetN(q)); +fprintf(stdout, "//\t%s (0x%x)\n", rpmdsNewDNEVR(identifyDepend(Flags), requires), Flags); +fprintf(stdout, "\t\"%s\" -> \"%s\"\n", rpmteN(p), rpmteN(q)); } } - pi = teFreeIterator(pi); + pi = rpmteiFree(pi); #endif /* NOTNOW */ fprintf(stdout, "}\n"); diff --git a/tools/tpkgid.c b/tools/tpkgid.c index 246a569fc..3f4b2bd37 100644 --- a/tools/tpkgid.c +++ b/tools/tpkgid.c @@ -40,7 +40,7 @@ static int indent = 2; typedef struct Item_s { const char * path; - rpmDepSet this; + rpmds this; Header h; } * Item; @@ -50,7 +50,7 @@ static int nitems = 0; static inline Item freeItem(Item item) { if (item != NULL) { item->path = _free(item->path); - item->this = dsFree(item->this); + item->this = rpmdsFree(item->this); item->h = headerFree(item->h, NULL); item = _free(item); } @@ -65,7 +65,7 @@ static inline Item newItem(void) { static int cmpItem(const void * a, const void * b) { Item aitem = *(Item *)a; Item bitem = *(Item *)b; - int rc = strcmp(dsiGetN(aitem->this), dsiGetN(bitem->this)); + int rc = strcmp(rpmdsN(aitem->this), rpmdsN(bitem->this)); return rc; } @@ -83,10 +83,10 @@ static void ftsPrintPaths(FILE * fp) { fprintf(fp, "%s\n", items[i]->path); } -static int ftsStashLatest(FTSENT * fts, rpmTransactionSet ts) +static int ftsStashLatest(FTSENT * fts, rpmts ts) { Header h = NULL; - rpmDepSet add; + rpmds add; int ec = -1; /* assume not found */ int i = 0; @@ -108,7 +108,7 @@ static int ftsStashLatest(FTSENT * fts, rpmTransactionSet ts) return ec; /* XXX -1 */ } - add = dsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_EQUAL|RPMSENSE_LESS)); + add = rpmdsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_EQUAL|RPMSENSE_LESS)); if (items != NULL && nitems > 0) { Item needle = memset(alloca(sizeof(*needle)), 0, sizeof(*needle)); @@ -126,7 +126,7 @@ static int ftsStashLatest(FTSENT * fts, rpmTransactionSet ts) /* Check that all saved items are newer than this item. */ if (found != NULL) while (found < (items + nitems) && cmpItem(found, fneedle) == 0) { - ec = dsCompare(needle->this, (*found)->this); + ec = rpmdsCompare(needle->this, (*found)->this); if (ec == 0) { found++; continue; @@ -153,7 +153,7 @@ static int ftsStashLatest(FTSENT * fts, rpmTransactionSet ts) items[i] = newItem(); items[i]->path = xstrdup(fts->fts_path); - items[i]->this = dsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); + items[i]->this = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); items[i]->h = headerLink(h, NULL); if (nitems > 1) @@ -167,7 +167,7 @@ static int ftsStashLatest(FTSENT * fts, rpmTransactionSet ts) exit: h = headerFree(h, NULL); - add = dsFree(add); + add = rpmdsFree(add); return ec; } @@ -195,7 +195,7 @@ static const char * ftsInfoStr(int fts_info) { return ftsInfoStrings[ fts_info ]; } -static int ftsPrint(FTS * ftsp, FTSENT * fts, rpmTransactionSet ts) +static int ftsPrint(FTS * ftsp, FTSENT * fts, rpmts ts) { struct ftsglob_s * bhg; const char ** patterns; @@ -419,7 +419,7 @@ main(int argc, const char *argv[]) { poptContext optCon = poptGetContext(argv[0], argc, argv, optionsTable, 0); const char * rootDir = ""; - rpmTransactionSet ts = NULL; + rpmts ts = NULL; FTS * ftsp; FTSENT * fts; const char ** av; |