fix: legacy syntax not even close.
authorjbj <devnull@localhost>
Sun, 17 Oct 2004 18:24:36 +0000 (18:24 +0000)
committerjbj <devnull@localhost>
Sun, 17 Oct 2004 18:24:36 +0000 (18:24 +0000)
- permit Obsoletes: /path/to/file.

CVS patchset: 7474
CVS date: 2004/10/17 18:24:36

CHANGES
build/parsePreamble.c
build/parseReqs.c
lib/depends.c

diff --git a/CHANGES b/CHANGES
index 0b08299..f39a613 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -19,6 +19,7 @@
        - disable expensive header+payload verifies in default config.
        - adjust digest/signature stats to count #pkgs and bytes.
        - obsolete Serial:, Copyright:, and RHNPlatform: syntax in spec files.
+       - permit Obsoletes: /path/to/file.
 
 4.3.1 -> 4.3.2:
        - use /etc/selinux/targeted/contexts/files/file_contexts for now.
index ff93cb9..776f235 100644 (file)
@@ -809,13 +809,14 @@ static int findPreambleTag(Spec spec, /*@out@*/rpmTag * tag,
        initPreambleList();
 
     for (p = preambleList; p->token != NULL; p++) {
-       if (p->token && !xstrncasecmp(spec->line, p->token, p->len))
-           break;
+       if (!(p->token && !xstrncasecmp(spec->line, p->token, p->len)))
+           continue;
        if (p->obsolete) {
            rpmError(RPMERR_BADSPEC, _("Obsolete syntax: %s\n"),
                        p->token);
            p = NULL;
        }
+       break;
     }
     if (p == NULL || p->token == NULL)
        return 1;
index ca7f4b5..c0c210c 100644 (file)
@@ -106,7 +106,6 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, rpmTag tagN,
 
        /* Don't permit file names as args for certain tags */
        switch (tagN) {
-       case RPMTAG_OBSOLETEFLAGS:
        case RPMTAG_CONFLICTFLAGS:
        case RPMTAG_BUILDCONFLICTS:
            if (r[0] == '/') {
index d8e789b..b747ba6 100644 (file)
@@ -289,7 +289,10 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
        if (!strcmp(rpmteN(p), Name))
            continue;
 
-       mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0);
+       if (Name[0] == '/')
+           mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, Name, 0);
+       else
+           mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, Name, 0);
 
        xx = rpmdbPruneIterator(mi,
            ts->removedPackages, ts->numRemovedPackages, 1);
@@ -307,11 +310,16 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
             * If no obsoletes version info is available, match all names.
             */
            if (rpmdsEVR(obsoletes) == NULL
-            || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote))
+            || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
+               const char * ohNEVRA = hGetNEVRA(oh, NULL);
 #ifdef DYING   /* XXX see http://bugzilla.redhat.com #134497 */
                if (rpmVersionCompare(h, oh))
 #endif
                    xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey);
+               rpmMessage(RPMMESS_DEBUG, _("  Obsoletes: %s\t\terases %s\n"),
+                       rpmdsDNEVR(obsoletes)+2, ohNEVRA);
+               ohNEVRA = _free(ohNEVRA);
+           }
        }
        mi = rpmdbFreeIterator(mi);
     }