Drop the useless "tag" argument from rpmteFI()
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 27 Nov 2008 08:02:00 +0000 (10:02 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 27 Nov 2008 08:02:00 +0000 (10:02 +0200)
- only RPMTAG_BASENAMES was ever allowed as the tag, makes no sense
- API change but AFAIK nothing outside rpm itself uses it anyway

lib/depends.c
lib/fprint.c
lib/rpmte.c
lib/rpmte.h
lib/rpmts.c
lib/transaction.c
python/rpmte-py.c

index d33a3a4..a06db56 100644 (file)
@@ -250,7 +250,7 @@ addheader:
     
     pkgKey = rpmalAdd(&ts->addedPackages, pkgKey, rpmteKey(p),
                        rpmteDS(p, RPMTAG_PROVIDENAME),
-                       rpmteFI(p, RPMTAG_BASENAMES), tscolor);
+                       rpmteFI(p), tscolor);
     if (pkgKey == RPMAL_NOMATCH) {
        ts->order[oc] = rpmteFree(ts->order[oc]);
        ec = 1;
@@ -1571,7 +1571,7 @@ int rpmtsCheck(rpmts ts)
            goto exit;
 
        rc = 0;
-       fi = rpmteFI(p, RPMTAG_BASENAMES);
+       fi = rpmteFI(p);
        fi = rpmfiInit(fi, 0);
        while (rpmfiNext(fi) >= 0) {
            const char * fn = rpmfiFN(fi);
index cb14fb8..060bd91 100644 (file)
@@ -238,7 +238,7 @@ void fpLookupList(fingerPrintCache cache, const char ** dirNames,
 
 void fpLookupSubdir(rpmFpHash ht, rpmFpHash newht, fingerPrintCache fpc, rpmte p, int filenr)
 {
-    rpmfi fi = rpmteFI(p, RPMTAG_BASENAMES);
+    rpmfi fi = rpmteFI(p);
     struct fingerPrint_s current_fp;
     char *endsubdir, *endbasename, *currentsubdir;
     size_t lensubDir;
@@ -280,7 +280,7 @@ void fpLookupSubdir(rpmFpHash ht, rpmFpHash newht, fingerPrintCache fpc, rpmte p
              char const *linktarget;
              char *link;
 
-             foundfi =  rpmteFI(recs[i].p, RPMTAG_BASENAMES);
+             foundfi =  rpmteFI(recs[i].p);
              fiFX = rpmfiFX(foundfi);
 
              filenr = recs[i].fileno;
index 50ac616..53ac5f8 100644 (file)
@@ -477,20 +477,17 @@ rpmds rpmteDS(rpmte te, rpmTag tag)
        return NULL;
 }
 
-rpmfi rpmteFI(rpmte te, rpmTag tag)
+rpmfi rpmteFI(rpmte te)
 {
     if (te == NULL)
        return NULL;
 
-    if (tag == RPMTAG_BASENAMES)
-       return te->fi;
-    else
-       return NULL;
+    return te->fi; /* XXX take fi reference here? */
 }
 
 void rpmteColorDS(rpmte te, rpmTag tag)
 {
-    rpmfi fi = rpmteFI(te, RPMTAG_BASENAMES);
+    rpmfi fi = rpmteFI(te);
     rpmds ds = rpmteDS(te, tag);
     char deptype = 'R';
     char mydt;
index 32ece3b..a5e939e 100644 (file)
@@ -365,10 +365,9 @@ rpmds rpmteDS(rpmte te, rpmTag tag);
 /** \ingroup rpmte
  * Retrieve file info tag set from transaction element.
  * @param te           transaction element
- * @param tag          file info tag (RPMTAG_BASENAMES)
  * @return             file info tag set
  */
-rpmfi rpmteFI(rpmte te, rpmTag tag);
+rpmfi rpmteFI(rpmte te);
 
 /** \ingroup rpmte
  * Calculate transaction element dependency colors/refs from file info.
index d431a1b..4d3bf03 100644 (file)
@@ -910,7 +910,7 @@ void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
     dsi = ts->dsi;
     if (dsi == NULL)
        return;
-    fc = rpmfiFC( rpmteFI(te, RPMTAG_BASENAMES) );
+    fc = rpmfiFC(rpmteFI(te));
     if (fc <= 0)
        return;
 
index 147042a..b32f1f4 100644 (file)
@@ -202,7 +202,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
            struct fingerPrint_s * otherFps;
            int otherFc;
 
-           otherFi = rpmteFI(recs[otherPkgNum].p, RPMTAG_BASENAMES);
+           otherFi = rpmteFI(recs[otherPkgNum].p);
            otherFileNum = recs[otherPkgNum].fileno;
 
            /* Added packages need only look at other added packages. */
@@ -786,7 +786,7 @@ void checkInstalledFiles(rpmts ts, fingerPrintCache fpc)
 
            for (j=0; (j<numRecs)&&gotRecs; j++) {
                p = recs[j].p;
-               fi = rpmteFI(p, RPMTAG_BASENAMES);
+               fi = rpmteFI(p);
 
                /* Determine the fate of each file. */
                switch (rpmteType(p)) {
index 7416ecc..b7427f9 100644 (file)
@@ -214,29 +214,12 @@ rpmte_DS(rpmteObject * s, PyObject * args, PyObject * kwds)
 static PyObject *
 rpmte_FI(rpmteObject * s, PyObject * args, PyObject * kwds)
 {
-    PyObject * TagN = NULL;
     rpmfi fi;
-    rpmTag tag;
-    char * kwlist[] = {"tag", NULL};
-
-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:FI", kwlist, &TagN))
-       return NULL;
 
-    tag = tagNumFromPyObject(TagN);
-    if (tag == -1) {
-       PyErr_SetString(PyExc_TypeError, "unknown tag type");
-       return NULL;
-    }
-
-    fi = rpmteFI(s->te, tag);
+    fi = rpmteFI(s->te);
     if (fi == NULL) {
-#ifdef DYING
-       PyErr_SetString(PyExc_TypeError, "invalid fi tag");
-       return NULL;
-#else
        Py_INCREF(Py_None);
        return Py_None;
-#endif
     }
     return (PyObject *) rpmfi_Wrap(rpmfiLink(fi, RPMDBG_M("rpmte_FI")));
 }