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
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
--- ./lib/depends.c.orig 2012-06-01 10:07:12.000000000 +0000
|
|
|
|
+++ ./lib/depends.c 2012-06-01 10:16:13.000000000 +0000
|
|
|
|
@@ -144,6 +144,24 @@ static int skipColor(rpm_color_t tscolor
|
|
|
|
return tscolor && color && ocolor && !(color & ocolor);
|
2006-12-19 00:17:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+static int rpmNameVersionCompare(Header first, Header second)
|
|
|
|
+{
|
|
|
|
+ const char * one, * two;
|
|
|
|
+ int rc;
|
|
|
|
+
|
2011-05-16 18:07:44 +02:00
|
|
|
+ one = headerGetString(first, RPMTAG_NAME);
|
|
|
|
+ two = headerGetString(second, RPMTAG_NAME);
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = strcmp(one, two);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
2011-05-16 18:07:44 +02:00
|
|
|
+ one = headerGetString(first, RPMTAG_ARCH);
|
|
|
|
+ two = headerGetString(second, RPMTAG_ARCH);
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = strcmp(one, two);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
|
|
|
+ return rpmVersionCompare(first, second);
|
|
|
|
+}
|
|
|
|
+
|
2012-08-28 15:31:44 +02:00
|
|
|
/* Add erase elements for older packages of same color (if any). */
|
|
|
|
static int addUpgradeErasures(rpmts ts, rpm_color_t tscolor,
|
|
|
|
rpmte p, rpm_color_t hcolor, Header h)
|
|
|
|
@@ -157,8 +175,8 @@ static int addUpgradeErasures(rpmts ts,
|
|
|
|
if (skipColor(tscolor, hcolor, headerGetNumber(oh, RPMTAG_HEADERCOLOR)))
|
2006-12-19 00:17:44 +01:00
|
|
|
continue;
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
- /* Skip packages that contain identical NEVR. */
|
2006-12-19 00:17:44 +01:00
|
|
|
- if (rpmVersionCompare(h, oh) == 0)
|
2012-08-28 15:31:44 +02:00
|
|
|
+ /* Skip packages that contain identical NEVRA. */
|
2006-12-19 00:17:44 +01:00
|
|
|
+ if (rpmNameVersionCompare(h, oh) == 0)
|
|
|
|
continue;
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
if (removePackage(ts, oh, p)) {
|