fix: with unspecified epochs, skip dependency epoch compare.
authorjbj <devnull@localhost>
Tue, 14 Sep 1999 16:04:03 +0000 (16:04 +0000)
committerjbj <devnull@localhost>
Tue, 14 Sep 1999 16:04:03 +0000 (16:04 +0000)
CVS patchset: 3283
CVS date: 1999/09/14 16:04:03

CHANGES
lib/depends.c
lib/depends.h
lib/signature.c
po/rpm.pot
rpm.spec

diff --git a/CHANGES b/CHANGES
index 8984566..45e7e22 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -49,6 +49,7 @@
        - fix: avoid db problems with self-obsoleting packages on install.
        - glibc2: always enable dynamic mtrace if available.
        - fix: versioned provides devolved to existence test with conflicts.
+       - fix: with unspecified epochs, skip dependency epoch compare.
 
 3.0.1 -> 3.0.2
        - eliminate armv4 entries from rpmrc (Andrew E. Mileski).
index 94245ee..7deb5cb 100644 (file)
@@ -85,8 +85,8 @@ static struct availablePackage * alAddPackage(struct availableList * al,
 
     headerNVR(p->h, &p->name, &p->version, &p->release);
 
-    p->hasEpoch = headerGetEntry(h, RPMTAG_EPOCH, NULL, (void **) &p->epoch, 
-                                 NULL);
+    if (!headerGetEntry(h, RPMTAG_EPOCH, NULL, (void **) &p->epoch, NULL))
+       p->epoch = NULL;
 
     if (!headerGetEntry(h, RPMTAG_PROVIDENAME, NULL, (void **) &p->provides,
        &p->providesCount)) {
@@ -211,7 +211,7 @@ static void parseEVR(char *evr, const char **ep, const char **vp, const char **r
        version = s;
        if (*epoch == '\0') epoch = "0";
     } else {
-       epoch = "0";
+       epoch = NULL;   /* XXX disable epoch compare if missing */
        version = evr;
     }
     if (se) {
@@ -336,7 +336,7 @@ static int rangeMatchesDepFlags (Header h, const char *reqName, const char * req
 int headerMatchesDepFlags(Header h, const char *reqName, const char * reqEVR, int reqFlags)
 {
     const char *name, *version, *release;
-    int_32 * epochval;
+    int_32 * epoch;
     char *pkgEVR;
     int pkgFlags = RPMSENSE_EQUAL;
     int type, count;
@@ -349,8 +349,8 @@ int headerMatchesDepFlags(Header h, const char *reqName, const char * reqEVR, in
 
     pkgEVR = alloca(21 + strlen(version) + 1 + strlen(release) + 1);
     *pkgEVR = '\0';
-    if (headerGetEntry(h, RPMTAG_EPOCH, &type, (void **) &epochval, &count))
-       sprintf(pkgEVR, "%d:", *epochval);
+    if (headerGetEntry(h, RPMTAG_EPOCH, &type, (void **) &epoch, &count))
+       sprintf(pkgEVR, "%d:", *epoch);
     strcat(pkgEVR, version);
     strcat(pkgEVR, "-");
     strcat(pkgEVR, release);
@@ -896,7 +896,8 @@ static int checkDependentConflicts(rpmTransactionSet rpmdep,
     dbiIndexSet matches;
     int rc;
 
-    if (rpmdep->db == NULL) return 0;
+    if (rpmdep->db == NULL)
+       return 0;
 
     if (rpmdbFindByConflicts(rpmdep->db, key, &matches)) {
        return 0;
@@ -1102,10 +1103,13 @@ int rpmdepOrder(rpmTransactionSet rpmdep)
     return 0;
 }
 
-static char *buildEVR(const char *v, const char *r)
+static char *buildEVR(int_32 *e, const char *v, const char *r)
 {
-    char *pEVR = malloc(strlen(v) + 1 + strlen(r) + 1);
-    strcpy(pEVR, v);
+    char *pEVR = malloc(21 + strlen(v) + 1 + strlen(r) + 1);
+    *pEVR = '\0';
+    if (e)
+       sprintf(pEVR, "%d:", *e);
+    strcat(pEVR, v);
     strcat(pEVR, "-");
     strcat(pEVR, r);
     return pEVR;
@@ -1148,7 +1152,7 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
        are satisfied */
     p = rpmdep->addedPackages.list;
     for (i = 0; i < rpmdep->addedPackages.size; i++, p++) {
-       pEVR = buildEVR(p->version, p->release);
+       pEVR = buildEVR(p->epoch, p->version, p->release);
 
        if (checkPackageDeps(rpmdep, &ps, p->h, NULL, NULL, 0))
            goto exit;
@@ -1186,6 +1190,7 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
     /* now look at the removed packages and make sure they aren't critical */
     for (i = 0; i < rpmdep->numRemovedPackages; i++) {
        const char *name, *version, *release;
+       int_32 *epoch;
 
        h = rpmdbGetRecord(rpmdep->db, rpmdep->removedPackages[i]);
        if (h == NULL) {
@@ -1196,7 +1201,9 @@ int rpmdepCheck(rpmTransactionSet rpmdep,
        }
        
        headerNVR(h, &name, &version, &release);
-       pEVR = buildEVR(version, release);
+       if (!headerGetEntry(h, RPMTAG_EPOCH, &type, (void **)&epoch, &count))
+           epoch = NULL;
+       pEVR = buildEVR(epoch, version, release);
 
        if (checkDependentPackages(rpmdep, &ps, name, pEVR, RPMSENSE_EQUAL))
            goto exit;
index 9f9cf30..dd2ddb2 100644 (file)
@@ -10,7 +10,8 @@ struct availablePackage {
     int * providesFlags;               /* unused */
     const char ** files;
     const char * name, * version, * release;
-    int epoch, hasEpoch, providesCount, filesCount;
+    int_32 *epoch;
+    int providesCount, filesCount;
     const void * key;
     rpmRelocation * relocs;
     FD_t fd;
index 2537fc4..61f3359 100644 (file)
@@ -388,7 +388,6 @@ int rpmAddSignature(Header header, const char *file, int_32 sigTag, const char *
     void *sig;
     int ret = -1;
     
-    rpmMessage(RPMMESS_VERBOSE, _("Generating signature: %d\n"), sigTag);
     switch (sigTag) {
     case RPMSIGTAG_SIZE:
        stat(file, &statbuf);
@@ -403,11 +402,13 @@ int rpmAddSignature(Header header, const char *file, int_32 sigTag, const char *
        break;
     case RPMSIGTAG_PGP5:       /* XXX legacy */
     case RPMSIGTAG_PGP:
+       rpmMessage(RPMMESS_VERBOSE, _("Generating signature using PGP.\n"));
        ret = makePGPSignature(file, &sig, &size, passPhrase);
        if (ret == 0)
            headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size);
        break;
     case RPMSIGTAG_GPG:
+       rpmMessage(RPMMESS_VERBOSE, _("Generating signature using GPG.\n"));
         ret = makeGPGSignature(file, &sig, &size, passPhrase);
        if (ret == 0)
            headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size);
index 837fd9b..432aab1 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-09-14 01:03-0400\n"
+"POT-Creation-Date: 1999-09-14 11:50-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1991,7 +1991,7 @@ msgstr ""
 msgid "package %s conflicts: %s\n"
 msgstr ""
 
-#: ../lib/depends.c:878 ../lib/depends.c:1215
+#: ../lib/depends.c:878 ../lib/depends.c:1219
 #, c-format
 msgid "cannot read header at %d for dependency check"
 msgstr ""
index 2af9d2b..5a76b7f 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -2,7 +2,7 @@ Summary: The Red Hat package management system.
 Name: rpm
 %define version 3.0.3
 Version: %{version}
-Release: 0.25
+Release: 0.26
 Group: System Environment/Base
 Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
 Copyright: GPL