diff options
-rw-r--r-- | URPM.xs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); } |