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:
parent
b1a4b57315
commit
d8b1d68ae5
34
lib/rpmds.c
34
lib/rpmds.c
|
@ -793,37 +793,15 @@ int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote)
|
||||||
rpmds provides = NULL;
|
rpmds provides = NULL;
|
||||||
int result = 0;
|
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 */
|
/* Get provides information from header */
|
||||||
provides = rpmdsInit(rpmdsNew(h, RPMTAG_PROVIDENAME, 0));
|
provides = rpmdsInit(rpmdsNew(h, RPMTAG_PROVIDENAME, 0));
|
||||||
if (provides == NULL)
|
if (provides == NULL)
|
||||||
goto exit; /* XXX should never happen */
|
goto exit; /* XXX should never happen */
|
||||||
if (nopromote)
|
|
||||||
(void) rpmdsSetNoPromote(provides, 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = 0;
|
|
||||||
while (rpmdsNext(provides) >= 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);
|
result = rpmdsCompare(provides, req);
|
||||||
|
|
||||||
/* If this provide matches the require, we're done. */
|
/* 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;
|
rpmds pkg;
|
||||||
int rc = 1; /* XXX assume match, names already match here */
|
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 */
|
/* Get package information from header */
|
||||||
pkg = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL);
|
pkg = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL);
|
||||||
if (nopromote)
|
rpmdsSetNoPromote(pkg, nopromote);
|
||||||
rpmdsSetNoPromote(pkg, nopromote);
|
|
||||||
rc = rpmdsCompare(pkg, req);
|
rc = rpmdsCompare(pkg, req);
|
||||||
rpmdsFree(pkg);
|
rpmdsFree(pkg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue