From: Ales Kozumplik Date: Fri, 23 Dec 2011 12:51:38 +0000 (+0100) Subject: Allow deprecations to work accross colors (RhBug:713323) X-Git-Tag: rpm-4.10.0-beta1~175 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cb5d5ccfbcfc454aace1a538199c76b0d931479;p=platform%2Fupstream%2Frpm.git Allow deprecations to work accross colors (RhBug:713323) This enables package maintainers to: - Force removal of a no longer supported multilib library (the patch also removes the check against obsoleting packages of the same name). - Deprecate packages of different header color than the package's. Note: even x86_64 packages can have header color 1 in which case we are currently left with no means to deprecate them from another x86_64 package. (RhBug:751574) --- diff --git a/lib/depends.c b/lib/depends.c index 90df472..6ad97aa 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -178,17 +178,18 @@ static void addObsoleteErasures(rpmts ts, tsMembers tsmem, rpm_color_t tscolor, if ((Name = rpmdsN(obsoletes)) == NULL) continue; /* XXX can't happen */ - /* XXX avoid self-obsoleting packages. */ - if (rstreq(rpmteN(p), Name)) - continue; - mi = rpmtsPrunedIterator(ts, RPMDBI_NAME, Name, 1); while((oh = rpmdbNextIterator(mi)) != NULL) { - /* Ignore colored packages not in our rainbow. */ - if (skipColor(tscolor, hcolor, - headerGetNumber(oh, RPMTAG_HEADERCOLOR))) + const char *oarch = headerGetString(oh, RPMTAG_ARCH); + + /* avoid self-obsoleting packages */ + if (rstreq(rpmteN(p), Name) && rstreq(rpmteA(p), oarch)) { + char * ohNEVRA = headerGetAsString(oh, RPMTAG_NEVRA); + rpmlog(RPMLOG_DEBUG, " Not obsoleting: %s\n", ohNEVRA); + free(ohNEVRA); continue; + } /* * Rpm prior to 3.0.3 does not have versioned obsoletes.