RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 21-Dec-2008 18:16:48 Branch: HEAD Handle: 2008122117164701 Modified files: rpm CHANGES VENDOR rpm/rpmdb rpmevr.c Log: - merge "support-wildcards-in-EVR-comparison" patch (OpenPKG). Summary: Revision Changes Path 1.2699 +1 -0 rpm/CHANGES 2.65 +0 -25 rpm/VENDOR 1.12 +9 -14 rpm/rpmdb/rpmevr.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2698 -r1.2699 CHANGES --- rpm/CHANGES 21 Dec 2008 08:42:29 -0000 1.2698 +++ rpm/CHANGES 21 Dec 2008 17:16:47 -0000 1.2699 @@ -1,5 +1,6 @@ 5.2a2 -> 5.2a3: + - jbj: merge "support-wildcards-in-EVR-comparison" patch (OpenPKG). - jbj: invert the sense of a <-> b comparison, change sign of Mandriva override. - jbj: bury MDV file triggers under RPM_VENDOR_MANDRIVA. - jbj: use poptSaneFile() when available (popt-1.15). @@ . patch -p0 <<'@@ .' Index: rpm/VENDOR ============================================================================ $ cvs diff -u -r2.64 -r2.65 VENDOR --- rpm/VENDOR 5 Dec 2008 07:07:43 -0000 2.64 +++ rpm/VENDOR 21 Dec 2008 17:16:47 -0000 2.65 @@ -330,31 +330,6 @@ Reason: [see scripts/integrity.txt for detailed documentation] ________________________________________________________________________ - Change: support-wildcards-in-EVR-comparison - Purpose: Support asterisk ("*") as a wildcard in EVR comparison. - Reason: In OpenPKG we sometimes wish to specify dependencies on - just the "Release" tag of a package and want to - avoid repeating the "Version" in front of it (we - do not care about the "Version" in this case, even - on "Version" downgrades). So, "foo >= *-20080201" - should match any package "foo" with a "Release" - larger than "20080201". This is important if one - wants to just assert the _packaging_ (versioned via - "Release") and not the _application_ (versioned - via "Version") status. It usually occurs after a - packaging fix in package "foo". - Hint: Technically, the better solution would be to use - the "Epoch" but this works only if one keeps the - "Epoch" monotonically increasing. In OpenPKG - "Epoch" is not used as the "Release" inherently and - intentionally _IS_ the monotonically increasing - value since many years (OpenPKG uses strict - well-defined values for "Release" throughout all - branches). Also, "Epoch" only works for the simple - "*" match, but not for more crazy things like "4.*.0" - or whatever else one can come up. - ________________________________________________________________________ - Change: use-bsdtar-for-zip-files Purpose: Use bsdtar(1) for unpacking ZIP format files. Reason: OpenPKG uses bsdtar(1) to unpack ZIP format files to @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmevr.c ============================================================================ $ cvs diff -u -r1.11 -r1.12 rpmevr.c --- rpm/rpmdb/rpmevr.c 21 Dec 2008 08:42:30 -0000 1.11 +++ rpm/rpmdb/rpmevr.c 21 Dec 2008 17:16:48 -0000 1.12 @@ -50,7 +50,7 @@ /*...@*/ { const char * ae, * be; - int rc = 0; + int rc = 0; /* assume equal */ /* Compare version strings segment by segment. */ for (; *a && *b && rc == 0; a = ae, b = be) { @@ -59,20 +59,15 @@ while (*a && !(xisdigit((int)*a) || xisrpmalpha((int)*a))) a++; while (*b && !(xisdigit((int)*b) || xisrpmalpha((int)*b))) b++; + /* Wildcard comparison? */ + /* Note: limited to suffix-only wildcard matching at the moment. */ + if (a[0] == '*' && a[1] == '\0') { + be = strchr(b, '\0'); /* XXX be = b + strlen(b); */ + } else + if (b[0] == '*' && b[1] == '\0') { + ae = strchr(a, '\0'); /* XXX ae = a + strlen(a); */ + } else /* Digit string comparison? */ -#if defined(RPM_VENDOR_OPENPKG) /* support-wildcards-in-EVR-comparison */ - if (a[0] == '*') { - ae = a + 1; - if ((be = strchr(b, a[1])) == NULL) - be = b; - } - else if (b[0] == '*') { - be = b + 1; - if ((ae = strchr(a, b[1])) == NULL) - ae = a; - } - else -#endif if (xisdigit((int)*a) || xisdigit((int)*b)) { /* Discard leading zeroes. */ while (a[0] == '0' && xisdigit((int)a[1])) a++; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
