Makefile.am: Add RPM-GPG-KEY to the package.
authorjbj <devnull@localhost>
Tue, 7 Dec 1999 21:14:51 +0000 (21:14 +0000)
committerjbj <devnull@localhost>
Tue, 7 Dec 1999 21:14:51 +0000 (21:14 +0000)
Use fdLink/fdFree for fd/scriptFd references in transaction set/availableList.
fprint.h: Permit (and check for) subDir = NULL in fingerPrints.
More lclint annotations.

CVS patchset: 3462
CVS date: 1999/12/07 21:14:51

17 files changed:
Makefile.am
RPM-GPG-KEY [new file with mode: 0644]
build/rpmspec.h
lib/depends.c
lib/depends.h
lib/falloc.c
lib/falloc.h
lib/fprint.c
lib/fprint.h
lib/misc.c
lib/rpmdb.c
lib/rpminstall.c
lib/rpmio.h
lib/rpmlib.h
lib/transaction.c
po/rpm.pot
system.h

index 59f89e0..2256ed5 100644 (file)
@@ -2,7 +2,8 @@
 
 AUTOMAKE_OPTIONS = 1.4 foreign
 
-EXTRA_DIST = CHANGES CREDITS GROUPS README.amiga INSTALL RPM-PGP-KEY \
+EXTRA_DIST = CHANGES CREDITS GROUPS README.amiga INSTALL \
+       RPM-GPG-KEY RPM-PGP-KEY \
        autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
        gendiff po/*.in po/*.po po/rpm.pot \
        python/*.am python/*.in python/*.c python/*.h python/testit \
diff --git a/RPM-GPG-KEY b/RPM-GPG-KEY
new file mode 100644 (file)
index 0000000..32ba806
--- /dev/null
@@ -0,0 +1,34 @@
+The following public key can be used to verify RPM packages built and
+signed by Red Hat Software using `rpm -K' using the GNU GPG package. 
+Questions about this key should be sent to ewt@redhat.com.
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.0.0 (GNU/Linux)
+Comment: For info see http://www.gnupg.org
+
+mQGiBDfqVDgRBADBKr3Bl6PO8BQ0H8sJoD6p9U7Yyl7pjtZqioviPwXP+DCWd4u8
+HQzcxAZ57m8ssA1LK1Fx93coJhDzM130+p5BG9mYSWShLabR3N1KXdXQYYcowTOM
+GxdwYRGr1Spw8QydLhjVfU1VSl4xt6bupPbWJbyjkg5Z3P7BlUOUJmrx3wCgobNV
+EDGaWYJcch5z5B1of/41G8kEAKii6q7Gu/vhXXnLS6m15oNnPVybyngiw/23dKjS
+ZVG7rKANEK2mxg1VB+vc/uUc4k49UxJJfCZg1gu1sPFV3GSa+Y/7jsiLktQvCiLP
+lncQt1dV+ENmHR5BdIDPWDzKBVbgWnSDnqQ6KrZ7T6AlZ74VMpjGxxkWU6vV2xsW
+XCLPA/9P/vtImA8CZN3jxGgtK5GGtDNJ/cMhhuv5tnfwFg4b/VGo2Jr8mhLUqoIb
+E6zeGAmZbUpdckDco8D5fiFmqTf5+++pCEpJLJkkzel/32N2w4qzPrcRMCiBURES
+PjCLd4Y5rPoU8E4kOHc/4BuHN903tiCsCPloCrWsQZ7UdxfQ5LQiUmVkIEhhdCwg
+SW5jIDxzZWN1cml0eUByZWRoYXQuY29tPohVBBMRAgAVBQI36lQ4AwsKAwMVAwID
+FgIBAheAAAoJECGRgM3bQqYOsBQAnRVtg7B25Hm11PHcpa8FpeddKiq2AJ9aO8sB
+XmLDmPOEFI75mpTrKYHF6rkCDQQ36lRyEAgAokgI2xJ+3bZsk8jRA8ORIX8DH05U
+lMH27qFYzLbT6npXwXYIOtVn0K2/iMDj+oEB1Aa2au4OnddYaLWp06v3d+XyS0t+
+5ab2ZfIQzdh7wCwxqRkzR+/H5TLYbMG+hvtTdylfqIX0WEfoOXMtWEGSVwyUsnM3
+Jy3LOi48rQQSCKtCAUdV20FoIGWhwnb/gHU1BnmES6UdQujFBE6EANqPhp0coYoI
+hHJ2oIO8ujQItvvNaU88j/s/izQv5e7MXOgVSjKe/WX3s2JtB/tW7utpy12wh1J+
+JsFdbLV/t8CozUTpJgx5mVA3RKlxjTA+On+1IEUWioB+iVfT7Ov/0kcAzwADBQf9
+E4SKCWRand8K0XloMYgmipxMhJNnWDMLkokvbMNTUoNpSfRoQJ9EheXDxwMpTPwK
+ti/PYrrL2J11P2ed0x7zm8v3gLrY0cue1iSba+8glY+p31ZPOr5ogaJw7ZARgoS8
+BwjyRymXQp+8Dete0TELKOL2/itDOPGHW07SsVWOR6cmX4VlRRcWB5KejaNvdrE5
+4XFtOd04NMgWI63uqZc4zkRa+kwEZtmbz3tHSdRCCE+Y7YVP6IUf/w6YPQFQriWY
+FiA6fD10eB+BlIUqIw80VgjsBKmCwvKkn4jg8kibXgj4/TzQSx77uYokw1EqQ2wk
+OZoaEtcubsNMquuLCMWijYhGBBgRAgAGBQI36lRyAAoJECGRgM3bQqYOhyYAnj7h
+VDY/FJAGqmtZpwVp9IlitW5tAJ4xQApr/jNFZCTksnI+4O1765F7tA==
+=3AHZ
+-----END PGP PUBLIC KEY BLOCK-----
index bc850ff..2155d79 100644 (file)
@@ -44,7 +44,7 @@ typedef struct ReadLevelEntry {
 
 typedef struct OpenFileInfo {
     /*@only@*/ char *fileName;
-    /*@dependent@*/ FD_t fd;
+    FD_t fd;
     int lineNum;
     char readBuf[BUFSIZ];
     /*@dependent@*/ char *readPtr;
index c90f718..9ddd24f 100644 (file)
@@ -96,7 +96,7 @@ static void alCreate( /*@out@*/ struct availableList * al)
     al->dirs = NULL;
 }
 
-static void alFree( /*@only@*/ struct availableList * al)
+static void alFree(struct availableList * al)
 {
     int i;
     rpmRelocation * r;
@@ -117,6 +117,8 @@ static void alFree( /*@only@*/ struct availableList * al)
            }
            free(al->list[i].relocs);
        }
+       if (al->list[i].fd)
+           al->list[i].fd = fdFree(al->list[i].fd, "alAddPackage (alFree)");
     }
 
     for (i = 0; i < al->numDirs; i++) {
@@ -142,8 +144,8 @@ static int dirInfoCompare(const void * one, const void * two) {
 }
 
 static /*@exposed@*/ struct availablePackage * alAddPackage(struct availableList * al,
-                                             Header h, const void * key,
-                                             FD_t fd, rpmRelocation * relocs)
+               Header h, /*@dependent@*/ const void * key,
+               FD_t fd, rpmRelocation * relocs)
 {
     struct availablePackage * p;
     rpmRelocation * r;
@@ -250,7 +252,7 @@ static /*@exposed@*/ struct availablePackage * alAddPackage(struct availableList
     }
 
     p->key = key;
-    p->fd = fd;
+    p->fd = (fd ? fdLink(fd, "alAddPackage") : NULL);
 
     if (relocs) {
        for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++);
@@ -325,7 +327,10 @@ static int intcmp(const void * a, const void *b)
     return 1;
 }
 
-static void parseEVR(char *evr, /*@exposed@*/ /*@out@*/const char **ep, /*@exposed@*/ /*@out@*/const char **vp, /*@exposed@*/ /*@out@*/const char **rp) /*@modifies evr,*ep,*vp,*rp @*/
+static void parseEVR(char *evr,
+       /*@exposed@*/ /*@out@*/ const char **ep,
+       /*@exposed@*/ /*@out@*/ const char **vp,
+       /*@exposed@*/ /*@out@*/const char **rp) /*@modifies evr,*ep,*vp,*rp @*/
 {
     const char *epoch;
     const char *version;               /* assume only version is present */
@@ -693,7 +698,8 @@ int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd,
     return 0;
 }
 
-void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h, void * key)
+void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h,
+       const void * key)
 {
     struct availablePackage * al;
     al = alAddPackage(&rpmdep->availablePackages, h, key, NULL, NULL);
@@ -706,11 +712,16 @@ void rpmtransRemovePackage(rpmTransactionSet rpmdep, int dboffset)
 
 void rpmtransFree(rpmTransactionSet rpmdep)
 {
-    alFree(&rpmdep->addedPackages);
-    alFree(&rpmdep->availablePackages);
+    struct availableList * addedPackages = &rpmdep->addedPackages;
+    struct availableList * availablePackages = &rpmdep->availablePackages;
+
+    alFree(addedPackages);
+    alFree(availablePackages);
     free(rpmdep->removedPackages);
     xfree(rpmdep->root);
     free(rpmdep->order);
+    if (rpmdep->scriptFd)
+       rpmdep->scriptFd = fdFree(rpmdep->scriptFd, "rpmtransSetScriptFd (rpmtransFree");
 
     free(rpmdep);
 }
@@ -733,8 +744,8 @@ void rpmdepFreeConflicts(struct rpmDependencyConflict * conflicts,
 }
 
 /*@dependent@*/ /*@null@*/ static struct availablePackage *
-alFileSatisfiesDepend(struct availableList * al, const char * keyType,
-                       const char * fileName)
+alFileSatisfiesDepend(struct availableList * al,
+       const char * keyType, const char * fileName)
 {
     int i;
     const char * dirName;
@@ -770,13 +781,13 @@ alFileSatisfiesDepend(struct availableList * al, const char * keyType,
     return NULL;
 }
 
-static /*@exposed@*/ struct availablePackage * alSatisfiesDepend(
+/*@dependent@*/ /*@null@*/ static struct availablePackage * alSatisfiesDepend(
        struct availableList * al,
-       const char *keyType, const char *keyDepend,
+       const char * keyType, const char * keyDepend,
        const char * keyName, const char * keyEVR, int keyFlags)
 {
     struct availableIndexEntry needle, * match;
-    struct availablePackage *p;
+    struct availablePackage * p;
     int i, rc;
 
     if (*keyName == '/')
@@ -831,7 +842,7 @@ static /*@exposed@*/ struct availablePackage * alSatisfiesDepend(
 /* 2 == error */
 /* 1 == dependency not satisfied */
 static int unsatisfiedDepend(rpmTransactionSet rpmdep,
-       const char *keyType, const char *keyDepend,
+       const char * keyType, const char * keyDepend,
        const char * keyName, const char * keyEVR, int keyFlags,
        /*@out@*/ struct availablePackage ** suggestion)
 {
@@ -951,7 +962,7 @@ exit:
 }
 
 static int checkPackageDeps(rpmTransactionSet rpmdep, struct problemsSet * psp,
-               Header h, const char *keyName)
+               Header h, const char * keyName)
 {
     const char * name, * version, * release;
     const char ** requires, ** requiresEVR = NULL;
@@ -1094,7 +1105,7 @@ static int checkPackageDeps(rpmTransactionSet rpmdep, struct problemsSet * psp,
 /* Adding: check name/provides key against each conflict match. */
 /* Erasing: check name/provides/filename key against each requiredby match. */
 static int checkPackageSet(rpmTransactionSet rpmdep, struct problemsSet * psp,
-       const char *key, dbiIndexSet *matches)
+       const char * key, dbiIndexSet * matches)
 {
     Header h;
     int i;
index 16e095b..b61ea4d 100644 (file)
@@ -12,11 +12,11 @@ struct availablePackage {
     /*@dependent@*/ const char * name;
     /*@dependent@*/ const char * version;
     /*@dependent@*/ const char * release;
-    /*@dependent@*/ int_32 *epoch;
+    /*@dependent@*/ int_32 * epoch;
     int providesCount, filesCount;
     /*@dependent@*/ const void * key;
     rpmRelocation * relocs;
-    /*@dependent@*/ FD_t fd;
+    /*@null@*/ FD_t fd;
 } ;
 
 enum indexEntryType { IET_NAME, IET_PROVIDES };
@@ -49,7 +49,7 @@ struct availableList {
     struct availableIndex index;
     int size, alloced;
     int numDirs;
-    struct dirInfo * dirs;                     /* xmalloc'd */
+    /*@owned@*/ struct dirInfo * dirs;         /* xmalloc'd */
 };
 
 struct transactionElement {
@@ -64,14 +64,14 @@ struct transactionElement {
 };
 
 struct rpmTransactionSet_s {
-    /*@owned@*/rpmdb db;                       /* may be NULL */
-    /*@only@*/int * removedPackages;
+    /*@owned@*/ /*@null@*/ rpmdb db;                   /* may be NULL */
+    /*@only@*/ int * removedPackages;
     int numRemovedPackages, allocedRemovedPackages;
     struct availableList addedPackages, availablePackages;
-    /*@only@*/struct transactionElement * order;
+    /*@only@*/ struct transactionElement * order;
     int orderCount, orderAlloced;
-    /*@only@*/const char * root;
-    /*@only@*/ FD_t scriptFd;
+    /*@only@*/ const char * root;
+    /*@null@*/ FD_t scriptFd;
 };
 
 struct problemsSet {
index 3839b2e..9062092 100644 (file)
@@ -80,7 +80,7 @@ FD_t fadOpen(const char * path, int flags, int perms)
        }
     }
 
-    return fd;
+    /*@-refcounttrans@*/ return fd /*@=refcounttrans@*/ ;
 }
 
 /* returns 0 on failure */
index fb1d569..da6f292 100644 (file)
@@ -9,7 +9,7 @@
 extern "C" {
 #endif
 
-FD_t           fadOpen         (const char * path, int flags, int perms);
+/*@null@*/ FD_t        fadOpen         (const char * path, int flags, int perms);
 unsigned int   fadAlloc        (FD_t fd, unsigned int size); /* 0 on failure */
 void           fadFree         (FD_t fd, unsigned int offset);
 
index 7511ccf..6b5e514 100644 (file)
@@ -30,8 +30,8 @@ static const struct fprintCacheEntry_s * cacheContainsDirectory(
     return data[0];
 }
 
-static fingerPrint doLookup(fingerPrintCache cache, const char * dirName,
-                           const char * baseName, int scareMemory)
+static fingerPrint doLookup(fingerPrintCache cache,
+       const char * dirName, const char * baseName, int scareMemory)
 {
     char dir[PATH_MAX];
     char * end;
@@ -94,16 +94,10 @@ static fingerPrint doLookup(fingerPrintCache cache, const char * dirName,
            if (fp.subDir[0] == '/' && fp.subDir[1] != '\0')
                fp.subDir++;
            else
-               fp.subDir = "";
+               fp.subDir = NULL;
            fp.baseName = baseName;
-           if (!scareMemory && fp.subDir != NULL) {
-               /* XXX memory leak, but how do we know we can free it? 
-                * XXX Using the (new) cache would work if hash tables
-                * XXX allowed traversal.
-                */
+           if (!scareMemory && fp.subDir != NULL)
                fp.subDir = xstrdup(fp.subDir);
-               fp.baseName = xstrdup(fp.baseName);
-           }
            return fp;
        }
 
index 2afc9d2..d2b1e6a 100644 (file)
@@ -14,14 +14,14 @@ struct fprintCacheEntry_s {
     int isFake;
 };
 
-typedef struct fprintCache_s {
+typedef /*@abstract@*/ struct fprintCache_s {
     hashTable ht;                  /* hashed by dirName */
 } * fingerPrintCache;
 
 typedef struct fingerprint_s {
     const struct fprintCacheEntry_s * entry;
-    const char * subDir;
-    const char * baseName;
+    /*@owned@*/ /*@null@*/ const char * subDir;
+    /*@dependent@*/ const char * baseName;
 } fingerPrint;
 
 /* only if !scarceMemory */
@@ -30,9 +30,11 @@ typedef struct fingerprint_s {
 #define FP_EQUAL(a, b) ( \
        (&(a) == &(b)) || ( \
                ((a).entry == (b).entry) && \
-               !strcmp((a).subDir, (b).subDir) && \
-               !strcmp((a).baseName, (b).baseName) \
-       ))
+               !strcmp((a).baseName, (b).baseName) && \
+               (((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
+                       || ((a).subDir == (b).subDir)) \
+               ) \
+       )
 
 #define        FP_ENTRY_EQUAL(a, b) ( \
        ((a)->dev == (b)->dev) && \
@@ -41,17 +43,19 @@ typedef struct fingerprint_s {
 
 #define FP_EQUAL_DIFFERENT_CACHE(a, b) ( \
        FP_ENTRY_EQUAL((a).entry, (b).entry) && \
-       !strcmp((a).subDir, (b).subDir) && \
-       !strcmp((a).baseName, (b).baseName))
+       !strcmp((a).baseName, (b).baseName) && \
+               (((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
+                       || ((a).subDir == (b).subDir)) \
+       )
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */
-fingerPrintCache fpCacheCreate(int sizeHint);
-void fpCacheFree(fingerPrintCache cache);
-fingerPrint fpLookup(fingerPrintCache cache, const char * dirName, 
+ /*@only@*/ fingerPrintCache fpCacheCreate(int sizeHint);
+void           fpCacheFree(/*@only@*/ fingerPrintCache cache);
+fingerPrint    fpLookup(fingerPrintCache cache, const char * dirName, 
                        const char * baseName, int scareMemory);
 
 /* Hash based on dev and inode only! */
index 969ff8b..5b4a869 100644 (file)
@@ -73,7 +73,7 @@ int rpmfileexists(const char * urlfn)
     case URL_IS_DASH:
     default:
        return 0;
-       break;
+       /*@notreached@*/ break;
     }
 
     return 1;
@@ -440,8 +440,10 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr)
 
     if (fnptr)
        *fnptr = tempfn;
-    else if (tempfn)
+    else if (tempfn) {
        xfree(tempfn);
+       tempfn = NULL;
+    }
     *fdptr = fd;
 
     return 0;
index c45f762..5d31c3c 100644 (file)
@@ -239,7 +239,7 @@ int openDatabase(const char * prefix, const char * dbpath, rpmdb *rpmdbp, int mo
      return rc;
 }
 
-static int doRpmdbOpen (const char * prefix, rpmdb * rpmdbp,
+static int doRpmdbOpen (const char * prefix, /*@out@*/ rpmdb * rpmdbp,
                        int mode, int perms, int flags)
 {
     const char * dbpath = rpmGetPath("%{_dbpath}", NULL);
index 18cd2bc..3dc5f73 100644 (file)
@@ -172,7 +172,8 @@ int rpmInstall(const char * rootdir, const char ** argv, int transFlags,
 #else
            {   char tfnbuf[64];
                strcpy(tfnbuf, "rpm-xfer.XXXXXX");
-               tfn = rpmGenPath(rootdir, "%{_tmppath}/", mktemp(tfnbuf));
+               /*@-unrecog@*/ mktemp(tfnbuf) /*@=unrecog@*/;
+               tfn = rpmGenPath(rootdir, "%{_tmppath}/", tfnbuf);
            }
 #endif
 
index 9349bb4..db73dce 100644 (file)
@@ -110,7 +110,7 @@ int Closedir(DIR * dir);
 void   fdPush  (FD_t fd, FDIO_t io, void * fp, int fdno);
 void   fdPop   (FD_t fd);
 
-void * fdGetFp (FD_t fd);
+/*@dependent@*/ /*@null@*/ void *      fdGetFp (FD_t fd);
 void   fdSetFdno(FD_t fd, int fdno);
 off_t  fdSize  (FD_t fd);
 void   fdSetSyserrno(FD_t fd, int syserrno, const void * errcookie);
@@ -170,7 +170,7 @@ int fdReadable(FD_t fd, int secs);
 
 int    ufdCopy(FD_t sfd, FD_t tfd);
 int    ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd);
-const char *const ftpStrerror(int errorNumber);
+/*@observer@*/ const char *const ftpStrerror(int errorNumber);
 
 #if 0
 #define        ufdRead         ufdio->read
index 000b28b..7d9605a 100644 (file)
@@ -318,7 +318,7 @@ int rpmdbInit(const char * root, int perms);
 void rpmdbClose ( /*@only@*/ rpmdb db);
 /* Databases like this should only have rpmdb*RecNum and rpmdbGetRecord
    used on them. Anything else could fail! */
-int rpmdbOpenForTraversal(const char * prefix, rpmdb * rpmdbp);
+int rpmdbOpenForTraversal(const char * prefix, /*@out@*/ rpmdb * rpmdbp);
 
 int rpmdbFirstRecNum(rpmdb db);
 int rpmdbNextRecNum(rpmdb db, unsigned int lastOffset);
@@ -391,11 +391,13 @@ struct rpmDependencyConflict {
    returns 0 on success, 1 on I/O error, 2 if the package needs capabilities
    which are not implemented */
 int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd,
-                       const void * key, int update, rpmRelocation * relocs);
-void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h, void * key);
+               /*@owned@*/ const void * key, int update,
+               rpmRelocation * relocs);
+void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h,
+               /*@owned@*/ const void * key);
 void rpmtransRemovePackage(rpmTransactionSet rpmdep, int dboffset);
 void rpmtransFree( /*@only@*/ rpmTransactionSet rpmdep);
-void rpmtransSetScriptFd(rpmTransactionSet ts, /*@only@*/ FD_t fd);
+void rpmtransSetScriptFd(rpmTransactionSet ts, FD_t fd);
 
 /* this checks for dependency satisfaction, but *not* ordering */
 int rpmdepCheck(rpmTransactionSet rpmdep,
@@ -432,10 +434,10 @@ typedef enum rpmProblemType_e { RPMPROB_BADARCH,
 
 typedef /*@abstract@*/ struct rpmProblem_s {
     Header h, altH;
-    const void * key;
+    /*@dependent@*/ const void * key;
     rpmProblemType type;
     int ignoreProblem;
-    char * str1;
+    /*@only@*/ const char * str1;
     unsigned long ulong1;
 } rpmProblem;
 
index 712d231..51b579b 100644 (file)
@@ -135,7 +135,7 @@ static void freeFl(rpmTransactionSet ts, TFI_t *flList)
 
 void rpmtransSetScriptFd(rpmTransactionSet ts, FD_t fd)
 {
-    ts->scriptFd = fd;
+    ts->scriptFd = (fd ? fdLink(fd, "rpmtransSetScriptFd") : NULL);
 }
 
 static rpmProblemSet psCreate(void)
@@ -150,8 +150,8 @@ static rpmProblemSet psCreate(void)
 }
 
 static void psAppend(rpmProblemSet probs, rpmProblemType type,
-                    const void * key, Header h, const char * str1,
-                    Header altH, unsigned long ulong1)
+               /*@dependent@*/ const void * key, Header h, const char * str1,
+               Header altH, unsigned long ulong1)
 {
     if (probs->numProblems == probs->numProblemsAlloced) {
        if (probs->numProblemsAlloced)
@@ -180,8 +180,9 @@ static void psAppend(rpmProblemSet probs, rpmProblemType type,
 }
 
 static void psAppendFile(rpmProblemSet probs, rpmProblemType type,
-                    const void * key, Header h, const char * dirName,
-                    const char * baseName, Header altH, unsigned long ulong1)
+               /*@dependent@*/ const void * key, Header h,
+               const char * dirName, const char * baseName,
+               Header altH, unsigned long ulong1)
 {
     char * str = alloca(strlen(dirName) + strlen(baseName) + 1);
 
@@ -241,7 +242,7 @@ void rpmProblemSetFree(rpmProblemSet probs)
 
     for (i = 0; i < probs->numProblems; i++) {
        headerFree(probs->probs[i].h);
-       if (probs->probs[i].str1) free(probs->probs[i].str1);
+       if (probs->probs[i].str1) xfree(probs->probs[i].str1);
        if (probs->probs[i].altH) {
            headerFree(probs->probs[i].altH);
        }
@@ -469,23 +470,23 @@ static Header relocateFileList(struct availablePackage * alp,
     /* Start off by relocating directories. */
     for (i = dirCount - 1; i >= 0; i--) {
        for (j = numRelocations - 1; j >= 0; j--) {
-           int len;
+           int oplen;
 
-           len = strlen(relocations[j].oldPath);
-           if (strncmp(relocations[j].oldPath, dirNames[i], len))
+           oplen = strlen(relocations[j].oldPath);
+           if (strncmp(relocations[j].oldPath, dirNames[i], oplen))
                continue;
 
            /* Only subdirectories or complete file paths may be relocated. We
               don't check for '\0' as our directory names all end in '/'. */
-           if (!(dirNames[i][len] == '/'))
+           if (!(dirNames[i][oplen] == '/'))
                continue;
 
            if (relocations[j].newPath) { /* Relocate the path */
                const char *s = relocations[j].newPath;
-               char *t = alloca(strlen(s) + strlen(dirNames[i]) - len + 1);
+               char *t = alloca(strlen(s) + strlen(dirNames[i]) - oplen + 1);
 
                strcpy(t, s);
-               strcat(t, dirNames[i] + len);
+               strcat(t, dirNames[i] + oplen);
                rpmMessage(RPMMESS_DEBUG, _("relocating directory %s to %s\n"),
                        dirNames[i], t);
                dirNames[i] = t;
@@ -506,23 +507,26 @@ static Header relocateFileList(struct availablePackage * alp,
        void * p;
        int t;
 
+       p = NULL;
        headerGetEntry(h, RPMTAG_COMPFILELIST, &t, &p, &c);
        headerAddEntry(h, RPMTAG_ORIGCOMPFILELIST, t, p, c);
        xfree(p);
 
-       headerGetEntry(h, RPMTAG_COMPFILEDIRS, &t, &p, &c);
-       headerAddEntry(h, RPMTAG_ORIGCOMPFILEDIRS, t, p, c);
-       xfree(p);
-
+       p = NULL;
        headerGetEntry(h, RPMTAG_COMPDIRLIST, &t, &p, &c);
        headerAddEntry(h, RPMTAG_ORIGCOMPDIRLIST, t, p, c);
+       xfree(p);
+
+       p = NULL;
+       headerGetEntry(h, RPMTAG_COMPFILEDIRS, &t, &p, &c);
+       headerAddEntry(h, RPMTAG_ORIGCOMPFILEDIRS, t, p, c);
 
        headerModifyEntry(h, RPMTAG_COMPFILELIST, RPM_STRING_ARRAY_TYPE,
                          baseNames, fileCount);
-       headerModifyEntry(h, RPMTAG_COMPFILEDIRS, RPM_STRING_ARRAY_TYPE,
-                         dirIndexes, fileCount);
        headerModifyEntry(h, RPMTAG_COMPDIRLIST, RPM_STRING_ARRAY_TYPE,
                          dirNames, dirCount);
+       headerModifyEntry(h, RPMTAG_COMPFILEDIRS, RPM_INT32_TYPE,
+                         dirIndexes, fileCount);
     }
 
     free(baseNames);
@@ -1035,7 +1039,7 @@ static void handleOverlappedFiles(TFI_t * fi, hashTable ht,
 }
 
 static int ensureOlder(rpmdb db, Header new, int dbOffset, rpmProblemSet probs,
-                      const void * key)
+                       /*@dependent@*/ const void * key)
 {
     Header old;
     int result, rc = 0;
@@ -1229,7 +1233,6 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
                di[i].avail = sfb.f_blocks - sfb.f_bfree;
 #endif
 
-
                stat(filesystems[i], &sb);
                di[i].dev = sb.st_dev;
            }
@@ -1238,8 +1241,7 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
        if (di) di[i].block = 0;
     }
 
-    probs = psCreate();
-    *newProbs = probs;
+    probs = *newProbs = psCreate();
     hdrs = alloca(sizeof(*hdrs) * ts->addedPackages.size);
 
     /* ===============================================
@@ -1256,9 +1258,8 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
        if (!archOkay(alp->h) && !(ignoreSet & RPMPROB_FILTER_IGNOREARCH))
            psAppend(probs, RPMPROB_BADARCH, alp->key, alp->h, NULL, NULL, 0);
 
-       if (!osOkay(alp->h) && !(ignoreSet & RPMPROB_FILTER_IGNOREOS)) {
+       if (!osOkay(alp->h) && !(ignoreSet & RPMPROB_FILTER_IGNOREOS))
            psAppend(probs, RPMPROB_BADOS, alp->key, alp->h, NULL, NULL, 0);
-       }
 
        if (!(ignoreSet & RPMPROB_FILTER_OLDPACKAGE)) {
            rc = rpmdbFindPackage(ts->db, alp->name, &dbi);
index f0db990..f092611 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-12-06 13:01-0500\n"
+"POT-Creation-Date: 1999-12-07 15:26-0500\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"
@@ -14,7 +14,7 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: ENCODING\n"
 
-#: build.c:25 lib/rpminstall.c:246 lib/rpminstall.c:406
+#: build.c:25 lib/rpminstall.c:247 lib/rpminstall.c:407
 #, c-format
 msgid "cannot open %s/packages.rpm\n"
 msgstr ""
@@ -2002,85 +2002,85 @@ msgid "error removing record %s into %s"
 msgstr ""
 
 #. XXX legacy epoch-less requires/conflicts compatibility
-#: lib/depends.c:404
+#: lib/depends.c:409
 #, c-format
 msgid ""
 "the \"B\" dependency needs an epoch (assuming same as \"A\")\n"
 "\tA %s\tB %s\n"
 msgstr ""
 
-#: lib/depends.c:433
+#: lib/depends.c:438
 #, c-format
 msgid "  %s    A %s\tB %s\n"
 msgstr ""
 
-#: lib/depends.c:525
+#: lib/depends.c:530
 msgid "dbrecMatchesDepFlags() failed to read header"
 msgstr ""
 
-#: lib/depends.c:764
+#: lib/depends.c:775
 #, c-format
 msgid "%s: %s satisfied by added file list.\n"
 msgstr ""
 
-#: lib/depends.c:803
+#: lib/depends.c:814
 #, c-format
 msgid "%s: %s satisfied by added package.\n"
 msgstr ""
 
-#: lib/depends.c:820
+#: lib/depends.c:831
 #, c-format
 msgid "%s: %s satisfied by added provide.\n"
 msgstr ""
 
-#: lib/depends.c:851
+#: lib/depends.c:862
 #, c-format
 msgid "%s: %s satisfied by rpmrc provides.\n"
 msgstr ""
 
-#: lib/depends.c:879
+#: lib/depends.c:890
 #, c-format
 msgid "%s: %s satisfied by db file lists.\n"
 msgstr ""
 
-#: lib/depends.c:901
+#: lib/depends.c:912
 #, c-format
 msgid "%s: %s satisfied by db provides.\n"
 msgstr ""
 
-#: lib/depends.c:923
+#: lib/depends.c:934
 #, c-format
 msgid "%s: %s satisfied by db packages.\n"
 msgstr ""
 
-#: lib/depends.c:936
+#: lib/depends.c:947
 #, c-format
 msgid "%s: %s satisfied by rpmlib version.\n"
 msgstr ""
 
-#: lib/depends.c:946
+#: lib/depends.c:957
 #, c-format
 msgid "%s: %s unsatisfied.\n"
 msgstr ""
 
 #. requirements are not satisfied.
-#: lib/depends.c:994
+#: lib/depends.c:1005
 #, c-format
 msgid "package %s require not satisfied: %s\n"
 msgstr ""
 
 #. conflicts exist.
-#: lib/depends.c:1056
+#: lib/depends.c:1067
 #, c-format
 msgid "package %s conflicts: %s\n"
 msgstr ""
 
-#: lib/depends.c:1111 lib/depends.c:1410
+#: lib/depends.c:1122 lib/depends.c:1421
 #, c-format
 msgid "cannot read header at %d for dependency check"
 msgstr ""
 
-#: lib/depends.c:1206
+#: lib/depends.c:1217
 #, c-format
 msgid "loop in prerequisite chain: %s"
 msgstr ""
@@ -2552,7 +2552,7 @@ msgstr ""
 msgid "old format source packages cannot be queried\n"
 msgstr ""
 
-#: lib/query.c:496 lib/rpminstall.c:227
+#: lib/query.c:496 lib/rpminstall.c:228
 #, c-format
 msgid "%s does not appear to be a RPM package\n"
 msgstr ""
@@ -2616,7 +2616,7 @@ msgstr ""
 msgid "record %d could not be read\n"
 msgstr ""
 
-#: lib/query.c:644 lib/rpminstall.c:417
+#: lib/query.c:644 lib/rpminstall.c:418
 #, c-format
 msgid "package %s is not installed\n"
 msgstr ""
@@ -2955,136 +2955,136 @@ msgstr ""
 
 #. XXX undefined %{name}/%{version}/%{release} here
 #. XXX %{_tmpdir} does not exist
-#: lib/rpminstall.c:181
+#: lib/rpminstall.c:182
 #, c-format
 msgid " ... as %s\n"
 msgstr ""
 
-#: lib/rpminstall.c:185
+#: lib/rpminstall.c:186
 #, c-format
 msgid "skipping %s - transfer failed - %s\n"
 msgstr ""
 
-#: lib/rpminstall.c:203
+#: lib/rpminstall.c:204
 #, c-format
 msgid "retrieved %d packages\n"
 msgstr ""
 
-#: lib/rpminstall.c:214 lib/rpminstall.c:356
+#: lib/rpminstall.c:215 lib/rpminstall.c:357
 #, c-format
 msgid "cannot open file %s: %s\n"
 msgstr ""
 
-#: lib/rpminstall.c:231 lib/rpminstall.c:494
+#: lib/rpminstall.c:232 lib/rpminstall.c:495
 #, c-format
 msgid "%s cannot be installed\n"
 msgstr ""
 
-#: lib/rpminstall.c:267
+#: lib/rpminstall.c:268
 #, c-format
 msgid "package %s is not relocateable\n"
 msgstr ""
 
-#: lib/rpminstall.c:285
+#: lib/rpminstall.c:286
 #, c-format
 msgid "error reading from file %s\n"
 msgstr ""
 
-#: lib/rpminstall.c:290
+#: lib/rpminstall.c:291
 #, c-format
 msgid "file %s requires a newer version of RPM\n"
 msgstr ""
 
-#: lib/rpminstall.c:307
+#: lib/rpminstall.c:308
 #, c-format
 msgid "found %d source and %d binary packages\n"
 msgstr ""
 
-#: lib/rpminstall.c:318
+#: lib/rpminstall.c:319
 msgid "failed dependencies:\n"
 msgstr ""
 
-#: lib/rpminstall.c:336
+#: lib/rpminstall.c:337
 msgid "installing binary packages\n"
 msgstr ""
 
-#: lib/rpminstall.c:421
+#: lib/rpminstall.c:422
 #, c-format
 msgid "searching for package %s\n"
 msgstr ""
 
-#: lib/rpminstall.c:430
+#: lib/rpminstall.c:431
 #, c-format
 msgid "\"%s\" specifies multiple packages\n"
 msgstr ""
 
-#: lib/rpminstall.c:456
+#: lib/rpminstall.c:457
 msgid "removing these packages would break dependencies:\n"
 msgstr ""
 
-#: lib/rpminstall.c:483
+#: lib/rpminstall.c:484
 #, c-format
 msgid "cannot open %s: %s\n"
 msgstr ""
 
-#: lib/rpminstall.c:489
+#: lib/rpminstall.c:490
 #, c-format
 msgid "Installing %s\n"
 msgstr ""
 
-#: lib/rpmio.c:762
+#: lib/rpmio.c:763
 msgid "Success"
 msgstr ""
 
-#: lib/rpmio.c:765
+#: lib/rpmio.c:766
 msgid "Bad server response"
 msgstr ""
 
-#: lib/rpmio.c:768
+#: lib/rpmio.c:769
 msgid "Server IO error"
 msgstr ""
 
-#: lib/rpmio.c:771
+#: lib/rpmio.c:772
 msgid "Server timeout"
 msgstr ""
 
-#: lib/rpmio.c:774
+#: lib/rpmio.c:775
 msgid "Unable to lookup server host address"
 msgstr ""
 
-#: lib/rpmio.c:777
+#: lib/rpmio.c:778
 msgid "Unable to lookup server host name"
 msgstr ""
 
-#: lib/rpmio.c:780
+#: lib/rpmio.c:781
 msgid "Failed to connect to server"
 msgstr ""
 
-#: lib/rpmio.c:783
+#: lib/rpmio.c:784
 msgid "Failed to establish data connection to server"
 msgstr ""
 
-#: lib/rpmio.c:786
+#: lib/rpmio.c:787
 msgid "IO error to local file"
 msgstr ""
 
-#: lib/rpmio.c:789
+#: lib/rpmio.c:790
 msgid "Error setting remote server to passive mode"
 msgstr ""
 
-#: lib/rpmio.c:792
+#: lib/rpmio.c:793
 msgid "File not found on server"
 msgstr ""
 
-#: lib/rpmio.c:795
+#: lib/rpmio.c:796
 msgid "Abort in progress"
 msgstr ""
 
-#: lib/rpmio.c:799
+#: lib/rpmio.c:800
 msgid "Unknown or unexpected error"
 msgstr ""
 
-#: lib/rpmio.c:1320
+#: lib/rpmio.c:1323
 #, c-format
 msgid "logging into %s as %s, pw %s\n"
 msgstr ""
@@ -3321,27 +3321,27 @@ msgstr ""
 msgid "You must set \"%%_pgp_name\" in your macro file"
 msgstr ""
 
-#: lib/transaction.c:386
+#: lib/transaction.c:387
 #, c-format
 msgid "excluding file %s%s\n"
 msgstr ""
 
-#: lib/transaction.c:412 lib/transaction.c:496
+#: lib/transaction.c:413 lib/transaction.c:497
 #, c-format
 msgid "excluding directory %s\n"
 msgstr ""
 
-#: lib/transaction.c:417
+#: lib/transaction.c:418
 #, c-format
 msgid "relocating %s to %s\n"
 msgstr ""
 
-#: lib/transaction.c:489
+#: lib/transaction.c:490
 #, c-format
 msgid "relocating directory %s to %s\n"
 msgstr ""
 
-#: lib/transaction.c:637
+#: lib/transaction.c:641
 #, c-format
 msgid "%s skipped due to missingok flag\n"
 msgstr ""
index 6b7fca1..55af53a 100644 (file)
--- a/system.h
+++ b/system.h
@@ -89,7 +89,7 @@ extern time_t timezone;
 char *memchr ();
 #endif
 
-#if !defined(HAVE_STPCPY)
+#if !defined(HAVE_STPCPY) || defined(__LCLINT__)
 char * stpcpy(char * dest, const char * src);
 #endif