aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs8
1 files changed, 7 insertions, 1 deletions
diff --git a/URPM.xs b/URPM.xs
index 2d338e0..e4ba8dc 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2148,7 +2148,7 @@ Pkg_compare(pkg, evr)
_epoch = get_int(pkg->h, RPMTAG_EPOCH);
} else croak("undefined package");
if (!compare) {
- char *epoch, *version, *release;
+ char *epoch, *version, *release, *distepoch;
/* extract epoch and version from evr */
version = evr;
@@ -2170,6 +2170,10 @@ Pkg_compare(pkg, evr)
/* continue extracting release if any */
if ((release = strrchr(version, '-')) != NULL) {
*release++ = 0;
+ /* XXX: compare distepoch rather than just ignoring? */
+ if ((distepoch = strrchr(release, ':')) != NULL)
+ *distepoch++ = 0;
+
compare = rpmvercmp(_version, version);
if (!compare) {
/* need to compare with release here */
@@ -2178,6 +2182,8 @@ Pkg_compare(pkg, evr)
compare = rpmvercmp(_release, release);
}
release[-1] = '-'; /* restore in memory modification */
+ if (distepoch != NULL)
+ distepoch[-1] = ':';
} else {
compare = rpmvercmp(_version, version);
}