Remove rpm v3 code

These cases are check for in rpmdsCompare() anyway. No need to "optimize" for a long dead rpm release.
This commit is contained in:
Florian Festi 2011-03-31 10:54:25 +02:00
parent b1a4b57315
commit d8b1d68ae5
1 changed files with 2 additions and 32 deletions

View File

@ -793,37 +793,15 @@ int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote)
rpmds provides = NULL;
int result = 0;
/* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
if (req->EVR == NULL || req->Flags == NULL)
return 1;
if (!(req->Flags[req->i] & RPMSENSE_SENSEMASK) || !req->EVR[req->i] || *req->EVR[req->i] == '\0')
return 1;
/* Get provides information from header */
provides = rpmdsInit(rpmdsNew(h, RPMTAG_PROVIDENAME, 0));
if (provides == NULL)
goto exit; /* XXX should never happen */
if (nopromote)
(void) rpmdsSetNoPromote(provides, nopromote);
/*
* Rpm prior to 3.0.3 did not have versioned provides.
* If no provides version info is available, match any/all requires
* with same name.
*/
if (provides->EVR == NULL) {
result = 1;
goto exit;
}
(void) rpmdsSetNoPromote(provides, nopromote);
result = 0;
while (rpmdsNext(provides) >= 0) {
/* Filter out provides that came along for the ride. */
if (!rstreq(provides->N[provides->i], req->N[req->i]))
continue;
result = rpmdsCompare(provides, req);
/* If this provide matches the require, we're done. */
@ -842,17 +820,9 @@ int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
rpmds pkg;
int rc = 1; /* XXX assume match, names already match here */
/* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
if (req->EVR == NULL || req->Flags == NULL)
return rc;
if (!((req->Flags[req->i] & RPMSENSE_SENSEMASK) && req->EVR[req->i] && *req->EVR[req->i]))
return rc;
/* Get package information from header */
pkg = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL);
if (nopromote)
rpmdsSetNoPromote(pkg, nopromote);
rpmdsSetNoPromote(pkg, nopromote);
rc = rpmdsCompare(pkg, req);
rpmdsFree(pkg);