diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-10-29 14:09:27 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-10-30 13:47:40 +0200 |
commit | f01ed5459deb3b3cf5c1bd4077f89b02533071f0 (patch) | |
tree | 92cd2066c28a8e03e5917c1a71867f43d3ab9f8e /lib | |
parent | 8f41e940abe6950c807f530468adeb24049271ca (diff) | |
download | rpm-f01ed5459deb3b3cf5c1bd4077f89b02533071f0.tar.gz rpm-f01ed5459deb3b3cf5c1bd4077f89b02533071f0.tar.bz2 rpm-f01ed5459deb3b3cf5c1bd4077f89b02533071f0.zip |
Convert in-tree users of rpmfiNew() to use flag names
- easier to grep for than scareMem, preparing for further flags
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psm.c | 3 | ||||
-rw-r--r-- | lib/query.c | 3 | ||||
-rw-r--r-- | lib/rpmte.c | 2 | ||||
-rw-r--r-- | lib/tagexts.c | 8 | ||||
-rw-r--r-- | lib/transaction.c | 7 | ||||
-rw-r--r-- | lib/verify.c | 4 |
6 files changed, 11 insertions, 16 deletions
@@ -229,7 +229,6 @@ static rpmRC markReplacedFiles(const rpmpsm psm) rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, char ** specFilePtr, char ** cookie) { - int scareMem = 1; rpmfi fi = NULL; char * specFile = NULL; Header h = NULL; @@ -270,7 +269,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, goto exit; } - fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER); h = headerFree(h); if (fi == NULL) { /* XXX can't happen */ diff --git a/lib/query.c b/lib/query.c index 519fbdd4a..366355acb 100644 --- a/lib/query.c +++ b/lib/query.c @@ -102,7 +102,6 @@ static void printFileInfo(const char * name, int showQueryPackage(QVA_t qva, rpmts ts, Header h) { - int scareMem = 0; rpmfi fi = NULL; int rc = 0; /* XXX FIXME: need real return code */ int i; @@ -122,7 +121,7 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h) if (!(qva->qva_flags & QUERY_FOR_LIST)) goto exit; - fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_NOHEADER); if (rpmfiFC(fi) <= 0) { rpmlog(RPMLOG_NOTICE, _("(contains no files)\n")); goto exit; diff --git a/lib/rpmte.c b/lib/rpmte.c index fb4aefd44..776b923a8 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -143,7 +143,7 @@ static void addTE(rpmts ts, rpmte p, Header h, p->obsoletes = rpmdsNew(h, RPMTAG_OBSOLETENAME, scareMem); savep = rpmtsSetRelocateElement(ts, p); - p->fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + p->fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_NOHEADER); (void) rpmtsSetRelocateElement(ts, savep); rpmteColorDS(p, RPMTAG_PROVIDENAME); diff --git a/lib/tagexts.c b/lib/tagexts.c index 88ebf1991..44d8dfcf7 100644 --- a/lib/tagexts.c +++ b/lib/tagexts.c @@ -99,8 +99,7 @@ static void rpmfiBuildFNames(Header h, rpmTag tagN, static int filedepTag(Header h, rpmTag tagN, rpmtd td) { - int scareMem = 0; - rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, RPMFI_NOHEADER); rpmds ds = NULL; char **fdeps = NULL; int numfiles; @@ -117,7 +116,7 @@ static int filedepTag(Header h, rpmTag tagN, rpmtd td) else if (tagN == RPMTAG_REQUIRENAME) deptype = 'R'; - ds = rpmdsNew(h, tagN, scareMem); + ds = rpmdsNew(h, tagN, 0); fdeps = xmalloc(numfiles * sizeof(*fdeps)); while ((fileix = rpmfiNext(fi)) >= 0) { @@ -404,8 +403,7 @@ static int origfilenamesTag(Header h, rpmtd td) */ static int fileclassTag(Header h, rpmtd td) { - int scareMem = 0; - rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem); + rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, RPMFI_NOHEADER); char **fclasses; int ix, numfiles; diff --git a/lib/transaction.c b/lib/transaction.c index 46b949d5f..6da24e999 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -83,13 +83,12 @@ static int handleInstInstalledFiles(const rpmts ts, { rpmdbMatchIterator mi; Header h; - int scareMem = 0; mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &shared->otherPkg, sizeof(shared->otherPkg)); while ((h = rpmdbNextIterator(mi)) != NULL) { altNEVR = headerGetNEVRA(h, NULL); - otherFi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + otherFi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_NOHEADER); break; } mi = rpmdbFreeIterator(mi); @@ -804,7 +803,7 @@ static int runTransScripts(rpmts ts, rpmTag stag) if (rpmteFd(p) != NULL) { p->fi = rpmfiFree(p->fi); - fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1); + fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER); if (fi != NULL) { /* XXX can't happen */ if (stag == RPMTAG_PRETRANS) { fi->te = p; @@ -1394,7 +1393,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) fi = rpmfiFree(fi); savep = rpmtsSetRelocateElement(ts, p); - fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1); + fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER); (void) rpmtsSetRelocateElement(ts, savep); if (fi != NULL) { /* XXX can't happen */ diff --git a/lib/verify.c b/lib/verify.c index 69fcd162a..d620f7db5 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -406,12 +406,12 @@ static int verifyDependencies(QVA_t qva, rpmts ts, int showVerifyPackage(QVA_t qva, rpmts ts, Header h) { - int scareMem = 1; /* XXX only rpmVerifyScript needs now */ rpmfi fi; int ec = 0; int rc; - fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); + /* XXX only rpmVerifyScript needs KEEPHEADER */ + fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER); if (fi != NULL) { if (qva->qva_flags & VERIFY_DEPS) { |