diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | build.c | 77 | ||||
-rw-r--r-- | build/files.c | 26 | ||||
-rw-r--r-- | build/misc.c | 2 | ||||
-rw-r--r-- | build/parsePreamble.c | 4 | ||||
-rw-r--r-- | build/parseSpec.c | 3 | ||||
-rw-r--r-- | lib/cpio.c | 4 | ||||
-rw-r--r-- | lib/falloc.c | 3 | ||||
-rw-r--r-- | lib/macro.c | 7 | ||||
-rw-r--r-- | lib/rpminstall.c | 4 | ||||
-rw-r--r-- | lib/rpmio.h | 5 | ||||
-rw-r--r-- | lib/rpmrc.c | 2 | ||||
-rw-r--r-- | lib/rpmurl.h | 4 | ||||
-rw-r--r-- | lib/url.c | 146 | ||||
-rw-r--r-- | po/rpm.pot | 223 | ||||
-rwxr-xr-x | rpm.c | 34 | ||||
-rw-r--r-- | rpm2cpio.c | 2 | ||||
-rw-r--r-- | rpmio/macro.c | 7 |
18 files changed, 237 insertions, 317 deletions
@@ -2,6 +2,7 @@ - use compressed filenames on install side. - start unifying FD types, CFD_t now gone. - check for memory leaks (almost all leaks are plugged). + - fix: resurrect multiple target platform builds. 3.0.2 -> 3.0.3 - add --eval to find result of macro expansion. @@ -1,6 +1,8 @@ #include "system.h" -#include "rpmbuild.h" +#include <rpmbuild.h> +#include <rpmurl.h> + #include "build.h" #include "install.h" @@ -57,7 +59,8 @@ static int isSpecFile(const char *specfile) int count; int checking; - if (fdFileno((fd = fdOpen(specfile, O_RDONLY, 0))) < 0) { + if (fdFileno((fd = ufdOpen(specfile, O_RDONLY, 0))) < 0) { + /* XXX Fstrerror */ fprintf(stderr, _("Unable to open spec file: %s\n"), specfile); return 0; } @@ -156,7 +159,7 @@ static int buildForTarget(const char *arg, struct rpmBuildArguments *ba, s = cmd + strlen(cmd) - 1; *s = '\0'; - s = alloca(strlen(specDir) + strlen(cmd) + 5); + specfile = s = alloca(strlen(specDir) + strlen(cmd) + 5); sprintf(s, "%s/%s", specDir, cmd); res = rename(tmpSpecFile, s); xfree(specDir); @@ -184,28 +187,36 @@ static int buildForTarget(const char *arg, struct rpmBuildArguments *ba, *cmd = '\0'; addMacro(NULL, "_sourcedir", NULL, buf, RMIL_TARBALL); - specfile = s; - } else if (arg[0] == '/') { - specfile = arg; } else { - char *s = alloca(BUFSIZ); - (void)getcwd(s, BUFSIZ); - strcat(s, "/"); - strcat(s, arg); - specfile = s; + specfile = arg; } - stat(specfile, &statbuf); - if (! S_ISREG(statbuf.st_mode)) { - fprintf(stderr, _("File is not a regular file: %s\n"), specfile); - return 1; - } + switch (urlIsURL(specfile)) { + case URL_IS_UNKNOWN: + if (arg[0] == '/') { + specfile = arg; + } else { + char *s = alloca(BUFSIZ); + (void)getcwd(s, BUFSIZ); + strcat(s, "/"); + strcat(s, arg); + specfile = s; + } + stat(specfile, &statbuf); + if (! S_ISREG(statbuf.st_mode)) { + fprintf(stderr, _("File is not a regular file: %s\n"), specfile); + return 1; + } - /* Try to verify that the file is actually a specfile */ - if (!isSpecFile(specfile)) { - fprintf(stderr, _("File %s does not appear to be a specfile.\n"), + /* Try to verify that the file is actually a specfile */ + if (!isSpecFile(specfile)) { + fprintf(stderr, _("File %s does not appear to be a specfile.\n"), specfile); - return 1; + return 1; + } + break; + default: + break; } /* Parse the spec file */ @@ -243,19 +254,22 @@ int build(const char *arg, struct rpmBuildArguments *ba, const char *passPhrase, int nodeps) { char *t, *te; - int rc; + int rc = 0; char *targets = ba->targets; +#define buildCleanMask (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC) + int cleanFlags = ba->buildAmount & buildCleanMask; if (targets == NULL) { rc = buildForTarget(arg, ba, passPhrase, fromTarball, cookie, force, nodeps); - return rc; + goto exit; } /* parse up the build operators */ printf(_("Building target platforms: %s\n"), targets); + ba->buildAmount &= ~buildCleanMask; for (t = targets; *t != '\0'; t = te) { char *target; if ((te = strchr(t, ',')) == NULL) @@ -263,18 +277,27 @@ int build(const char *arg, struct rpmBuildArguments *ba, const char *passPhrase, target = alloca(te-t+1); strncpy(target, t, (te-t)); target[te-t] = '\0'; + if (*te) + te++; + else /* XXX Perform clean-up after last target build. */ + ba->buildAmount |= cleanFlags; + printf(_("Building for target %s\n"), target); + /* Read in configuration for target. */ + freeMacros(NULL); /* XXX macros from CLI are destroyed too */ rpmReadConfigFiles(rcfile, target); rc = buildForTarget(arg, ba, passPhrase, fromTarball, cookie, force, nodeps); if (rc) - return rc; - - freeMacros(NULL); + break; } - return 0; +exit: + /* Restore original configuration. */ + freeMacros(NULL); /* XXX macros from CLI are destroyed too */ + rpmReadConfigFiles(rcfile, NULL); + return rc; } #define POPT_USECATALOG 1000 @@ -325,7 +348,7 @@ static void buildArgCallback( /*@unused@*/ poptContext con, /*@notreached@*/ break; case POPT_TARGETPLATFORM: if (rba->targets) { - int len = strlen(rba->targets) + strlen(arg) + 2; + int len = strlen(rba->targets) + 1 + strlen(arg) + 1; rba->targets = xrealloc(rba->targets, len); strcat(rba->targets, ","); } else { diff --git a/build/files.c b/build/files.c index 83e02af49..2a2c1b38a 100644 --- a/build/files.c +++ b/build/files.c @@ -5,12 +5,14 @@ #include <regex.h> #include <signal.h> /* getOutputFrom() */ -#include "rpmbuild.h" +#include <rpmbuild.h> +#include <rpmmacro.h> +#include <rpmurl.h> + #include "buildio.h" #include "myftw.h" #include "md5.h" -#include "rpmmacro.h" #define SKIPWHITE(_x) {while(*(_x) && (isspace(*_x) || *(_x) == ',')) (_x)++;} #define SKIPNONWHITE(_x){while(*(_x) &&!(isspace(*_x) || *(_x) == ',')) (_x)++;} @@ -1493,13 +1495,27 @@ int processSourceFiles(Spec spec) flp->flags |= RPMFILE_GHOST; s++; } + + switch (urlIsURL(s)) { + case URL_IS_DASH: /* stdin */ + case URL_IS_FTP: /* ftp://... */ + case URL_IS_HTTP: /* http://... */ + continue; /* XXX just skip for now */ + case URL_IS_PATH: /* file://... */ + s += sizeof("file://") - 1; + s = strchr(s, '/'); + /*@fallthrough@*/ + case URL_IS_UNKNOWN: /* plain file path */ + break; + } + flp->diskName = xstrdup(s); fn = strrchr(s, '/'); - if (fn) { + if (fn) fn++; - } else { + else fn = s; - } + flp->fileName = xstrdup(fn); flp->verifyFlags = RPMVERIFY_ALL; diff --git a/build/misc.c b/build/misc.c index 7aa9c465e..7e99e349e 100644 --- a/build/misc.c +++ b/build/misc.c @@ -17,7 +17,7 @@ int parseNum(const char *line, int *res) const char *cleanFileName(const char *name) { - static char res[BUFSIZ]; + static char res[BUFSIZ]; /* XXX yuk */ char *copyTo, copied; const char *copyFrom; diff --git a/build/parsePreamble.c b/build/parsePreamble.c index ee1eeeee0..7de63bbe8 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmbuild.h" +#include <rpmbuild.h> static int_32 copyTagsDuringParse[] = { RPMTAG_EPOCH, @@ -245,6 +245,8 @@ static int readIcon(Header h, const char *file) icon = xmalloc(statbuf.st_size); *icon = '\0'; fd = fdOpen(fn, O_RDONLY, 0); + /* XXX Fstrerror */ + /* XXX fdFileno check */ nb = Fread(icon, statbuf.st_size, 1, fd); Fclose(fd); if (nb != statbuf.st_size) { diff --git a/build/parseSpec.c b/build/parseSpec.c index 3a7e91987..2497eec98 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -169,7 +169,8 @@ int readLine(Spec spec, int strip) retry: /* Make sure the current file is open */ if (ofi->file == NULL) { - if (!(ofi->file = fopen(ofi->fileName, "r"))) { + if (!(ofi->file = Fopen(ofi->fileName, "r"))) { + /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("Unable to open: %s\n"), ofi->fileName); return RPMERR_BADSPEC; diff --git a/lib/cpio.c b/lib/cpio.c index 704b085e8..fd6ed186b 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -450,7 +450,7 @@ static void freeLink( /*@only@*/ struct hardLink * li) for (i = 0; i < li->nlink; i++) { if (li->files[i] == NULL) continue; - /*@-unqualifiedtrans@*/ free(li->files[i]) /*@=unqualifiedtrans@*/ ; + /*@-unqualifiedtrans@*/ free((void *)li->files[i]) /*@=unqualifiedtrans@*/ ; li->files[i] = NULL; } free(li->files); @@ -479,7 +479,7 @@ static int createLinks(struct hardLink * li, /*@out@*/const char ** failedFile) return CPIOERR_LINK_FAILED; } - /*@-unqualifiedtrans@*/ free(li->files[i]) /*@=unqualifiedtrans@*/ ; + /*@-unqualifiedtrans@*/ free((void *)li->files[i]) /*@=unqualifiedtrans@*/ ; li->files[i] = NULL; li->linksLeft--; } diff --git a/lib/falloc.c b/lib/falloc.c index 207d48d60..646eeedd9 100644 --- a/lib/falloc.c +++ b/lib/falloc.c @@ -79,8 +79,9 @@ faFile faOpen(const char * path, int flags, int perms) if (flags & O_WRONLY) return NULL; - fa = fdOpen(path, flags, perms); + fa = ufdOpen(path, flags, perms); if (fdFileno(faFileno(fa)) < 0) + /* XXX Fstrerror */ return NULL; fa->readOnly = (flags & O_RDWR) ? 0 : 1; diff --git a/lib/macro.c b/lib/macro.c index 2e650541e..5980ecd3e 100644 --- a/lib/macro.c +++ b/lib/macro.c @@ -1458,6 +1458,13 @@ rpmGetPath(const char *path, ...) } va_end(ap); expandMacros(NULL, NULL, buf, sizeof(buf)); + + for (s = p = buf; *s; s++, p++) { + while (s[0] == '/' && s[1] == '/') s++; + *p = *s; + } + *p = '\0'; + return xstrdup(buf); } diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 9374142df..f98d1dac5 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -454,9 +454,11 @@ int rpmInstallSource(const char * rootdir, const char * arg, const char ** specF FD_t fd; int rc; - fd = fdOpen(arg, O_RDONLY, 0); + fd = ufdOpen(arg, O_RDONLY, 0); if (fdFileno(fd) < 0) { + /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open %s\n"), arg); + Fclose(fd); return 1; } diff --git a/lib/rpmio.h b/lib/rpmio.h index 2dfc23a82..674d1d959 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -26,6 +26,7 @@ size_t Fread (/*@out@*/ void *buf, size_t size, size_t nmemb, FD_t fd); size_t Fwrite (const void *buf, size_t size, size_t nmemb, FD_t fd); int Fseek (FD_t fd, long int offset, int whence); int Fclose ( /*@only@*/ FD_t fd); +FILE * Fopen (const char *path, const char *fmode); #endif /* H_RPMIO */ @@ -86,6 +87,10 @@ extern cookie_io_functions_t bzdio; #endif /* HAVE_BZLIB_H */ +/*@only@*/ FD_t ufdOpen(const char * pathname, int flags, mode_t mode); +int ufdClose( /*@only@*/ FD_t fd); +/*@observer@*/ const char *urlStrerror(const char *url); + #ifdef __cplusplus } #endif diff --git a/lib/rpmrc.c b/lib/rpmrc.c index bdea7ca12..94872e81e 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -1191,7 +1191,7 @@ void rpmRebuildTargetVars(const char **buildtarget, const char ** canontarget) if (co == NULL) { const char *o; defaultMachine(NULL, &o); - co = (o) ? xstrdup(co) : NULL; + co = (o) ? xstrdup(o) : NULL; } for (x = 0; co[x]; x++) co[x] = tolower(co[x]); diff --git a/lib/rpmurl.h b/lib/rpmurl.h index e8b3fa4b9..75efe729f 100644 --- a/lib/rpmurl.h +++ b/lib/rpmurl.h @@ -67,10 +67,6 @@ int urlSplit(const char *url, /*@out@*/ urlinfo **u); /*@only@*/ urlinfo *newUrlinfo(void); void freeUrlinfo( /*@only@*/ urlinfo *u); -/*@only@*/ FD_t ufdOpen(const char * pathname, int flags, mode_t mode); -int ufdClose( /*@only@*/ FD_t fd); -/*@observer@*/ const char *urlStrerror(const char *url); - int urlGetFile(const char * url, const char * dest); void urlInvalidateCache(const char * url); @@ -15,17 +15,6 @@ /*@access FD_t@*/ -static struct urlstring { - const char *leadin; - urltype ret; -} urlstrings[] = { - { "file://", URL_IS_PATH }, - { "ftp://", URL_IS_FTP }, - { "http://", URL_IS_HTTP }, - { "-", URL_IS_DASH }, - { NULL, URL_IS_UNKNOWN } -}; - void freeUrlinfo(urlinfo *u) { if (u->ftpControl >= 0) @@ -304,123 +293,6 @@ int urlSplit(const char * url, urlinfo **uret) return 0; } -static int urlConnect(const char * url, /*@out@*/urlinfo ** uret) -{ - urlinfo *u; - - if (urlSplit(url, &u) < 0) - return -1; - - if (!strcmp(u->service, "ftp") && u->ftpControl < 0) { - - u->ftpGetFileDoneNeeded = 0; /* XXX PARANOIA */ - rpmMessage(RPMMESS_DEBUG, _("logging into %s as %s, pw %s\n"), - u->host, - u->user ? u->user : "ftp", - u->password ? u->password : "(username)"); - - u->ftpControl = ftpOpen(u); - - if (u->ftpControl < 0) { /* XXX save ftpOpen error */ - u->openError = u->ftpControl; - return u->ftpControl; - } - - } - - if (uret != NULL) - *uret = u; - - return 0; -} - -urltype urlIsURL(const char * url) -{ - struct urlstring *us; - - for (us = urlstrings; us->leadin != NULL; us++) { - if (strncmp(url, us->leadin, strlen(us->leadin))) - continue; - return us->ret; - } - - return URL_IS_UNKNOWN; -} - -#ifdef NOTYET -int urlAbort(FD_t fd) -{ - if (fd != NULL && fd->fd_url) { - urlinfo *u = (urlinfo *)fd->fd_url; - if (u->ftpControl >= 0) - ftpAbort(fd); - } -} -#endif - -int ufdClose(FD_t fd) -{ - if (fd != NULL && fd->fd_url) { - urlinfo *u = (urlinfo *)fd->fd_url; - /* Close the ftp control channel (not strictly necessary, but ... */ - if (u->ftpControl >= 0) { - ftpAbort(fd); - fd = NULL; /* XXX ftpAbort does fdClose(fd) */ - close(u->ftpControl); - u->ftpControl = -1; - } - } - return Fclose(fd); -} - -FD_t ufdOpen(const char *url, int flags, mode_t mode) -{ - FD_t fd = NULL; - urlinfo *u; - - switch (urlIsURL(url)) { - case URL_IS_FTP: - if (urlConnect(url, &u) < 0) - break; - if ((fd = fdNew(&fdio)) == NULL) - break; - fd->fd_url = u; - if ((u->openError = ftpGetFileDesc(fd)) < 0) { - u->ftpControl = -1; - fd = NULL; /* XXX fd already closed */ - } - break; - case URL_IS_HTTP: - if (urlSplit(url, &u)) - break; - if ((fd = fdNew(&fdio)) == NULL) - break; - fd->fd_url = u; - fd->fd_fd = httpOpen(u); - if (fd->fd_fd < 0) /* XXX Save httpOpen error */ - u->openError = fd->fd_fd; - break; - case URL_IS_PATH: - if (urlSplit(url, &u)) - break; - fd = fdOpen(u->path, flags, mode); - break; - case URL_IS_DASH: - fd = fdDup(STDIN_FILENO); - break; - case URL_IS_UNKNOWN: - default: - fd = fdOpen(url, flags, mode); - break; - } - - if (fd == NULL || fdFileno(fd) < 0) { - ufdClose(fd); - return NULL; - } - return fd; -} - int urlGetFile(const char * url, const char * dest) { int rc; FD_t sfd = NULL; @@ -476,21 +348,3 @@ int urlGetFile(const char * url, const char * dest) { return rc; } - -const char *urlStrerror(const char *url) -{ - const char *retstr; - urlinfo *u; - switch (urlIsURL(url)) { -/* XXX This only works for httpOpen/ftpOpen/ftpGetFileDesc failures */ - case URL_IS_FTP: - case URL_IS_HTTP: - retstr = !urlSplit(url, &u) - ? ftpStrerror(u->openError) : "Malformed URL"; - break; - default: - retstr = strerror(errno); - break; - } - return retstr; -} diff --git a/po/rpm.pot b/po/rpm.pot index c09fffeeb..96ad2a8b9 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-10-29 11:30-0400\n" +"POT-Creation-Date: 1999-10-29 18:59-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" @@ -14,110 +14,111 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: build.c:23 lib/rpminstall.c:222 lib/rpminstall.c:382 +#: build.c:25 lib/rpminstall.c:222 lib/rpminstall.c:382 #, c-format msgid "cannot open %s/packages.rpm\n" msgstr "" -#: build.c:33 +#: build.c:35 msgid "failed build dependencies:\n" msgstr "" -#: build.c:61 +#. XXX Fstrerror +#: build.c:64 #, c-format msgid "Unable to open spec file: %s\n" msgstr "" -#: build.c:117 build.c:130 +#: build.c:121 build.c:134 #, c-format msgid "Failed to open tar pipe: %s\n" msgstr "" #. Give up -#: build.c:138 +#: build.c:142 #, c-format msgid "Failed to read spec file from %s\n" msgstr "" -#: build.c:166 +#: build.c:170 #, c-format msgid "Failed to rename %s to %s: %s\n" msgstr "" -#: build.c:200 +#: build.c:208 #, c-format msgid "File is not a regular file: %s\n" msgstr "" -#: build.c:206 +#: build.c:214 #, c-format msgid "File %s does not appear to be a specfile.\n" msgstr "" #. parse up the build operators -#: build.c:257 +#: build.c:271 #, c-format msgid "Building target platforms: %s\n" msgstr "" -#: build.c:266 +#: build.c:286 #, c-format msgid "Building for target %s\n" msgstr "" -#: build.c:312 +#: build.c:336 msgid "buildroot already specified" msgstr "" -#: build.c:319 +#: build.c:343 msgid "--buildarch has been obsoleted. Use the --target option instead.\n" msgstr "" -#: build.c:323 +#: build.c:347 msgid "--buildos has been obsoleted. Use the --target option instead.\n" msgstr "" -#: build.c:344 +#: build.c:368 msgid "override build architecture" msgstr "" -#: build.c:346 +#: build.c:370 msgid "override build operating system" msgstr "" -#: build.c:348 +#: build.c:372 msgid "override build root" msgstr "" -#: build.c:350 rpm.c:457 +#: build.c:374 rpm.c:457 msgid "remove build tree when done" msgstr "" -#: build.c:352 +#: build.c:376 msgid "do not execute any stages of the build" msgstr "" -#: build.c:354 +#: build.c:378 msgid "do not accept I18N msgstr's from specfile" msgstr "" -#: build.c:356 +#: build.c:380 msgid "remove sources when done" msgstr "" -#: build.c:358 +#: build.c:382 msgid "remove specfile when done" msgstr "" -#: build.c:360 rpm.c:455 +#: build.c:384 rpm.c:455 msgid "skip straight to specified stage (only for c,i)" msgstr "" -#: build.c:362 +#: build.c:386 msgid "override target platform" msgstr "" -#: build.c:364 +#: build.c:388 msgid "lookup I18N strings in specfile catalog" msgstr "" @@ -1176,43 +1177,43 @@ msgstr "" msgid "no packages given for signature check" msgstr "" -#: rpm.c:1160 +#: rpm.c:1159 msgid "no packages given for signing" msgstr "" -#: rpm.c:1173 +#: rpm.c:1171 msgid "no packages files given for rebuild" msgstr "" -#: rpm.c:1234 +#: rpm.c:1233 msgid "no spec files given for build" msgstr "" -#: rpm.c:1236 +#: rpm.c:1235 msgid "no tar files given for build" msgstr "" -#: rpm.c:1248 +#: rpm.c:1250 msgid "no packages given for uninstall" msgstr "" -#: rpm.c:1298 +#: rpm.c:1300 msgid "no packages given for install" msgstr "" -#: rpm.c:1321 +#: rpm.c:1323 msgid "extra arguments given for query of all packages" msgstr "" -#: rpm.c:1326 +#: rpm.c:1328 msgid "no arguments given for query" msgstr "" -#: rpm.c:1343 +#: rpm.c:1345 msgid "extra arguments given for verify of all packages" msgstr "" -#: rpm.c:1347 +#: rpm.c:1349 msgid "no arguments given for verify" msgstr "" @@ -1296,157 +1297,157 @@ msgstr "" msgid "syntax error in expression" msgstr "" -#: build/files.c:226 +#: build/files.c:228 #, c-format msgid "TIMECHECK failure: %s\n" msgstr "" -#: build/files.c:270 build/files.c:352 build/files.c:515 +#: build/files.c:272 build/files.c:354 build/files.c:517 #, c-format msgid "Missing '(' in %s %s" msgstr "" -#: build/files.c:281 build/files.c:469 build/files.c:526 +#: build/files.c:283 build/files.c:471 build/files.c:528 #, c-format msgid "Missing ')' in %s(%s" msgstr "" -#: build/files.c:319 build/files.c:494 +#: build/files.c:321 build/files.c:496 #, c-format msgid "Invalid %s token: %s" msgstr "" -#: build/files.c:368 +#: build/files.c:370 #, c-format msgid "Non-white space follows %s(): %s" msgstr "" -#: build/files.c:406 +#: build/files.c:408 #, c-format msgid "Bad syntax: %s(%s)" msgstr "" -#: build/files.c:416 +#: build/files.c:418 #, c-format msgid "Bad mode spec: %s(%s)" msgstr "" -#: build/files.c:428 +#: build/files.c:430 #, c-format msgid "Bad dirmode spec: %s(%s)" msgstr "" -#: build/files.c:552 +#: build/files.c:554 msgid "Unusual locale length: \"%.*s\" in %%lang(%s)" msgstr "" -#: build/files.c:562 +#: build/files.c:564 msgid "Duplicate locale %.*s in %%lang(%s)" msgstr "" -#: build/files.c:657 +#: build/files.c:659 msgid "Hit limit for %%docdir" msgstr "" -#: build/files.c:663 +#: build/files.c:665 msgid "Only one arg for %%docdir" msgstr "" #. We already got a file -- error -#: build/files.c:688 +#: build/files.c:690 #, c-format msgid "Two files on one line: %s" msgstr "" -#: build/files.c:701 +#: build/files.c:703 #, c-format msgid "File must begin with \"/\": %s" msgstr "" -#: build/files.c:713 +#: build/files.c:715 msgid "Can't mix special %%doc with other forms: %s" msgstr "" -#: build/files.c:799 +#: build/files.c:801 #, c-format msgid "File listed twice: %s" msgstr "" -#: build/files.c:957 +#: build/files.c:959 #, c-format msgid "File doesn't match prefix (%s): %s" msgstr "" -#: build/files.c:967 +#: build/files.c:969 #, c-format msgid "File not found: %s" msgstr "" -#: build/files.c:1010 +#: build/files.c:1012 #, c-format msgid "Bad owner/group: %s\n" msgstr "" -#: build/files.c:1024 +#: build/files.c:1026 #, c-format msgid "File %4d: %07o %s.%s\t %s\n" msgstr "" -#: build/files.c:1094 +#: build/files.c:1096 #, c-format msgid "File needs leading \"/\": %s" msgstr "" -#: build/files.c:1138 +#: build/files.c:1140 #, c-format msgid "File not found by glob: %s" msgstr "" -#: build/files.c:1182 +#: build/files.c:1184 msgid "Could not open %%files file: %s" msgstr "" -#: build/files.c:1188 build/pack.c:491 +#: build/files.c:1190 build/pack.c:491 #, c-format msgid "line: %s" msgstr "" -#: build/files.c:1515 build/parsePrep.c:29 +#: build/files.c:1531 build/parsePrep.c:29 #, c-format msgid "Bad owner/group: %s" msgstr "" -#: build/files.c:1569 +#: build/files.c:1585 #, c-format msgid "Couldn't exec %s: %s" msgstr "" -#: build/files.c:1574 +#: build/files.c:1590 #, c-format msgid "Couldn't fork %s: %s" msgstr "" -#: build/files.c:1656 +#: build/files.c:1672 #, c-format msgid "%s failed" msgstr "" -#: build/files.c:1660 +#: build/files.c:1676 #, c-format msgid "failed to write all data to %s" msgstr "" -#: build/files.c:1749 +#: build/files.c:1765 #, c-format msgid "Finding %s: (using %s)...\n" msgstr "" -#: build/files.c:1777 build/files.c:1786 +#: build/files.c:1793 build/files.c:1802 #, c-format msgid "Failed to find %s:" msgstr "" -#: build/files.c:1892 +#: build/files.c:1908 #, c-format msgid "Processing files: %s-%s-%s\n" msgstr "" @@ -1654,88 +1655,88 @@ msgstr "" msgid "%s field must be present in package: %s" msgstr "" -#: build/parsePreamble.c:194 +#: build/parsePreamble.c:195 #, c-format msgid "Duplicate %s entries in package: %s" msgstr "" -#: build/parsePreamble.c:239 +#: build/parsePreamble.c:240 #, c-format msgid "Unable to stat icon: %s" msgstr "" -#: build/parsePreamble.c:250 +#: build/parsePreamble.c:253 #, c-format msgid "Unable to read icon: %s" msgstr "" -#: build/parsePreamble.c:260 +#: build/parsePreamble.c:263 #, c-format msgid "Unknown icon type: %s" msgstr "" -#: build/parsePreamble.c:324 +#: build/parsePreamble.c:327 #, c-format msgid "line %d: Malformed tag: %s" msgstr "" #. Empty field -#: build/parsePreamble.c:332 +#: build/parsePreamble.c:335 #, c-format msgid "line %d: Empty tag: %s" msgstr "" -#: build/parsePreamble.c:355 build/parsePreamble.c:362 +#: build/parsePreamble.c:358 build/parsePreamble.c:365 #, c-format msgid "line %d: Illegal char '-' in %s: %s" msgstr "" -#: build/parsePreamble.c:400 +#: build/parsePreamble.c:403 #, c-format msgid "line %d: BuildRoot can not be \"/\": %s" msgstr "" -#: build/parsePreamble.c:413 +#: build/parsePreamble.c:416 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s" msgstr "" -#: build/parsePreamble.c:425 +#: build/parsePreamble.c:428 #, c-format msgid "line %d: Docdir must begin with '/': %s" msgstr "" -#: build/parsePreamble.c:437 +#: build/parsePreamble.c:440 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s" msgstr "" -#: build/parsePreamble.c:500 +#: build/parsePreamble.c:503 #, c-format msgid "line %d: Bad BuildArchitecture format: %s" msgstr "" -#: build/parsePreamble.c:510 +#: build/parsePreamble.c:513 #, c-format msgid "Internal error: Bogus tag %d" msgstr "" -#: build/parsePreamble.c:656 +#: build/parsePreamble.c:659 #, c-format msgid "Bad package specification: %s" msgstr "" -#: build/parsePreamble.c:662 +#: build/parsePreamble.c:665 #, c-format msgid "Package already exists: %s" msgstr "" -#: build/parsePreamble.c:689 +#: build/parsePreamble.c:692 #, c-format msgid "line %d: Unknown tag: %s" msgstr "" -#: build/parsePreamble.c:714 +#: build/parsePreamble.c:717 msgid "Spec file can't use BuildRoot" msgstr "" @@ -1850,44 +1851,45 @@ msgstr "" msgid "line %d: %s" msgstr "" -#: build/parseSpec.c:173 +#. XXX Fstrerror +#: build/parseSpec.c:174 #, c-format msgid "Unable to open: %s\n" msgstr "" -#: build/parseSpec.c:185 +#: build/parseSpec.c:186 msgid "Unclosed %%if" msgstr "" -#: build/parseSpec.c:244 +#: build/parseSpec.c:245 #, c-format msgid "%s:%d: parseExpressionBoolean returns %d" msgstr "" #. Got an else with no %if ! -#: build/parseSpec.c:252 +#: build/parseSpec.c:253 msgid "%s:%d: Got a %%else with no if" msgstr "" #. Got an end with no %if ! -#: build/parseSpec.c:263 +#: build/parseSpec.c:264 msgid "%s:%d: Got a %%endif with no if" msgstr "" -#: build/parseSpec.c:277 build/parseSpec.c:286 +#: build/parseSpec.c:278 build/parseSpec.c:287 msgid "malformed %%include statement" msgstr "" -#: build/parseSpec.c:367 +#: build/parseSpec.c:368 #, c-format msgid "Timecheck value must be an integer: %s" msgstr "" -#: build/parseSpec.c:450 +#: build/parseSpec.c:451 msgid "No buildable architectures" msgstr "" -#: build/parseSpec.c:497 +#: build/parseSpec.c:498 msgid "Package has no %%description: %s" msgstr "" @@ -2063,7 +2065,7 @@ msgstr "" msgid "loop in prerequisite chain: %s" msgstr "" -#: lib/falloc.c:157 +#: lib/falloc.c:158 #, c-format msgid "" "free list corrupt (%u)- please run\n" @@ -2083,7 +2085,7 @@ msgstr "" msgid "mntctl() failed to return fugger size: %s" msgstr "" -#: lib/fs.c:91 lib/fs.c:260 +#: lib/fs.c:91 lib/fs.c:261 #, c-format msgid "failed to stat %s: %s" msgstr "" @@ -2097,7 +2099,7 @@ msgstr "" msgid "failed to open %s: %s" msgstr "" -#: lib/fs.c:282 +#: lib/fs.c:283 #, c-format msgid "file %s is on an unknown device" msgstr "" @@ -2871,7 +2873,7 @@ msgstr "" msgid "opening database mode 0x%x in %s\n" msgstr "" -#: lib/rpmdb.c:186 lib/url.c:431 +#: lib/rpmdb.c:186 lib/url.c:303 #, c-format msgid "failed to open %s\n" msgstr "" @@ -3006,7 +3008,7 @@ msgstr "" msgid "cannot open file %s\n" msgstr "" -#: lib/rpminstall.c:207 lib/rpminstall.c:469 +#: lib/rpminstall.c:207 lib/rpminstall.c:471 #, c-format msgid "%s cannot be installed\n" msgstr "" @@ -3053,16 +3055,23 @@ msgstr "" msgid "removing these packages would break dependencies:\n" msgstr "" -#: lib/rpminstall.c:459 +#. XXX Fstrerror +#: lib/rpminstall.c:460 #, c-format msgid "cannot open %s\n" msgstr "" -#: lib/rpminstall.c:464 +#: lib/rpminstall.c:466 #, c-format msgid "Installing %s\n" msgstr "" +#. XXX PARANOIA +#: lib/rpmio.c:163 +#, c-format +msgid "logging into %s as %s, pw %s\n" +msgstr "" + #: lib/rpmlead.c:48 #, c-format msgid "read failed: %s (%d)" @@ -3356,27 +3365,21 @@ msgstr "" msgid "execution of script failed" msgstr "" -#: lib/url.c:144 +#: lib/url.c:133 #, c-format msgid "Password for %s@%s: " msgstr "" -#: lib/url.c:168 lib/url.c:194 +#: lib/url.c:157 lib/url.c:183 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: lib/url.c:279 +#: lib/url.c:268 msgid "url port must be a number\n" msgstr "" -#. XXX PARANOIA -#: lib/url.c:317 -#, c-format -msgid "logging into %s as %s, pw %s\n" -msgstr "" - -#: lib/url.c:446 +#: lib/url.c:318 #, c-format msgid "failed to create %s\n" msgstr "" @@ -1152,8 +1152,7 @@ int main(int argc, const char ** argv) ec = rpmCheckSig(checksigFlags, (const char **)poptGetArgs(optCon)); /* XXX don't overflow single byte exit status */ if (ec > 255) ec = 255; - exit(ec); - /*@notreached@*/ break; + break; case MODE_RESIGN: if (!poptPeekArg(optCon)) @@ -1161,8 +1160,7 @@ int main(int argc, const char ** argv) ec = rpmReSign(addSign, passPhrase, (const char **)poptGetArgs(optCon)); /* XXX don't overflow single byte exit status */ if (ec > 255) ec = 255; - exit(ec); - /*@notreached@*/ break; + break; case MODE_REBUILD: case MODE_RECOMPILE: @@ -1182,12 +1180,13 @@ int main(int argc, const char ** argv) } while ((pkg = poptGetArg(optCon))) { - if (rpmInstallSource("/", pkg, &specFile, &cookie)) - exit(EXIT_FAILURE); + ec = rpmInstallSource("", pkg, &specFile, &cookie); + if (ec) + break; - if (build(specFile, &buildArgs, passPhrase, 0, cookie, rcfile, force, noDeps)) { - exit(EXIT_FAILURE); - } + ec = build(specFile, &buildArgs, passPhrase, 0, cookie, rcfile, force, noDeps); + if (ec) + break; free(cookie); xfree(specFile); } @@ -1236,11 +1235,14 @@ int main(int argc, const char ** argv) argerror(_("no tar files given for build")); } - while ((pkg = poptGetArg(optCon))) - if (build(pkg, &buildArgs, passPhrase, bigMode == MODE_TARBUILD, - NULL, rcfile, force, noDeps)) { - exit(EXIT_FAILURE); - } + while ((pkg = poptGetArg(optCon))) { + ec = build(pkg, &buildArgs, passPhrase, bigMode == MODE_TARBUILD, + NULL, rcfile, force, noDeps); + if (ec) + break; + freeMacros(NULL); /* XXX macros from CLI are destroyed too */ + rpmReadConfigFiles(rcfile, NULL); + } break; case MODE_UNINSTALL: @@ -1325,7 +1327,7 @@ int main(int argc, const char ** argv) if (!poptPeekArg(optCon)) argerror(_("no arguments given for query")); while ((pkg = poptGetArg(optCon))) - ec = rpmQuery(qva, QVSource, pkg); + ec += rpmQuery(qva, QVSource, pkg); } break; @@ -1346,7 +1348,7 @@ int main(int argc, const char ** argv) if (!poptPeekArg(optCon)) argerror(_("no arguments given for verify")); while ((pkg = poptGetArg(optCon))) - ec = rpmVerify(qva, QVSource, pkg); + ec += rpmVerify(qva, QVSource, pkg); } break; } diff --git a/rpm2cpio.c b/rpm2cpio.c index 09e86681a..be6116584 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -17,7 +17,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = fdOpen(argv[1], O_RDONLY, 0644); + fdi = ufdOpen(argv[1], O_RDONLY, 0644); } if (fdFileno(fdi) < 0) { diff --git a/rpmio/macro.c b/rpmio/macro.c index 2e650541e..5980ecd3e 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1458,6 +1458,13 @@ rpmGetPath(const char *path, ...) } va_end(ap); expandMacros(NULL, NULL, buf, sizeof(buf)); + + for (s = p = buf; *s; s++, p++) { + while (s[0] == '/' && s[1] == '/') s++; + *p = *s; + } + *p = '\0'; + return xstrdup(buf); } |