2006-12-19 00:17:44 +01:00
|
|
|
Also compare the name and not only the version when checking if
|
|
|
|
two packages are the same. rh#104066
|
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: lib/depends.c
|
|
|
|
===================================================================
|
|
|
|
--- lib/depends.c.orig
|
|
|
|
+++ lib/depends.c
|
2009-08-28 15:54:03 +02:00
|
|
|
@@ -102,6 +102,24 @@ static int removePackage(rpmts ts, Heade
|
2006-12-19 00:17:44 +01:00
|
|
|
return 0;
|
2006-12-19 00:17:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+static int rpmNameVersionCompare(Header first, Header second)
|
|
|
|
+{
|
|
|
|
+ const char * one, * two;
|
|
|
|
+ int rc;
|
|
|
|
+
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = headerGetEntry(first, RPMTAG_NAME, NULL, (void **) &one, NULL);
|
|
|
|
+ rc = headerGetEntry(second, RPMTAG_NAME, NULL, (void **) &two, NULL);
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = strcmp(one, two);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = headerGetEntry(first, RPMTAG_ARCH, NULL, (void **) &one, NULL);
|
|
|
|
+ rc = headerGetEntry(second, RPMTAG_ARCH, NULL, (void **) &two, NULL);
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = strcmp(one, two);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
|
|
|
+ return rpmVersionCompare(first, second);
|
|
|
|
+}
|
|
|
|
+
|
2006-12-19 00:17:44 +01:00
|
|
|
int rpmtsAddInstallElement(rpmts ts, Header h,
|
|
|
|
fnpyKey key, int upgrade, rpmRelocation * relocs)
|
|
|
|
{
|
2009-08-28 15:54:03 +02:00
|
|
|
@@ -291,7 +309,7 @@ addheader:
|
2006-12-19 00:17:44 +01:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Skip packages that contain identical NEVR. */
|
|
|
|
- if (rpmVersionCompare(h, oh) == 0)
|
|
|
|
+ if (rpmNameVersionCompare(h, oh) == 0)
|
|
|
|
continue;
|
|
|
|
|
2009-08-28 15:54:03 +02:00
|
|
|
xx = removePackage(ts, oh, pkgKey);
|
|
|
|
@@ -342,11 +360,9 @@ addheader:
|
2006-12-19 00:17:44 +01:00
|
|
|
* If no obsoletes version info is available, match all names.
|
|
|
|
*/
|
|
|
|
if (rpmdsEVR(obsoletes) == NULL
|
2006-12-19 00:17:44 +01:00
|
|
|
- || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
|
|
|
|
+ || rpmdsNVRMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
|
2009-08-28 15:54:03 +02:00
|
|
|
char * ohNEVRA = headerGetNEVRA(oh, NULL);
|
2006-12-19 00:17:44 +01:00
|
|
|
-#ifdef DYING /* XXX see http://bugzilla.redhat.com #134497 */
|
|
|
|
- if (rpmVersionCompare(h, oh))
|
|
|
|
-#endif
|
|
|
|
+ if (rpmNameVersionCompare(h, oh))
|
2009-08-28 15:54:03 +02:00
|
|
|
xx = removePackage(ts, oh, pkgKey);
|
|
|
|
rpmlog(RPMLOG_DEBUG, " Obsoletes: %s\t\terases %s\n",
|
|
|
|
rpmdsDNEVR(obsoletes)+2, ohNEVRA);
|