From 42b139d1ebd3d50676d2709491d3e673ea07aad7 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Sat, 22 Jan 2011 17:35:13 +0300 Subject: [PATCH] removed --fileid query selector and Filemd5s rpmdb index (rpm.org) --- lib/poptQV.c | 5 ----- lib/query.c | 25 ------------------------- lib/rpmlib.h | 2 +- rpmdb/rpmdb.c | 42 ------------------------------------------ 4 files changed, 1 insertion(+), 73 deletions(-) diff --git a/lib/poptQV.c b/lib/poptQV.c index 831d2af..dd59010 100644 --- a/lib/poptQV.c +++ b/lib/poptQV.c @@ -25,7 +25,6 @@ int specedit = 0; #define POPT_SPECFILE -1006 #define POPT_QUERYBYPKGID -1007 #define POPT_QUERYBYHDRID -1008 -#define POPT_QUERYBYFILEID -1009 #define POPT_QUERYBYTID -1010 /* ========== Query/Verify source popt args */ @@ -60,8 +59,6 @@ static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con, qva->qva_sourceCount++; break; case POPT_QUERYBYHDRID: qva->qva_source |= RPMQV_HDRID; qva->qva_sourceCount++; break; - case POPT_QUERYBYFILEID: qva->qva_source |= RPMQV_FILEID; - qva->qva_sourceCount++; break; case POPT_QUERYBYTID: qva->qva_source |= RPMQV_TID; qva->qva_sourceCount++; break; @@ -88,8 +85,6 @@ struct poptOption rpmQVSourcePoptTable[] = { N_("query/verify all packages"), NULL }, { "file", 'f', 0, 0, 'f', N_("query/verify package(s) owning file"), "FILE" }, - { "fileid", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_QUERYBYFILEID, - N_("query/verify package(s) with file identifier"), "MD5" }, { "group", 'g', 0, 0, 'g', N_("query/verify package(s) in group"), "GROUP" }, { "hdrid", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_QUERYBYHDRID, diff --git a/lib/query.c b/lib/query.c index 94ebf3d..c4424ef 100644 --- a/lib/query.c +++ b/lib/query.c @@ -853,31 +853,6 @@ restart: } break; - case RPMQV_FILEID: - { unsigned char md5[16]; - unsigned char * t; - - for (i = 0, s = arg; *s && isxdigit(*s); s++, i++) - {}; - if (i != 32) { - rpmError(RPMERR_QUERY, _("malformed %s: %s\n"), "fileid", arg); - return 1; - } - - md5[0] = '\0'; - for (i = 0, t = md5, s = arg; i < 16; i++, t++, s += 2) - *t = (nibble(s[0]) << 4) | nibble(s[1]); - - mi = rpmdbInitIterator(rpmdb, RPMTAG_FILEMD5S, md5, sizeof(md5)); - if (mi == NULL) { - rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"), - "fileid", arg); - retcode = 1; - } else { - retcode = showMatches(qva, mi, showPackage); - } - } break; - case RPMQV_TID: { int mybase = 10; const char * myarg = arg; diff --git a/lib/rpmlib.h b/lib/rpmlib.h index db71199..68abda1 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -1675,7 +1675,7 @@ typedef enum rpmQVSources_e { RPMQV_SPECFILE, /*!< ... from spec file parse (query only). */ RPMQV_PKGID, /*!< ... from package id (header+payload MD5). */ RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */ - RPMQV_FILEID, /*!< ... from file id (file MD5). */ + R__QV_FILEID, /*!< ... from file id (file MD5). */ RPMQV_TID /*!< ... from install transaction id (time stamp). */ } rpmQVSources; diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index c0aab9a..bf2eaa2 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -63,7 +63,6 @@ const int dbiTags[] = { RPMTAG_INSTALLTID, RPMTAG_SIGMD5, RPMTAG_SHA1HEADER, - RPMTAG_FILEMD5S, }; const int dbiTagsMax = sizeof(dbiTags) / sizeof(*dbiTags); @@ -2383,16 +2382,6 @@ int rpmdbRemove(rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum) int stringvalued; unsigned char bin[32]; - switch (dbi->dbi_rpmtag) { - case RPMTAG_FILEMD5S: - /* Filter out empty MD5 strings. */ - if (!(rpmvals[i] && *rpmvals[i] != '\0')) - /*@innercontinue@*/ continue; - /*@switchbreak@*/ break; - default: - /*@switchbreak@*/ break; - } - /* Identify value pointer and length. */ stringvalued = 0; switch (rpmtype) { @@ -2419,19 +2408,6 @@ int rpmdbRemove(rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum) rpmcnt = 1; /* XXX break out of loop. */ /*@fallthrough@*/ case RPM_STRING_ARRAY_TYPE: - /* Convert from hex to binary. */ - if (dbi->dbi_rpmtag == RPMTAG_FILEMD5S) { - const char * s; - unsigned char * t; - - s = rpmvals[i]; - t = bin; - for (j = 0; j < 16; j++, t++, s += 2) - *t = (nibble(s[0]) << 4) | nibble(s[1]); - valp = bin; - vallen = 16; - /*@switchbreak@*/ break; - } #ifdef NOTYET /* Extract the pubkey id from the base64 blob. */ if (dbi->dbi_rpmtag == RPMTAG_PUBKEYS) { @@ -2737,11 +2713,6 @@ int rpmdbAdd(rpmdb db, int iid, Header h) case RPMTAG_PUBKEYS: /*@switchbreak@*/ break; #endif - case RPMTAG_FILEMD5S: - /* Filter out empty MD5 strings. */ - if (!(rpmvals[i] && *rpmvals[i] != '\0')) - /*@innercontinue@*/ continue; - /*@switchbreak@*/ break; case RPMTAG_REQUIRENAME: /* Filter out install prerequisites. */ if (requireFlags && isInstallPreReq(requireFlags[i])) @@ -2787,19 +2758,6 @@ int rpmdbAdd(rpmdb db, int iid, Header h) rpmcnt = 1; /* XXX break out of loop. */ /*@fallthrough@*/ case RPM_STRING_ARRAY_TYPE: - /* Convert from hex to binary. */ - if (dbi->dbi_rpmtag == RPMTAG_FILEMD5S) { - const char * s; - unsigned char * t; - - s = rpmvals[i]; - t = bin; - for (j = 0; j < 16; j++, t++, s += 2) - *t = (nibble(s[0]) << 4) | nibble(s[1]); - valp = bin; - vallen = 16; - /*@switchbreak@*/ break; - } #ifdef NOTYET /* Extract the pubkey id from the base64 blob. */ if (dbi->dbi_rpmtag == RPMTAG_PUBKEYS) {