Remove RPMTAG_FILESTATUS tag extension
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 15 Nov 2010 09:06:44 +0000 (11:06 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 15 Nov 2010 09:12:50 +0000 (11:12 +0200)
- This is a bad "API" for verification, it can't be controlled and
  causes heavy IO where one would not expect it. Getting rid of it now
  before anybody starts relying on it...
- Leaving :fstatus format extension alone however, it's at least harmless
  and produces a more predictable output than :vflags extension so it
  might be actually useful in scripts.

lib/rpmtag.h
lib/tagexts.c
tests/rpmgeneral.at

index 5f7ee17..1781011 100644 (file)
@@ -290,7 +290,6 @@ typedef enum rpmTag_e {
     RPMTAG_POSTTRANSFLAGS      = 5025, /* i */
     RPMTAG_VERIFYSCRIPTFLAGS   = 5026, /* i */
     RPMTAG_TRIGGERSCRIPTFLAGS  = 5027, /* i[] */
-    RPMTAG_FILESTATUS          = 5028, /* i[] extension */
     RPMTAG_COLLECTIONS         = 5029, /* s[] list of collections */
     RPMTAG_POLICYNAMES         = 5030, /* s[] */
     RPMTAG_POLICYTYPES         = 5031, /* s[] */
index ef15fc8..fa21411 100644 (file)
@@ -687,28 +687,6 @@ static int epochnumTag(Header h, rpmtd td, headerGetFlags hgflags)
     return 1;
 }
 
-static int filestatusTag(Header h, rpmtd td, headerGetFlags hgflags)
-{
-    rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, RPMFI_FLAGS_VERIFY);
-    int fc = rpmfiFC(fi);
-    uint32_t *stats = (fc > 0) ? xcalloc(fc, sizeof(*stats)) : NULL;
-    int ix;
-
-    while ((ix = rpmfiNext(fi)) >= 0) {
-       rpmVerifyAttrs verifyResult = 0;
-       (void) rpmVerifyFile(NULL, fi, &verifyResult, RPMVERIFY_NONE);
-       stats[ix] = verifyResult;
-    }
-    rpmfiFree(fi);
-
-    td->type = RPM_INT32_TYPE;
-    td->count = fc;
-    td->data = stats;
-    td->flags = RPMTD_ALLOCED;
-    
-    return (fc > 0);
-}
-
 static const struct headerTagFunc_s rpmHeaderTagExtensions[] = {
     { RPMTAG_GROUP,            groupTag },
     { RPMTAG_DESCRIPTION,      descriptionTag },
@@ -734,7 +712,6 @@ static const struct headerTagFunc_s rpmHeaderTagExtensions[] = {
     { RPMTAG_HEADERCOLOR,      headercolorTag },
     { RPMTAG_VERBOSE,          verboseTag },
     { RPMTAG_EPOCHNUM,         epochnumTag },
-    { RPMTAG_FILESTATUS,       filestatusTag },
     { 0,                       NULL }
 };
 
index 6648768..9c64bb4 100644 (file)
@@ -126,7 +126,6 @@ FILERDEVS
 FILEREQUIRE
 FILESIZES
 FILESTATES
-FILESTATUS
 FILEUSERNAME
 FILEVERIFYFLAGS
 FSCONTEXTS