removed --fileid query selector and Filemd5s rpmdb index (rpm.org)

This commit is contained in:
Alexey Tourbin 2011-01-22 17:35:13 +03:00
parent ed41c1738f
commit 42b139d1eb
4 changed files with 1 additions and 73 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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) {