summaryrefslogtreecommitdiff
path: root/lib/rpmds.c
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2011-03-31 10:54:25 +0200
committerFlorian Festi <ffesti@redhat.com>2011-03-31 10:56:43 +0200
commitd8b1d68ae5aee846ef12c26d35ce14ed549ff435 (patch)
tree0755292e057abe2070de09b676d4f99cfcbd9e53 /lib/rpmds.c
parentb1a4b57315d31ba98bc0e5803db1ebc2517f6bb5 (diff)
downloadlibrpm-tizen-d8b1d68ae5aee846ef12c26d35ce14ed549ff435.tar.gz
librpm-tizen-d8b1d68ae5aee846ef12c26d35ce14ed549ff435.tar.bz2
librpm-tizen-d8b1d68ae5aee846ef12c26d35ce14ed549ff435.zip
Remove rpm v3 code
These cases are check for in rpmdsCompare() anyway. No need to "optimize" for a long dead rpm release.
Diffstat (limited to 'lib/rpmds.c')
-rw-r--r--lib/rpmds.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 29386733c..3dff6cb55 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -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);