Expand path macros with rpmGetPath(path, ...).
authorjbj <devnull@localhost>
Tue, 5 Jan 1999 23:13:56 +0000 (23:13 +0000)
committerjbj <devnull@localhost>
Tue, 5 Jan 1999 23:13:56 +0000 (23:13 +0000)
CVS patchset: 2652
CVS date: 1999/01/05 23:13:56

20 files changed:
build.c
build/build.c
build/buildio.h
build/files.c
build/pack.c
build/parsePreamble.c
build/parsePrep.c
build/spec.c
install.c
lib/install.c
lib/macro.c
lib/rpmlib.h
lib/rpmmacro.h
lib/rpmrc.c
lib/stringbuf.c
lib/stringbuf.h
lib/uninstall.c
po/rpm.pot
rpmio/macro.c
rpmio/rpmmacro.h

diff --git a/build.c b/build.c
index 39604f0..201aca8 100644 (file)
--- a/build.c
+++ b/build.c
@@ -19,9 +19,6 @@ static int buildForTarget(char *arg, int buildAmount, char *passPhrase,
     char * specfile;
     int res = 0;
     struct stat statbuf;
-    char * specDir;
-    char * tmpSpecFile;
-    char * cmd;
     char * s;
     int count, fd;
     char buf[BUFSIZ];
@@ -30,13 +27,15 @@ static int buildForTarget(char *arg, int buildAmount, char *passPhrase,
     rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
 
     if (fromTarball) {
-       specDir = alloca(BUFSIZ);
-       strcpy(specDir, "%{_specdir}");
-       /* XXX can't use spec->macros yet */
-       expandMacros(NULL, &globalMacroContext, specDir, BUFSIZ);
+       const char *specDir;
+       const char * tmpSpecFile;
+       char * cmd;
+       char tfn[64];
 
-       tmpSpecFile = alloca(BUFSIZ);
-       sprintf(tmpSpecFile, "%s/rpm-spec-file-%d", specDir, (int) getpid());
+       specDir = rpmGetPath("%{_specdir}", NULL);
+
+       sprintf(tfn, "rpm-spec-file-%d", (int) getpid());
+       tmpSpecFile = rpmGetPath("%{_specdir}", tfn, NULL);
 
        cmd = alloca(strlen(arg) + 50 + strlen(tmpSpecFile));
        sprintf(cmd, "gunzip < %s | tar xOvf - Specfile 2>&1 > %s", arg,
@@ -103,6 +102,8 @@ static int buildForTarget(char *arg, int buildAmount, char *passPhrase,
        *cmd = '\0';
 
        addMacro(&globalMacroContext, "_sourcedir", NULL, buf, RMIL_TARBALL);
+       xfree(specDir);
+       xfree(tmpSpecFile);
     } else if (arg[0] == '/') {
        specfile = arg;
     } else {
index b490a12..e3c486b 100644 (file)
@@ -10,26 +10,23 @@ static void doRmSource(Spec spec)
 {
     struct Source *p;
     Package pkg;
-    char buf[BUFSIZ];
     
     unlink(spec->specFile);
 
     for (p = spec->sources; p != NULL; p = p->next) {
        if (! (p->flags & RPMBUILD_ISNO)) {
-           strcpy(buf, "%{_sourcedir}/");
-           expandMacros(spec, spec->macros, buf, sizeof(buf));
-           strcat(buf, p->source);
-           unlink(buf);
+           const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
+           unlink(fn);
+           xfree(fn);
        }
     }
 
     for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
        for (p = pkg->icon; p != NULL; p = p->next) {
            if (! (p->flags & RPMBUILD_ISNO)) {
-               strcpy(buf, "%{_sourcedir}/");
-               expandMacros(spec, spec->macros, buf, sizeof(buf));
-               strcat(buf, p->source);
-               unlink(buf);
+               const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL);
+               unlink(fn);
+               xfree(fn);
            }
        }
     }
index 4c9d878..1f8e972 100644 (file)
@@ -18,10 +18,10 @@ typedef struct cpioSourceArchive {
 extern "C" {
 #endif
 
-int readRPM(char *fileName, Spec *specp, struct rpmlead *lead,
+int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead,
                Header *sigs, CSA_t *csa);
 
-int writeRPM(Header header, char *fileName, int type,
+int writeRPM(Header header, const char *fileName, int type,
                CSA_t *csa, char *passPhrase, char **cookie);
 
 #ifdef __cplusplus
index 81befac..3ba33f6 100644 (file)
@@ -686,6 +686,7 @@ static int parseForSimple(Spec spec, Package pkg, char *buf,
            res = 1;
        } else {
        /* XXX FIXME: this is easy to do as macro expansion */
+       /* XXX WATCHOUT: buf is an arg */
            strcpy(buf, "%{_docdir}/%{name}-%{version}");
            expandMacros(spec, spec->macros, buf, BUFSIZ);
 
@@ -1070,6 +1071,7 @@ static int processPackageFiles(Spec spec, Package pkg,
     pkg->cpioCount = 0;
 
     if (pkg->fileFile) {
+       /* XXX FIXME: add %{_buildsubdir} and use rpmGetPath() */
        strcpy(buf, "%{_builddir}/");
        expandMacros(spec, spec->macros, buf, sizeof(buf));
        if (spec->buildSubdir) {
@@ -1122,10 +1124,7 @@ static int processPackageFiles(Spec spec, Package pkg,
     fl.docDirs[fl.docDirCount++] = strdup("/usr/man");
     fl.docDirs[fl.docDirCount++] = strdup("/usr/info");
     fl.docDirs[fl.docDirCount++] = strdup("/usr/X11R6/man");
-    {  strcpy(buf, "%{_docdir}");
-       expandMacros(spec, spec->macros, buf, sizeof(buf));
-       fl.docDirs[fl.docDirCount++] = strdup(buf);
-    }
+    fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_docdir}", NULL);
     
     fl.fileList = NULL;
     fl.fileListRecsAlloced = 0;
@@ -1221,7 +1220,6 @@ static int processPackageFiles(Spec spec, Package pkg,
 int processSourceFiles(Spec spec)
 {
     struct Source *srcPtr;
-    char buf[BUFSIZ];
     StringBuf sourceFiles;
     int x, isSpec = 1;
     struct FileList fl;
@@ -1288,25 +1286,21 @@ int processSourceFiles(Spec spec)
            }
        }
 
-      {        char *s = buf;
-       if (srcPtr->flags & RPMBUILD_ISNO)
-           *s++ = '!';
-       strcpy(s, "%{_sourcedir}/");
+      {        const char *s;
+       s = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
+               "%{_sourcedir}/", srcPtr->source, NULL);
+       appendLineStringBuf(sourceFiles, s);
+       xfree(s);
       }
-       expandMacros(spec, spec->macros, buf, sizeof(buf));
-       strcat(buf, srcPtr->source);
-       appendLineStringBuf(sourceFiles, buf);
     }
 
     for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
        for (srcPtr = pkg->icon; srcPtr != NULL; srcPtr = srcPtr->next) {
-           char *s = buf;
-           if (srcPtr->flags & RPMBUILD_ISNO)
-               *s++ = '!';
-           strcpy(s, "%{_sourcedir}/");
-           expandMacros(spec, spec->macros, buf, sizeof(buf));
-           strcat(buf, srcPtr->source);
-           appendLineStringBuf(sourceFiles, buf);
+           const char *s;
+           s = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""),
+               "%{_sourcedir}/", srcPtr->source, NULL);
+           appendLineStringBuf(sourceFiles, s);
+           xfree(s);
        }
     }
 
@@ -1390,7 +1384,7 @@ static StringBuf getOutputFrom(char *dir, char *argv[],
     int bytesWritten;
     StringBuf readBuff;
     int bytes;
-    unsigned char buf[8193];
+    unsigned char buf[BUFSIZ+1];
 
     oldhandler = signal(SIGPIPE, SIG_IGN);
 
index 59556a8..eb9e8bc 100644 (file)
@@ -43,10 +43,10 @@ static int genSourceRpmName(Spec spec)
 int packageSources(Spec spec)
 {
     CSA_t csabuf, *csa = &csabuf;
-    char fileName[BUFSIZ];
     HeaderIterator iter;
     int_32 tag, count;
     char **ptr;
+    int rc;
 
     /* Add some cruft */
     headerAddEntry(spec->sourceHeader, RPMTAG_RPMVERSION,
@@ -63,11 +63,6 @@ int packageSources(Spec spec)
 
     genSourceRpmName(spec);
 
-    /* XXX this should be %_srpmdir */
-    strcpy(fileName, "%{_srcrpmdir}/");
-    expandMacros(spec, spec->macros, fileName, sizeof(fileName));
-    strcat(fileName, spec->sourceRpmName);
-
     /* Add the build restrictions */
     iter = headerInitIterator(spec->buildRestrictions);
     while (headerNextIterator(iter, &tag, NULL, (void **)&ptr, &count)) {
@@ -84,14 +79,20 @@ int packageSources(Spec spec)
 
     FREE(spec->cookie);
     
-    memset(csa, 0, sizeof(*csa));
-    csa->cpioArchiveSize = 0;
-    csa->cpioFdIn = fdNew();
-    csa->cpioList = spec->sourceCpioList;
-    csa->cpioCount = spec->sourceCpioCount;
-
-    return writeRPM(spec->sourceHeader, fileName, RPMLEAD_SOURCE,
-                   csa, spec->passPhrase, &(spec->cookie));
+    /* XXX this should be %_srpmdir */
+    {  const char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL);
+
+       memset(csa, 0, sizeof(*csa));
+       csa->cpioArchiveSize = 0;
+       csa->cpioFdIn = fdNew();
+       csa->cpioList = spec->sourceCpioList;
+       csa->cpioCount = spec->sourceCpioCount;
+
+       rc = writeRPM(spec->sourceHeader, fn, RPMLEAD_SOURCE,
+               csa, spec->passPhrase, &(spec->cookie));
+       xfree(fn);
+    }
+    return rc;
 }
 
 static int copyTags[] = {
@@ -106,10 +107,11 @@ int packageBinaries(Spec spec)
     CSA_t csabuf, *csa = &csabuf;
     int rc;
     char *binFormat, *binRpm, *errorString;
-    char *name, fileName[BUFSIZ];
+    char *name;
     Package pkg;
 
     for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+       const char *fn;
 
        if (pkg->fileList == NULL)
            continue;
@@ -151,10 +153,7 @@ int packageBinaries(Spec spec)
                     "filename for package %s: %s\n"), name, errorString);
            return RPMERR_BADFILENAME;
        }
-       strcpy(fileName, "%{_rpmdir}/");
-       expandMacros(spec, spec->macros, fileName, sizeof(fileName));
-       strcat(fileName, binRpm);
-
+       fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
        FREE(binRpm);
 
        memset(csa, 0, sizeof(*csa));
@@ -163,16 +162,17 @@ int packageBinaries(Spec spec)
        csa->cpioList = pkg->cpioList;
        csa->cpioCount = pkg->cpioCount;
 
-       if ((rc = writeRPM(pkg->header, fileName, RPMLEAD_BINARY,
-                           csa, spec->passPhrase, NULL))) {
+       rc = writeRPM(pkg->header, fn, RPMLEAD_BINARY,
+                   csa, spec->passPhrase, NULL);
+       xfree(fn);
+       if (rc)
            return rc;
-       }
     }
     
     return 0;
 }
 
-int readRPM(char *fileName, Spec *specp, struct rpmlead *lead, Header *sigs,
+int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, Header *sigs,
            CSA_t *csa)
 {
     FD_t fdi;
@@ -232,7 +232,7 @@ int readRPM(char *fileName, Spec *specp, struct rpmlead *lead, Header *sigs,
     return 0;
 }
 
-int writeRPM(Header header, char *fileName, int type,
+int writeRPM(Header header, const char *fileName, int type,
                    CSA_t *csa, char *passPhrase, char **cookie)
 {
     FD_t fd, ifd;
index 03f55c4..c69dedb 100644 (file)
@@ -259,29 +259,33 @@ static void fillOutMainPackage(Header h)
     }
 }
 
-static int readIcon(Header h, char *file)
+static int readIcon(Header h, const char *file)
 {
-    char buf[BUFSIZ], *icon;
+    const char *fn = NULL;
+    char *icon;
     struct stat statbuf;
     FD_t fd;
+    int rc;
+    int nb;
 
-    strcpy(buf, "%{_sourcedir}/");
-    expandMacros(NULL, &globalMacroContext, buf, sizeof(buf));
-    strcat(buf, file);
+    fn = rpmGetPath("%{_sourcedir}/", file, NULL);
 
-    if (stat(buf, &statbuf)) {
-       rpmError(RPMERR_BADSPEC, _("Unable to read icon: %s"), file);
-       return RPMERR_BADSPEC;
+    if (stat(fn, &statbuf)) {
+       rpmError(RPMERR_BADSPEC, _("Unable to stat icon: %s"), fn);
+       rc = RPMERR_BADSPEC;
+       goto exit;
     }
+
     icon = malloc(statbuf.st_size);
     *icon = '\0';
-    fd = fdOpen(buf, O_RDONLY, 0);
-    if (fdRead(fd, icon, statbuf.st_size) != statbuf.st_size) {
-       fdClose(fd);
-       rpmError(RPMERR_BADSPEC, _("Unable to read icon: %s"), file);
-       return RPMERR_BADSPEC;
-    }
+    fd = fdOpen(fn, O_RDONLY, 0);
+    nb = fdRead(fd, icon, statbuf.st_size);
     fdClose(fd);
+    if (nb != statbuf.st_size) {
+       rpmError(RPMERR_BADSPEC, _("Unable to read icon: %s"), fn);
+       rc = RPMERR_BADSPEC;
+       goto exit;
+    }
 
     if (! strncmp(icon, "GIF", 3)) {
        headerAddEntry(h, RPMTAG_GIF, RPM_BIN_TYPE, icon, statbuf.st_size);
@@ -289,11 +293,15 @@ static int readIcon(Header h, char *file)
        headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, statbuf.st_size);
     } else {
        rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s"), file);
-       return RPMERR_BADSPEC;
+       rc = RPMERR_BADSPEC;
+       goto exit;
     }
     free(icon);
+    rc = 0;
     
-    return 0;
+exit:
+    FREE(fn);
+    return rc;
 }
 
 #define SINGLE_TOKEN_ONLY \
index e9e592d..aae4f8c 100644 (file)
@@ -24,11 +24,11 @@ static int doSetupMacro(Spec spec, char *line);
 static int doPatchMacro(Spec spec, char *line);
 static char *doPatch(Spec spec, int c, int strip, char *db,
                     int reverse, int removeEmpties);
-static int checkOwners(char *file);
+static int checkOwners(const char *file);
 static char *doUntar(Spec spec, int c, int quietly);
 #endif
 
-static int checkOwners(char *file)
+static int checkOwners(const char *file)
 {
     struct stat sb;
 
@@ -47,8 +47,8 @@ static int checkOwners(char *file)
 static char *doPatch(Spec spec, int c, int strip, char *db,
                     int reverse, int removeEmpties)
 {
+    const char *fn = NULL;
     static char buf[BUFSIZ];
-    char file[BUFSIZ];
     char args[BUFSIZ];
     struct Source *sp;
     int compressed = 0;
@@ -63,9 +63,7 @@ static char *doPatch(Spec spec, int c, int strip, char *db,
        return NULL;
     }
 
-    strcpy(file, "%{_sourcedir}/");
-    expandMacros(spec, spec->macros, file, sizeof(file));
-    strcat(file, sp->source);
+    fn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
 
     args[0] = '\0';
     if (db) {
@@ -83,8 +81,10 @@ static char *doPatch(Spec spec, int c, int strip, char *db,
     }
 
     /* XXX On non-build parse's, file cannot be stat'd or read */
-    if (!spec->force && (isCompressed(file, &compressed) || checkOwners(file)))
+    if (!spec->force && (isCompressed(fn, &compressed) || checkOwners(fn))) {
+       xfree(fn);
        return NULL;
+    }
 
     if (compressed) {
        sprintf(buf,
@@ -97,20 +97,21 @@ static char *doPatch(Spec spec, int c, int strip, char *db,
                c,
                (compressed == COMPRESSED_BZIP2) ?
                rpmGetVar(RPMVAR_BZIP2BIN) : rpmGetVar(RPMVAR_GZIPBIN),
-               file, strip, args);
+               fn, strip, args);
     } else {
        sprintf(buf,
                "echo \"Patch #%d:\"\n"
-               "patch -p%d %s -s < %s", c, strip, args, file);
+               "patch -p%d %s -s < %s", c, strip, args, fn);
     }
 
+    xfree(fn);
     return buf;
 }
 
 static char *doUntar(Spec spec, int c, int quietly)
 {
+    const char *fn;
     static char buf[BUFSIZ];
-    char file[BUFSIZ];
     char *taropts;
     struct Source *sp;
     int compressed = 0;
@@ -125,15 +126,15 @@ static char *doUntar(Spec spec, int c, int quietly)
        return NULL;
     }
 
-    strcpy(file, "%{_sourcedir}/");
-    expandMacros(spec, spec->macros, file, sizeof(file));
-    strcat(file, sp->source);
+    fn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
 
     taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf");
 
     /* XXX On non-build parse's, file cannot be stat'd or read */
-    if (!spec->force && (isCompressed(file, &compressed) || checkOwners(file)))
+    if (!spec->force && (isCompressed(fn, &compressed) || checkOwners(fn))) {
+       xfree(fn);
        return NULL;
+    }
 
     if (compressed) {
        sprintf(buf,
@@ -144,11 +145,12 @@ static char *doUntar(Spec spec, int c, int quietly)
                "fi",
                (compressed == COMPRESSED_BZIP2) ?
                rpmGetVar(RPMVAR_BZIP2BIN) : rpmGetVar(RPMVAR_GZIPBIN),
-               file, taropts);
+               fn, taropts);
     } else {
-       sprintf(buf, "tar %s %s", taropts, file);
+       sprintf(buf, "tar %s %s", taropts, fn);
     }
 
+    xfree(fn);
     return buf;
 }
 
index 6ab3715..130f7b3 100644 (file)
@@ -250,7 +250,6 @@ int addSource(Spec spec, Package pkg, char *field, int tag)
     char *name = NULL;
     char *nump, *fieldp = NULL;
     char buf[BUFSIZ];
-    char body[BUFSIZ];
     int num = 0;
 
     switch (tag) {
@@ -318,9 +317,7 @@ int addSource(Spec spec, Package pkg, char *field, int tag)
     spec->numSources++;
 
     if (tag != RPMTAG_ICON) {
-       strcpy(body, "%{_sourcedir}/");
-       expandMacros(spec, spec->macros, body, sizeof(body));   /* W2DO? */
-       strcat(body, p->source);
+       const char *body = rpmGetPath("%{_sourcedir}/", p->source, NULL);
 
        sprintf(buf, "%s%d",
                (flag & RPMBUILD_ISPATCH) ? "PATCH" : "SOURCE", num);
@@ -328,6 +325,7 @@ int addSource(Spec spec, Package pkg, char *field, int tag)
        sprintf(buf, "%sURL%d",
                (flag & RPMBUILD_ISPATCH) ? "PATCH" : "SOURCE", num);
        addMacro(spec->macros, buf, NULL, p->fullSource, RMIL_SPEC);
+       xfree(body);
     }
     
     return 0;
index 6fa51b9..4d08ec5 100644 (file)
--- a/install.c
+++ b/install.c
@@ -70,7 +70,7 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
     FD_t fd;
     int i;
     int mode, rc, major;
-    char ** packages, ** tmpPackages;
+    const char ** packages, ** tmpPackages;
     char ** filename;
     int numPackages;
     int numTmpPackages = 0, numBinaryPackages = 0, numSourcePackages = 0;
@@ -83,8 +83,6 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
     int numConflicts;
     int stopInstall = 0;
     size_t nb;
-    const char *tmppath = rpmGetVar(RPMVAR_TMPPATH);
-    const char *myroot;
     int notifyFlags = interfaceFlags | (rpmIsVerbose ? INSTALL_HASH : 0 );
     int transFlags = 0;
     rpmProblemSet probs, finalProbs;
@@ -110,10 +108,6 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
     memset(tmpPackages, 0, nb);
     nb = (numPackages + 1) * sizeof(Header);
 
-    myroot = rootdir;
-    if (myroot[0] == '/' && myroot[1] == '\0' && tmppath[0] == '/')
-       myroot = "";
-
     rpmMessage(RPMMESS_DEBUG, _("looking for packages to download\n"));
     for (filename = argv, i = 0; *filename; filename++) {
 
@@ -122,16 +116,16 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
        case URL_IS_HTTP:
        case URL_IS_PATH:
        {   int myrc;
-           char *tfn;
+           const char *tfn;
+           char tfnpid[64];
            if (rpmIsVerbose()) {
                fprintf(stdout, _("Retrieving %s\n"), *filename);
            }
 
-           nb = strlen(myroot) + strlen(tmppath) +
-               sizeof("/rpm-12345-12345");
-           tfn = malloc(nb);
-           sprintf(tfn, "%s%s/rpm-%.5u-%.5u", myroot,
-               tmppath, (int) getpid(), tmpnum++);
+           sprintf(tfnpid, "rpm-%.5u-%.5u", (int) getpid(), tmpnum++);
+           /* XXX watchout for rootdir = NULL */
+           tfn = rpmGetPath( (rootdir ? rootdir : ""),
+               "%{_tmppath}", tfnpid, NULL);
 
            rpmMessage(RPMMESS_DEBUG, _(" ... as %s\n"), tfn);
            myrc = urlGetFile(*filename, tfn);
@@ -141,7 +135,7 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
                        *filename, ftpStrerror(myrc));
                numFailed++;
                packages[i] = NULL;
-               free(tfn);
+               xfree(tfn);
            } else {
                tmpPackages[numTmpPackages++] = packages[i++] = tfn;
            }
@@ -252,7 +246,7 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
 
     for (i = 0; i < numTmpPackages; i++) {
        unlink(tmpPackages[i]);
-       free(tmpPackages[i]);
+       xfree(tmpPackages[i]);
     }
 
     /* FIXME how do we close our various fd's? */
index afd8de8..c2d5b08 100644 (file)
@@ -54,7 +54,6 @@ static int installSources(Header h, char * rootdir, FD_t fd,
                          char ** specFilePtr, rpmNotifyFunction notify,
                          void * notifyData, char * labelFormat);
 static int markReplacedFiles(rpmdb db, struct replacedFile * replList);
-static int ensureOlder(rpmdb db, Header new, int dbOffset);
 static int assembleFileList(Header h, struct fileMemory * mem, 
                             int * fileCountPtr, struct fileInfo ** filesPtr, 
                             int stripPrefixLength, enum fileActions * actions);
@@ -280,7 +279,6 @@ int installBinaryPackage(char * rootdir, rpmdb db, FD_t fd, Header h,
     struct replacedFile * replacedList = NULL;
     char * defaultPrefix;
     dbiIndexSet matches;
-    char * tmpPath;
     int scriptArg;
     int stripSize = 1;         /* strip at least first / for cpio */
     uint_32 * archiveSizePtr;
@@ -452,14 +450,6 @@ int installBinaryPackage(char * rootdir, rpmdb db, FD_t fd, Header h,
            }
        }
 
-       if (rootdir) {
-           tmpPath = alloca(strlen(rootdir) + 
-                            strlen(rpmGetVar(RPMVAR_TMPPATH)) + 20);
-           strcpy(tmpPath, rootdir);
-           strcat(tmpPath, rpmGetVar(RPMVAR_TMPPATH));
-       } else
-           tmpPath = rpmGetVar(RPMVAR_TMPPATH);
-
        if (!headerGetEntry(h, RPMTAG_ARCHIVESIZE, &type, 
                                (void *) &archiveSizePtr, &count))
            archiveSizePtr = NULL;
@@ -656,10 +646,12 @@ static int installArchive(FD_t fd, struct fileInfo * files,
 static int installSources(Header h, char * rootdir, FD_t fd, 
                          char ** specFilePtr, rpmNotifyFunction notify,
                          void * notifyData,
-                         char * labelFormat) {
+                         char * labelFormat)
+{
     char * specFile;
     int specFileIndex = -1;
-    char * realSourceDir, * realSpecDir;
+    const char * realSourceDir = NULL;
+    const char * realSpecDir = NULL;
     char * instSpecFile, * correctSpecFile;
     char * name, * release, * version;
     int fileCount = 0;
@@ -673,33 +665,23 @@ static int installSources(Header h, char * rootdir, FD_t fd,
     int currDirLen;
     uid_t currUid = getuid();
     gid_t currGid = getgid();
+    int rc = 0;
 
     rpmMessage(RPMMESS_DEBUG, _("installing a source package\n"));
 
-    {  char buf[BUFSIZ];
-       strcpy(buf, rootdir);
-       strcat(buf, "/%{_sourcedir}");
-       expandMacros(NULL, &globalMacroContext, buf, sizeof(buf));
-       realSourceDir = alloca(strlen(buf)+1);
-       strcpy(realSourceDir, buf);
-    }
-
-    {  char buf[BUFSIZ];
-       strcpy(buf, rootdir);
-       strcat(buf, "/%{_specdir}");
-       expandMacros(NULL, &globalMacroContext, buf, sizeof(buf));
-       realSpecDir = alloca(strlen(buf)+1);
-       strcpy(realSpecDir, buf);
-    }
+    realSourceDir = rpmGetPath(rootdir, "/%{_sourcedir}", NULL);
+    realSourceDir = rpmGetPath(rootdir, "/%{_specdir}", NULL);
 
     if (access(realSourceDir, W_OK)) {
        rpmError(RPMERR_CREATE, _("cannot write to %s"), realSourceDir);
-       return 2;
+       rc = 2;
+       goto exit;
     }
 
     if (access(realSpecDir, W_OK)) {
        rpmError(RPMERR_CREATE, _("cannot write to %s"), realSpecDir);
-       return 2;
+       rc = 2;
+       goto exit;
     }
 
     rpmMessage(RPMMESS_DEBUG, _("sources in: %s\n"), realSourceDir);
@@ -738,7 +720,8 @@ static int installSources(Header h, char * rootdir, FD_t fd,
        } else {
            rpmError(RPMERR_NOSPEC, _("source package contains no .spec file"));
            if (fileCount > 0) freeFileMemory(fileMem);
-           return 2;
+           rc = 2;
+           goto exit;
        }
     }
 
@@ -767,7 +750,8 @@ static int installSources(Header h, char * rootdir, FD_t fd,
                          archiveSizePtr ? *archiveSizePtr : 0)) {
        if (fileCount > 0) freeFileMemory(fileMem);
        free(currDir);
-       return 2;
+       rc = 2;
+       goto exit;
     }
 
     chdir(currDir);
@@ -776,7 +760,8 @@ static int installSources(Header h, char * rootdir, FD_t fd,
     if (specFileIndex == -1) {
        if (!specFile) {
            rpmError(RPMERR_NOSPEC, _("source package contains no .spec file"));
-           return 1;
+           rc = 1;
+           goto exit;
        }
 
        /* This logic doesn't work is realSpecDir and realSourceDir are on
@@ -799,7 +784,8 @@ static int installSources(Header h, char * rootdir, FD_t fd,
        if (rename(instSpecFile, correctSpecFile)) {
            rpmError(RPMERR_RENAME, _("rename of %s to %s failed: %s"),
                     instSpecFile, correctSpecFile, strerror(errno));
-           return 2;
+           rc = 2;
+           goto exit;
        }
 
        if (specFilePtr)
@@ -810,8 +796,12 @@ static int installSources(Header h, char * rootdir, FD_t fd,
 
        if (fileCount > 0) freeFileMemory(fileMem);
     }
+    rc = 0;
 
-    return 0;
+exit:
+    if (realSpecDir)   xfree(realSpecDir);
+    if (realSourceDir) xfree(realSourceDir);
+    return rc;
 }
 
 static int markReplacedFiles(rpmdb db, struct replacedFile * replList) {
@@ -895,6 +885,8 @@ int rpmVersionCompare(Header first, Header second) {
     return rpmvercmp(one, two);
 }
 
+#ifdef UNUSED
+static int ensureOlder(rpmdb db, Header new, int dbOffset);
 static int ensureOlder(rpmdb db, Header new, int dbOffset) {
     Header old;
     char * name, * version, * release;
@@ -919,6 +911,7 @@ static int ensureOlder(rpmdb db, Header new, int dbOffset) {
 
     return rc;
 }
+#endif
 
 const char * fileActionString(enum fileActions a) {
     switch (a) {
index 6aaf5bb..f3bc83e 100644 (file)
@@ -1195,7 +1195,7 @@ freeMacros(MacroContext *mc)
 
 /* =============================================================== */
 
-int isCompressed(char *file, int *compressed)
+int isCompressed(const char *file, int *compressed)
 {
     FD_t fd;
     ssize_t nb;
index 9856602..696c643 100644 (file)
@@ -251,6 +251,8 @@ extern const struct headerSprintfExtension rpmHeaderFormats[];
 
 #define        RPMVAR_NUM                      50     /* number of RPMVAR entries */
 
+#define        xfree(_p)       free((void *)_p)
+const char *rpmGetPath(const char *path, ...);
 char * rpmGetVar(int var);
 int rpmGetBooleanVar(int var);
 void rpmSetVar(int var, const char *val);
index ddec371..730cce9 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
 #define COMPRESSED_OTHER 1
 #define COMPRESSED_BZIP2 2
 
-int isCompressed(char *file, int *compressed);
+int isCompressed(const char *file, int *compressed);
 
 void   dumpMacroTable  __P((MacroContext *mc));
 
index 2efaed9..d7de875 100644 (file)
@@ -1,5 +1,7 @@
 #include "system.h"
 
+#include <stdarg.h>
+
 #if HAVE_SYS_SYSTEMCFG_H
 #include <sys/systemcfg.h>
 #else
@@ -560,6 +562,32 @@ static void setDefaults(void) {
 
 }
 
+const char * rpmGetPath(const char *path, ...) {
+    char buf[BUFSIZ], *p, *pe;
+    const char *s;
+    va_list ap;
+
+    p = buf;
+    strcpy(p, path);
+    pe = p + strlen(p);
+    *pe = '\0';
+
+    va_start(ap, path);
+    while ((s = va_arg(ap, const char *)) != NULL) {
+       /* XXX FIXME: this fixes onle some of the "...//..." problems */
+       if (pe > p && pe[-1] == '/')
+           while(*s && *s == '/')      s++;
+       if (*s != '\0') {
+           strcpy(pe, s);
+           pe += strlen(pe);
+           *pe = '\0';
+       }
+    }
+    va_end(ap);
+    expandMacros(NULL, &globalMacroContext, buf, sizeof(buf));
+    return strdup(buf);
+}
+
 int rpmReadRC(const char * rcfiles)
 {
     char *myrcfiles, *r, *re;
index 468ba6b..23f81d2 100644 (file)
@@ -58,7 +58,7 @@ char *getStringBuf(StringBuf sb)
     return sb->buf;
 }
 
-void appendStringBufAux(StringBuf sb, char *s, int nl)
+void appendStringBufAux(StringBuf sb, const char *s, int nl)
 {
     int l;
 
index 993899d..2be4549 100644 (file)
@@ -12,6 +12,6 @@ void stripTrailingBlanksStringBuf(StringBuf sb);
 #define appendStringBuf(sb, s)     appendStringBufAux(sb, s, 0)
 #define appendLineStringBuf(sb, s) appendStringBufAux(sb, s, 1)
 
-void appendStringBufAux(StringBuf sb, char *s, int nl);
+void appendStringBufAux(StringBuf sb, const char *s, int nl);
 
 #endif /* _STRINGBUF_H_ */
index 8633de9..7debdc1 100644 (file)
@@ -366,6 +366,13 @@ static int removeFile(char * file, unsigned int flags, short mode,
                rc = 1;
            }
        }
+       break;
+      case UNKNOWN:
+      case CREATE:
+      case SAVE:
+      case SKIP:
+      case ALTNAME:
+       break;
     }
  
     return 0;
index 86bd5e4..f6c8ea9 100644 (file)
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-01-02 22:11-0500\n"
+"POT-Creation-Date: 1999-01-05 18:03-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"
@@ -15,86 +15,86 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: ENCODING\n"
 
-#: ../build.c:45 ../build.c:56
+#: ../build.c:44 ../build.c:55
 #, c-format
 msgid "Failed to open tar pipe: %s\n"
 msgstr ""
 
 #. Give up
-#: ../build.c:62
+#: ../build.c:61
 #, c-format
 msgid "Failed to read spec file from %s\n"
 msgstr ""
 
-#: ../build.c:85
+#: ../build.c:84
 #, c-format
 msgid "Failed to rename %s to %s: %s\n"
 msgstr ""
 
-#: ../build.c:117
+#: ../build.c:118
 #, c-format
 msgid "File is not a regular file: %s\n"
 msgstr ""
 
-#: ../build.c:122
+#: ../build.c:123
 #, c-format
 msgid "Unable to open spec file: %s\n"
 msgstr ""
 
-#: ../build.c:130
+#: ../build.c:131
 #, c-format
 msgid "File contains non-printable characters(%c): %s\n"
 msgstr ""
 
-#: ../build.c:217
+#: ../build.c:218
 msgid "buildroot already specified"
 msgstr ""
 
-#: ../build.c:223
+#: ../build.c:224
 msgid "--buildarch has been obsoleted.  Use the --target option instead.\n"
 msgstr ""
 
-#: ../build.c:227
+#: ../build.c:228
 msgid "--buildos has been obsoleted.  Use the --target option instead.\n"
 msgstr ""
 
-#: ../build.c:248
+#: ../build.c:249
 msgid "override build architecture"
 msgstr ""
 
-#: ../build.c:250
+#: ../build.c:251
 msgid "override build operating system"
 msgstr ""
 
-#: ../build.c:252
+#: ../build.c:253
 msgid "override build root"
 msgstr ""
 
-#: ../build.c:254 ../rpm.c:429
+#: ../build.c:255 ../rpm.c:429
 msgid "remove build tree when done"
 msgstr ""
 
-#: ../build.c:256
+#: ../build.c:257
 msgid "do not execute any stages of the build"
 msgstr ""
 
-#: ../build.c:258
+#: ../build.c:259
 msgid "do not accept I18N msgstr's from specfile"
 msgstr ""
 
-#: ../build.c:260
+#: ../build.c:261
 msgid "remove sources and specfile when done"
 msgstr ""
 
-#: ../build.c:262 ../rpm.c:427
+#: ../build.c:263 ../rpm.c:427
 msgid "skip straight to specified stage (only for c,i)"
 msgstr ""
 
-#: ../build.c:264
+#: ../build.c:265
 msgid "override target platform"
 msgstr ""
 
-#: ../build.c:266
+#: ../build.c:267
 msgid "lookup I18N strings in specfile catalog"
 msgstr ""
 
@@ -223,35 +223,35 @@ msgstr ""
 msgid "Unknown or unexpected error"
 msgstr ""
 
-#: ../install.c:100
+#: ../install.c:98
 msgid "counting packages to install\n"
 msgstr ""
 
-#: ../install.c:104
+#: ../install.c:102
 #, c-format
 msgid "found %d packages\n"
 msgstr ""
 
-#: ../install.c:117
+#: ../install.c:111
 msgid "looking for packages to download\n"
 msgstr ""
 
-#: ../install.c:127
+#: ../install.c:122
 #, c-format
 msgid "Retrieving %s\n"
 msgstr ""
 
-#: ../install.c:136
+#: ../install.c:130
 #, c-format
 msgid " ... as %s\n"
 msgstr ""
 
-#: ../install.c:140
+#: ../install.c:134
 #, c-format
 msgid "skipping %s - transfer failed - %s\n"
 msgstr ""
 
-#: ../install.c:155
+#: ../install.c:149
 #, c-format
 msgid "retrieved %d packages\n"
 msgstr ""
@@ -259,89 +259,89 @@ msgstr ""
 #. Build up the transaction set. As a special case, v1 source packages
 #. are installed right here, only because they don't have headers and
 #. would create all sorts of confusion later.
-#: ../install.c:160
+#: ../install.c:154
 #, c-format
 msgid "opening database mode: 0%o\n"
 msgstr ""
 
-#: ../install.c:162
+#: ../install.c:156
 #, c-format
 msgid "error: cannot open %s%s/packages.rpm\n"
 msgstr ""
 
-#: ../install.c:172
+#: ../install.c:166
 #, c-format
 msgid "cannot open file %s\n"
 msgstr ""
 
-#: ../install.c:183
+#: ../install.c:177
 #, c-format
 msgid "error: %s does not appear to be a RPM package\n"
 msgstr ""
 
-#: ../install.c:186
+#: ../install.c:180
 #, c-format
 msgid "error: %s cannot be installed\n"
 msgstr ""
 
-#: ../install.c:199
+#: ../install.c:193
 #, c-format
 msgid "found %d source and %d binary packages\n"
 msgstr ""
 
-#: ../install.c:209
+#: ../install.c:203
 msgid "failed dependencies:\n"
 msgstr ""
 
-#: ../install.c:225
+#: ../install.c:219
 msgid "installing binary packages\n"
 msgstr ""
 
-#: ../install.c:292
+#: ../install.c:286
 #, c-format
 msgid "cannot open %s%s/packages.rpm\n"
 msgstr ""
 
-#: ../install.c:302 ../lib/query.c:614 ../verify.c:243
+#: ../install.c:296 ../lib/query.c:614 ../verify.c:243
 #, c-format
 msgid "package %s is not installed\n"
 msgstr ""
 
-#: ../install.c:305
+#: ../install.c:299
 #, c-format
 msgid "searching for package %s\n"
 msgstr ""
 
-#: ../install.c:313
+#: ../install.c:307
 #, c-format
 msgid "\"%s\" specifies multiple packages\n"
 msgstr ""
 
-#: ../install.c:338
+#: ../install.c:332
 msgid "removing these packages would break dependencies:\n"
 msgstr ""
 
-#: ../install.c:365
+#: ../install.c:359
 #, c-format
 msgid "cannot open %s\n"
 msgstr ""
 
-#: ../install.c:370
+#: ../install.c:364
 #, c-format
 msgid "Installing %s\n"
 msgstr ""
 
-#: ../install.c:375
+#: ../install.c:369
 #, c-format
 msgid "%s cannot be installed\n"
 msgstr ""
 
-#: ../install.c:414
+#: ../install.c:408
 #, c-format
 msgid " is needed by %s-%s-%s\n"
 msgstr ""
 
-#: ../install.c:417
+#: ../install.c:411
 #, c-format
 msgid " conflicts with %s-%s-%s\n"
 msgstr ""
@@ -1456,21 +1456,21 @@ msgstr ""
 msgid "no copyright!\n"
 msgstr ""
 
-#: ../build/build.c:89 ../build/pack.c:262
+#: ../build/build.c:86 ../build/pack.c:262
 msgid "Unable to open temp file"
 msgstr ""
 
-#: ../build/build.c:128
+#: ../build/build.c:125
 #, c-format
 msgid "Executing: %s\n"
 msgstr ""
 
-#: ../build/build.c:132
+#: ../build/build.c:129
 #, c-format
 msgid "Exec of %s failed (%s)"
 msgstr ""
 
-#: ../build/build.c:140
+#: ../build/build.c:137
 #, c-format
 msgid "Bad exit status from %s (%s)"
 msgstr ""
@@ -1593,99 +1593,99 @@ msgstr ""
 msgid "Can't mix special %%doc with other forms: %s"
 msgstr ""
 
-#: ../build/files.c:760
+#: ../build/files.c:761
 #, c-format
 msgid "File listed twice: %s"
 msgstr ""
 
-#: ../build/files.c:913
+#: ../build/files.c:914
 #, c-format
 msgid "File doesn't match prefix (%s): %s"
 msgstr ""
 
-#: ../build/files.c:923 ../build/files.c:1038
+#: ../build/files.c:924 ../build/files.c:1039
 #, c-format
 msgid "File not found: %s"
 msgstr ""
 
-#: ../build/files.c:969
+#: ../build/files.c:970
 #, c-format
 msgid "Bad owner/group: %s\n"
 msgstr ""
 
-#: ../build/files.c:974
+#: ../build/files.c:975
 #, c-format
 msgid "File %d: %s\n"
 msgstr ""
 
-#: ../build/files.c:1022
+#: ../build/files.c:1023
 #, c-format
 msgid "File needs leading \"/\": %s"
 msgstr ""
 
-#: ../build/files.c:1083
+#: ../build/files.c:1085
 msgid "Could not open %%files file: %s"
 msgstr ""
 
-#: ../build/files.c:1089 ../build/pack.c:447
+#: ../build/files.c:1091 ../build/pack.c:447
 #, c-format
 msgid "line: %s"
 msgstr ""
 
-#: ../build/files.c:1361 ../build/parsePrep.c:40
+#: ../build/files.c:1355 ../build/parsePrep.c:40
 #, c-format
 msgid "Bad owner/group: %s"
 msgstr ""
 
-#: ../build/files.c:1415
+#: ../build/files.c:1409
 #, c-format
 msgid "Couldn't exec %s"
 msgstr ""
 
-#: ../build/files.c:1419
+#: ../build/files.c:1413
 #, c-format
 msgid "Couldn't fork %s"
 msgstr ""
 
-#: ../build/files.c:1469
+#: ../build/files.c:1463
 #, c-format
 msgid "%s failed"
 msgstr ""
 
-#: ../build/files.c:1473
+#: ../build/files.c:1467
 #, c-format
 msgid "failed to write all data to %s"
 msgstr ""
 
-#: ../build/files.c:1507
+#: ../build/files.c:1501
 msgid "Finding provides...\n"
 msgstr ""
 
-#: ../build/files.c:1514
+#: ../build/files.c:1508
 msgid "Failed to find provides"
 msgstr ""
 
-#: ../build/files.c:1533
+#: ../build/files.c:1527
 msgid "Finding requires...\n"
 msgstr ""
 
-#: ../build/files.c:1540
+#: ../build/files.c:1534
 msgid "Failed to find requires"
 msgstr ""
 
-#: ../build/files.c:1574
+#: ../build/files.c:1568
 msgid "Provides:"
 msgstr ""
 
-#: ../build/files.c:1589
+#: ../build/files.c:1583
 msgid "Prereqs:"
 msgstr ""
 
-#: ../build/files.c:1601
+#: ../build/files.c:1595
 msgid "Requires:"
 msgstr ""
 
-#: ../build/files.c:1625
+#: ../build/files.c:1619
 #, c-format
 msgid "Processing files: %s\n"
 msgstr ""
@@ -1703,7 +1703,7 @@ msgstr ""
 msgid "Could not canonicalize hostname: %s\n"
 msgstr ""
 
-#: ../build/pack.c:150
+#: ../build/pack.c:152
 #, c-format
 msgid "Could not generate output filename for package %s: %s\n"
 msgstr ""
@@ -1891,73 +1891,78 @@ msgstr ""
 msgid "Duplicate %s entries in package: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:273 ../build/parsePreamble.c:281
+#: ../build/parsePreamble.c:274
+#, c-format
+msgid "Unable to stat icon: %s"
+msgstr ""
+
+#: ../build/parsePreamble.c:285
 #, c-format
 msgid "Unable to read icon: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:291
+#: ../build/parsePreamble.c:295
 #, c-format
 msgid "Unknown icon type: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:322
+#: ../build/parsePreamble.c:330
 #, c-format
 msgid "line %d: Malformed tag: %s"
 msgstr ""
 
 #. Empty field
-#: ../build/parsePreamble.c:330
+#: ../build/parsePreamble.c:338
 #, c-format
 msgid "line %d: Empty tag: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:381
+#: ../build/parsePreamble.c:389
 #, c-format
 msgid "line %d: BuildRoot can not be \"/\": %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:394
+#: ../build/parsePreamble.c:402
 #, c-format
 msgid "line %d: Prefixes must not end with \"/\": %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:406
+#: ../build/parsePreamble.c:414
 #, c-format
 msgid "line %d: Docdir must begin with '/': %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:417
+#: ../build/parsePreamble.c:425
 #, c-format
 msgid "line %d: Epoch/Serial field must be a number: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:481
+#: ../build/parsePreamble.c:489
 #, c-format
 msgid "line %d: Bad BuildArchitecture format: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:491
+#: ../build/parsePreamble.c:499
 #, c-format
 msgid "Internal error: Bogus tag %d"
 msgstr ""
 
-#: ../build/parsePreamble.c:635
+#: ../build/parsePreamble.c:643
 #, c-format
 msgid "Bad package specification: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:641
+#: ../build/parsePreamble.c:649
 #, c-format
 msgid "Package already exists: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:668
+#: ../build/parsePreamble.c:676
 #, c-format
 msgid "line %d: Unknown tag: %s"
 msgstr ""
 
-#: ../build/parsePreamble.c:693
+#: ../build/parsePreamble.c:701
 msgid "Spec file can't use BuildRoot"
 msgstr ""
 
@@ -1971,48 +1976,48 @@ msgstr ""
 msgid "No patch number %d"
 msgstr ""
 
-#: ../build/parsePrep.c:124
+#: ../build/parsePrep.c:125
 #, c-format
 msgid "No source number %d"
 msgstr ""
 
-#: ../build/parsePrep.c:175
+#: ../build/parsePrep.c:177
 msgid "Error parsing %%setup: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:190
+#: ../build/parsePrep.c:192
 msgid "line %d: Bad arg to %%setup %c: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:211
+#: ../build/parsePrep.c:213
 msgid "line %d: Bad %%setup option %s: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:335
+#: ../build/parsePrep.c:337
 msgid "line %d: Need arg to %%patch -b: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:343
+#: ../build/parsePrep.c:345
 msgid "line %d: Need arg to %%patch -z: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:355
+#: ../build/parsePrep.c:357
 msgid "line %d: Need arg to %%patch -p: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:361
+#: ../build/parsePrep.c:363
 msgid "line %d: Bad arg to %%patch -p: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:368
+#: ../build/parsePrep.c:370
 msgid "Too many patches!"
 msgstr ""
 
-#: ../build/parsePrep.c:372
+#: ../build/parsePrep.c:374
 msgid "line %d: Bad arg to %%patch: %s"
 msgstr ""
 
-#: ../build/parsePrep.c:408
+#: ../build/parsePrep.c:410
 msgid "line %d: second %%prep"
 msgstr ""
 
@@ -2122,7 +2127,7 @@ msgstr ""
 msgid "line %d: Bad no%s number: %d"
 msgstr ""
 
-#: ../build/spec.c:291
+#: ../build/spec.c:290
 #, c-format
 msgid "line %d: Bad %s number: %s\n"
 msgstr ""
@@ -2181,31 +2186,31 @@ msgstr ""
 msgid "error removing record %s into %s"
 msgstr ""
 
-#: ../lib/depends.c:349 ../lib/depends.c:508
+#: ../lib/depends.c:363 ../lib/depends.c:522
 #, c-format
 msgid "cannot read header at %d for dependency check"
 msgstr ""
 
-#: ../lib/depends.c:414
+#: ../lib/depends.c:428
 #, c-format
 msgid "dependencies: looking for %s\n"
 msgstr ""
 
-#: ../lib/depends.c:601
+#: ../lib/depends.c:615
 #, c-format
 msgid "package %s require not satisfied: %s\n"
 msgstr ""
 
-#: ../lib/depends.c:644
+#: ../lib/depends.c:658
 #, c-format
 msgid "package %s conflicts: %s\n"
 msgstr ""
 
-#: ../lib/depends.c:743
+#: ../lib/depends.c:757
 msgid "dbrecMatchesDepFlags() failed to read header"
 msgstr ""
 
-#: ../lib/depends.c:795
+#: ../lib/depends.c:809
 #, c-format
 msgid "loop in prerequisite chain: %s"
 msgstr ""
@@ -2322,102 +2327,102 @@ msgstr ""
 msgid "(unknown type)"
 msgstr ""
 
-#: ../lib/install.c:80
+#: ../lib/install.c:78
 msgid "source package expected, binary found"
 msgstr ""
 
-#: ../lib/install.c:177
+#: ../lib/install.c:175
 #, c-format
 msgid "not installing %s -- linguas\n"
 msgstr ""
 
-#: ../lib/install.c:182
+#: ../lib/install.c:180 ../lib/uninstall.c:111
 #, c-format
 msgid "   file: %s action: %s\n"
 msgstr ""
 
-#: ../lib/install.c:202
+#: ../lib/install.c:200
 #, c-format
 msgid "user %s does not exist - using root"
 msgstr ""
 
-#: ../lib/install.c:210
+#: ../lib/install.c:208
 #, c-format
 msgid "group %s does not exist - using root"
 msgstr ""
 
-#: ../lib/install.c:234
+#: ../lib/install.c:232
 msgid "instchangelog value in rpmrc should be a number, but isn't"
 msgstr ""
 
-#: ../lib/install.c:303
+#: ../lib/install.c:298
 #, c-format
 msgid "package: %s-%s-%s files test = %d\n"
 msgstr ""
 
-#: ../lib/install.c:379
+#: ../lib/install.c:363
 msgid "stopping install as we're running --test\n"
 msgstr ""
 
-#: ../lib/install.c:385
+#: ../lib/install.c:369
 msgid "running preinstall script (if any)\n"
 msgstr ""
 
-#: ../lib/install.c:416
+#: ../lib/install.c:400
 #, c-format
 msgid "warning: %s created as %s"
 msgstr ""
 
-#: ../lib/install.c:450
+#: ../lib/install.c:430
 #, c-format
 msgid "warning: %s saved as %s"
 msgstr ""
 
-#: ../lib/install.c:454 ../lib/install.c:818 ../lib/uninstall.c:599
+#: ../lib/install.c:434 ../lib/install.c:785 ../lib/uninstall.c:341
 #, c-format
 msgid "rename of %s to %s failed: %s"
 msgstr ""
 
-#: ../lib/install.c:554
+#: ../lib/install.c:526
 msgid "running postinstall script (if any)\n"
 msgstr ""
 
 #. this would probably be a good place to check if disk space
 #. was used up - if so, we should return a different error
-#: ../lib/install.c:656
+#: ../lib/install.c:628
 #, c-format
 msgid "unpacking of archive failed on file %s: %s"
 msgstr ""
 
-#: ../lib/install.c:695
+#: ../lib/install.c:670
 msgid "installing a source package\n"
 msgstr ""
 
-#: ../lib/install.c:714 ../lib/install.c:719
+#: ../lib/install.c:676 ../lib/install.c:682
 #, c-format
 msgid "cannot write to %s"
 msgstr ""
 
-#: ../lib/install.c:723
+#: ../lib/install.c:687
 #, c-format
 msgid "sources in: %s\n"
 msgstr ""
 
-#: ../lib/install.c:724
+#: ../lib/install.c:688
 #, c-format
 msgid "spec file in: %s\n"
 msgstr ""
 
-#: ../lib/install.c:757 ../lib/install.c:796
+#: ../lib/install.c:721 ../lib/install.c:762
 msgid "source package contains no .spec file"
 msgstr ""
 
-#: ../lib/install.c:816
+#: ../lib/install.c:783
 #, c-format
 msgid "renaming %s to %s\n"
 msgstr ""
 
-#: ../lib/install.c:932
+#: ../lib/install.c:906
 #, c-format
 msgid "package %s-%s-%s (which is newer) is already installed"
 msgstr ""
@@ -2806,7 +2811,7 @@ msgstr ""
 msgid "package %s not found in %s"
 msgstr ""
 
-#: ../lib/rpmdb.c:381 ../lib/uninstall.c:118 ../lib/uninstall.c:219
+#: ../lib/rpmdb.c:381 ../lib/uninstall.c:40
 #, c-format
 msgid "cannot read header at %d for uninstall"
 msgstr ""
@@ -2874,92 +2879,92 @@ msgstr ""
 msgid "read failed: %s (%d)"
 msgstr ""
 
-#: ../lib/rpmrc.c:217
+#: ../lib/rpmrc.c:219
 #, c-format
 msgid "missing second ':' at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:220
+#: ../lib/rpmrc.c:222
 #, c-format
 msgid "missing architecture name at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:368
+#: ../lib/rpmrc.c:370
 #, c-format
 msgid "Incomplete data line at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:372
+#: ../lib/rpmrc.c:374
 #, c-format
 msgid "Too many args in data line at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:379
+#: ../lib/rpmrc.c:381
 #, c-format
 msgid "Bad arch/os number: %s (%s:%d)"
 msgstr ""
 
-#: ../lib/rpmrc.c:413
+#: ../lib/rpmrc.c:415
 #, c-format
 msgid "Incomplete default line at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:418
+#: ../lib/rpmrc.c:420
 #, c-format
 msgid "Too many args in default line at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:594
+#: ../lib/rpmrc.c:622
 #, c-format
 msgid "Cannot expand %s"
 msgstr ""
 
-#: ../lib/rpmrc.c:609
+#: ../lib/rpmrc.c:637
 #, c-format
 msgid "Unable to open %s for reading: %s."
 msgstr ""
 
-#: ../lib/rpmrc.c:643
+#: ../lib/rpmrc.c:671
 #, c-format
 msgid "Failed to read %s: %s."
 msgstr ""
 
-#: ../lib/rpmrc.c:674
+#: ../lib/rpmrc.c:702
 #, c-format
 msgid "missing ':' at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:690 ../lib/rpmrc.c:738
+#: ../lib/rpmrc.c:718 ../lib/rpmrc.c:766
 #, c-format
 msgid "missing argument for %s at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:704
+#: ../lib/rpmrc.c:732
 #, c-format
 msgid "expansion failed at %s:d \"%s\""
 msgstr ""
 
-#: ../lib/rpmrc.c:710
+#: ../lib/rpmrc.c:738
 #, c-format
 msgid "cannot open %s at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:728
+#: ../lib/rpmrc.c:756
 #, c-format
 msgid "missing architecture for %s at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:795
+#: ../lib/rpmrc.c:823
 #, c-format
 msgid "bad option '%s' at %s:%d"
 msgstr ""
 
-#: ../lib/rpmrc.c:1153
+#: ../lib/rpmrc.c:1181
 #, c-format
 msgid "Unknown system: %s\n"
 msgstr ""
 
-#: ../lib/rpmrc.c:1154
+#: ../lib/rpmrc.c:1182
 msgid "Please contact rpm-list@redhat.com\n"
 msgstr ""
 
@@ -3049,120 +3054,39 @@ msgstr ""
 msgid "You must set \"pgp_name:\" in your rpmrc file"
 msgstr ""
 
-#: ../lib/uninstall.c:131
-#, c-format
-msgid "package %s-%s-%s contain shared files\n"
-msgstr ""
-
-#: ../lib/uninstall.c:136
-#, c-format
-msgid "package %s contains no files"
-msgstr ""
-
-#. This shouldn't happen, but some versions of RPM didn't
-#. implement --justdb properly, and chose to leave this stuff
-#. out.
-#: ../lib/uninstall.c:149 ../lib/uninstall.c:280
-msgid "package is missing FILESTATES\n"
-msgstr ""
-
-#: ../lib/uninstall.c:159
-#, c-format
-msgid "file %s is shared\n"
-msgstr ""
-
-#: ../lib/uninstall.c:164
-msgid "     file has already been replaced\n"
-msgstr ""
-
-#: ../lib/uninstall.c:168
-msgid "     file was never installed\n"
-msgstr ""
-
-#: ../lib/uninstall.c:172
-msgid "     file is netshared (so don't touch it)\n"
-msgstr ""
-
-#: ../lib/uninstall.c:179
-msgid "    file is truely shared - saving\n"
-msgstr ""
-
-#: ../lib/uninstall.c:230
+#: ../lib/uninstall.c:51
 #, c-format
 msgid "cannot read packages named %s for uninstall"
 msgstr ""
 
-#: ../lib/uninstall.c:258
+#: ../lib/uninstall.c:79
 #, c-format
 msgid "will remove files test = %d\n"
 msgstr ""
 
-#: ../lib/uninstall.c:306
-#, c-format
-msgid "%s has a netshared override\n"
-msgstr ""
-
-#: ../lib/uninstall.c:344
+#: ../lib/uninstall.c:124
 msgid "running postuninstall script (if any)\n"
 msgstr ""
 
-#: ../lib/uninstall.c:358
+#: ../lib/uninstall.c:138
 msgid "removing database entry\n"
 msgstr ""
 
-#: ../lib/uninstall.c:513
+#: ../lib/uninstall.c:293
 msgid "execution of script failed"
 msgstr ""
 
-#: ../lib/uninstall.c:558
-#, c-format
-msgid "%s has already been replaced\n"
-msgstr ""
-
-#. if it's a config file, we may not want to remove it
-#: ../lib/uninstall.c:565
-#, c-format
-msgid "finding md5sum of %s\n"
-msgstr ""
-
-#: ../lib/uninstall.c:574
-msgid "    failed - assuming file removed\n"
-msgstr ""
-
-#: ../lib/uninstall.c:577
-msgid "    file changed - will save\n"
-msgstr ""
-
-#: ../lib/uninstall.c:581
-msgid "    file unchanged - will remove\n"
-msgstr ""
-
-#: ../lib/uninstall.c:589
-#, c-format
-msgid "keeping %s\n"
-msgstr ""
-
-#: ../lib/uninstall.c:593
-#, c-format
-msgid "saving %s as %s.rpmsave\n"
-msgstr ""
-
-#: ../lib/uninstall.c:607
-#, c-format
-msgid "%s - removing\n"
-msgstr ""
-
-#: ../lib/uninstall.c:613
+#: ../lib/uninstall.c:352
 #, c-format
 msgid "cannot remove %s - directory not empty"
 msgstr ""
 
-#: ../lib/uninstall.c:616
+#: ../lib/uninstall.c:355
 #, c-format
 msgid "rmdir of %s failed: %s"
 msgstr ""
 
-#: ../lib/uninstall.c:626
+#: ../lib/uninstall.c:363
 #, c-format
 msgid "removal of %s failed: %s"
 msgstr ""
index 6aaf5bb..f3bc83e 100644 (file)
@@ -1195,7 +1195,7 @@ freeMacros(MacroContext *mc)
 
 /* =============================================================== */
 
-int isCompressed(char *file, int *compressed)
+int isCompressed(const char *file, int *compressed)
 {
     FD_t fd;
     ssize_t nb;
index ddec371..730cce9 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
 #define COMPRESSED_OTHER 1
 #define COMPRESSED_BZIP2 2
 
-int isCompressed(char *file, int *compressed);
+int isCompressed(const char *file, int *compressed);
 
 void   dumpMacroTable  __P((MacroContext *mc));