2014-09-16 14:03:10 +02:00
|
|
|
Also compare the name/arch and not only the version when checking if
|
2006-12-19 00:17:44 +01:00
|
|
|
two packages are the same. rh#104066
|
|
|
|
|
2014-09-16 14:03:10 +02:00
|
|
|
--- ./lib/depends.c.orig 2014-06-26 06:51:54.163820067 +0000
|
|
|
|
+++ ./lib/depends.c 2014-08-04 12:22:24.030575105 +0000
|
|
|
|
@@ -158,6 +158,24 @@ static int skipColor(rpm_color_t tscolor
|
2012-08-28 15:31:44 +02:00
|
|
|
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). */
|
2014-09-16 14:03:10 +02:00
|
|
|
static int addSelfErasures(rpmts ts, rpm_color_t tscolor, int op,
|
2012-08-28 15:31:44 +02:00
|
|
|
rpmte p, rpm_color_t hcolor, Header h)
|
2014-09-16 14:03:10 +02:00
|
|
|
@@ -172,7 +190,7 @@ static int addSelfErasures(rpmts ts, rpm
|
2012-08-28 15:31:44 +02:00
|
|
|
if (skipColor(tscolor, hcolor, headerGetNumber(oh, RPMTAG_HEADERCOLOR)))
|
2006-12-19 00:17:44 +01:00
|
|
|
continue;
|
|
|
|
|
2014-09-16 14:03:10 +02:00
|
|
|
- cmp = rpmVersionCompare(h, oh);
|
|
|
|
+ cmp = rpmNameVersionCompare(h, oh);
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2014-09-16 14:03:10 +02:00
|
|
|
/* On upgrade, skip packages that contain identical NEVR. */
|
|
|
|
if ((op == RPMTE_UPGRADE) && (cmp == 0))
|