summaryrefslogtreecommitdiff
path: root/lib/rpmal.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-04-05 11:32:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-04-05 11:43:58 +0300
commit8106e7e89c3c673f8eb7d2ed5027e2ee9750e3b5 (patch)
treeff5fe1a4dd05f9ceda859242875153eb5d3fb9cc /lib/rpmal.c
parentb9c96a9fa9137f5bd26569466fd12c41a519c1f8 (diff)
downloadrpm-8106e7e89c3c673f8eb7d2ed5027e2ee9750e3b5.tar.gz
rpm-8106e7e89c3c673f8eb7d2ed5027e2ee9750e3b5.tar.bz2
rpm-8106e7e89c3c673f8eb7d2ed5027e2ee9750e3b5.zip
Handle obsolete matches (more) correctly in rpmal
- Similar to commit 9fb81eac0bcd239e46459f72916099f1adfc5cb9 but on the to-be-installed set: obsoletes should only be matched against package names, not any provide or file names. Hasn't really mattered previously due to the way its called, but since commit 05487d9a3f763cfed5f5ca75b4fbadb62f38dfd6 I guess it started to matter. It's more correct this way anyhow, and should fix RhBug:810077. - Since rpmal only knows about provides, we need to handle obsoletes as a special case and filter out matches on provide names different than the matching package name.
Diffstat (limited to 'lib/rpmal.c')
-rw-r--r--lib/rpmal.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rpmal.c b/lib/rpmal.c
index bbf0abb5f..8d5446d57 100644
--- a/lib/rpmal.c
+++ b/lib/rpmal.c
@@ -324,6 +324,7 @@ static rpmte * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds)
const char * name;
availableIndexEntry result;
int resultCnt;
+ int obsolete;
availablePackage alp;
int rc;
@@ -334,7 +335,8 @@ static rpmte * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds)
if (al->providesHash == NULL && al->fileHash == NULL)
rpmalMakeIndex(al);
- if (*name == '/') {
+ obsolete = (rpmdsTagN(ds) == RPMTAG_OBSOLETENAME);
+ if (!obsolete && *name == '/') {
/* First, look for files "contained" in package ... */
ret = rpmalAllFileSatisfiesDepend(al, ds);
if (ret != NULL && *ret != NULL)
@@ -355,6 +357,11 @@ static rpmte * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds)
if (alp->p == NULL) // deleted
continue;
(void) rpmdsSetIx(alp->provides, result[i].entryIx);
+
+ /* Obsoletes are on package name, filter out other provide matches */
+ if (obsolete && !rstreq(rpmdsN(alp->provides), rpmteN(alp->p)))
+ continue;
+
rc = 0;
if (rpmdsIx(alp->provides) >= 0)
rc = rpmdsCompare(alp->provides, ds);