diff options
author | jbj <devnull@localhost> | 1999-03-20 21:09:47 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-03-20 21:09:47 +0000 |
commit | bc76393a1701faba6defb20ce0b81002ce129a7f (patch) | |
tree | c8f6321c9b87a2ad833bf4a91e31d04489581592 | |
parent | 801b0c9b4b3aa050b0bd0b2863feccd8a0918a02 (diff) | |
download | rpm-bc76393a1701faba6defb20ce0b81002ce129a7f.tar.gz rpm-bc76393a1701faba6defb20ce0b81002ce129a7f.tar.bz2 rpm-bc76393a1701faba6defb20ce0b81002ce129a7f.zip |
eliminate old rpmrc configuration syntax.
CVS patchset: 2905
CVS date: 1999/03/20 21:09:47
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | build/build.c | 3 | ||||
-rw-r--r-- | build/files.c | 12 | ||||
-rw-r--r-- | build/misc.c | 2 | ||||
-rw-r--r-- | build/pack.c | 20 | ||||
-rw-r--r-- | build/parsePreamble.c | 45 | ||||
-rw-r--r-- | build/parsePrep.c | 40 | ||||
-rw-r--r-- | build/parseSpec.c | 20 | ||||
-rw-r--r-- | build/rpmbuild.h | 2 | ||||
-rw-r--r-- | http.c | 220 | ||||
-rw-r--r-- | lib/install.c | 13 | ||||
-rw-r--r-- | lib/query.c | 3 | ||||
-rw-r--r-- | lib/rpmlib.h | 78 | ||||
-rw-r--r-- | lib/rpmrc.c | 126 | ||||
-rw-r--r-- | lib/signature.c | 131 | ||||
-rw-r--r-- | lib/transaction.c | 13 | ||||
-rw-r--r-- | macros.in | 58 | ||||
-rw-r--r-- | po/rpm.pot | 509 | ||||
-rwxr-xr-x | rpm.c | 11 | ||||
-rw-r--r-- | rpmrc.in | 19 | ||||
-rw-r--r-- | tests/macros.in | 62 | ||||
-rw-r--r-- | tests/rpmrc.in | 198 | ||||
-rw-r--r-- | tools/rpmgettext.c | 3 | ||||
-rw-r--r-- | url.c | 70 |
24 files changed, 672 insertions, 987 deletions
@@ -1,4 +1,5 @@ 2.92 -> 2.93 + - eliminate old rpmrc configuration syntax. 2.91 -> 2.92 - update with libtool-2.4f. diff --git a/build/build.c b/build/build.c index bb537f829..998493a3e 100644 --- a/build/build.c +++ b/build/build.c @@ -50,7 +50,6 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) const char *scriptName; int pid; int status; - char *buildShell; char buf[BUFSIZ]; switch (what) { @@ -124,7 +123,7 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) rpmMessage(RPMMESS_NORMAL, _("Executing: %s\n"), name); if (!(pid = fork())) { - buildShell = rpmGetVar(RPMVAR_BUILDSHELL); + const char *buildShell = rpmGetPath("%{_buildshell}", NULL); execl(buildShell, buildShell, "-e", scriptName, scriptName, NULL); rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s)"), scriptName, name); diff --git a/build/files.c b/build/files.c index 8b5d11955..54eb10e6a 100644 --- a/build/files.c +++ b/build/files.c @@ -578,19 +578,17 @@ static int parseForRegexLang(const char *fileName, char **lang) static char buf[BUFSIZ]; int x; regmatch_t matches[2]; - const char *patt; const char *s; if (! initialized) { - initialized = 1; - patt = rpmGetVar(RPMVAR_LANGPATT); - if (! patt) { + const char *patt = rpmExpand("%{_langpatt}", NULL); + if (!(patt && *patt != '%')) return 1; - } - if (regcomp(&compiledPatt, patt, REG_EXTENDED)) { + if (regcomp(&compiledPatt, patt, REG_EXTENDED)) return -1; - } + xfree(patt); hasRegex = 1; + initialized = 1; } if (! hasRegex || regexec(&compiledPatt, fileName, 2, matches, REG_NOTEOL)) diff --git a/build/misc.c b/build/misc.c index 366a80dc0..afb82ade2 100644 --- a/build/misc.c +++ b/build/misc.c @@ -4,7 +4,7 @@ #include "popt/popt.h" -int parseNum(char *line, int *res) +int parseNum(const char *line, int *res) { char *s1; diff --git a/build/pack.c b/build/pack.c index 8bb22d033..8a3a25d99 100644 --- a/build/pack.c +++ b/build/pack.c @@ -106,7 +106,7 @@ int packageBinaries(Spec spec) { CSA_t csabuf, *csa = &csabuf; int rc; - char *binFormat, *binRpm, *errorString; + char *errorString; char *name; Package pkg; @@ -143,18 +143,20 @@ int packageBinaries(Spec spec) headerAddEntry(pkg->header, RPMTAG_SOURCERPM, RPM_STRING_TYPE, spec->sourceRpmName, 1); - binFormat = rpmGetVar(RPMVAR_RPMFILENAME); - binRpm = headerSprintf(pkg->header, binFormat, rpmTagTable, + { const char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); + const char *binRpm; + binRpm = headerSprintf(pkg->header, binFormat, rpmTagTable, rpmHeaderFormats, &errorString); - if (binRpm == NULL) { - headerGetEntry(pkg->header, RPMTAG_NAME, NULL, + if (binRpm == NULL) { + headerGetEntry(pkg->header, RPMTAG_NAME, NULL, (void **)&name, NULL); - rpmError(RPMERR_BADFILENAME, _("Could not generate output " + rpmError(RPMERR_BADFILENAME, _("Could not generate output " "filename for package %s: %s\n"), name, errorString); - return RPMERR_BADFILENAME; + return RPMERR_BADFILENAME; + } + fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); + xfree(binRpm); } - fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); - FREE(binRpm); memset(csa, 0, sizeof(*csa)); csa->cpioArchiveSize = 0; diff --git a/build/parsePreamble.c b/build/parsePreamble.c index a950a720c..28a4472f4 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -236,24 +236,26 @@ static int checkForDuplicates(Header h, char *name) return res; } +static struct optionalTag { + int ot_tag; + const char *ot_mac; +} optionalTags[] = { + { RPMTAG_VENDOR, "%{vendor}" }, + { RPMTAG_PACKAGER, "%{packager}" }, + { RPMTAG_DISTRIBUTION, "%{distribution}" }, + { -1, NULL } +}; + static void fillOutMainPackage(Header h) { - if (!headerIsEntry(h, RPMTAG_VENDOR)) { - if (rpmGetVar(RPMVAR_VENDOR)) { - headerAddEntry(h, RPMTAG_VENDOR, RPM_STRING_TYPE, - rpmGetVar(RPMVAR_VENDOR), 1); - } - } - if (!headerIsEntry(h, RPMTAG_PACKAGER)) { - if (rpmGetVar(RPMVAR_PACKAGER)) { - headerAddEntry(h, RPMTAG_PACKAGER, RPM_STRING_TYPE, - rpmGetVar(RPMVAR_PACKAGER), 1); - } - } - if (!headerIsEntry(h, RPMTAG_DISTRIBUTION)) { - if (rpmGetVar(RPMVAR_DISTRIBUTION)) { - headerAddEntry(h, RPMTAG_DISTRIBUTION, RPM_STRING_TYPE, - rpmGetVar(RPMVAR_DISTRIBUTION), 1); + struct optionalTag *ot; + + for (ot = optionalTags; ot->ot_mac != NULL; ot++) { + if (!headerIsEntry(h, ot->ot_tag)) { + const char *val = rpmExpand(ot->ot_mac, NULL); + if (val && *val != '%') + headerAddEntry(h, ot->ot_tag, RPM_STRING_TYPE, (void *)val, 1); + xfree(val); } } } @@ -416,13 +418,14 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro, break; case RPMTAG_BUILDROOT: SINGLE_TOKEN_ONLY; - if (! spec->buildRoot) { - if (rpmGetVar(RPMVAR_BUILDROOT)) { - spec->buildRoot = rpmGetVar(RPMVAR_BUILDROOT); + if (spec->buildRoot == NULL) { + const char *buildroot = rpmGetPath("%{buildroot}", NULL); + if (buildroot && *buildroot != '%') { + spec->buildRoot = strdup(cleanFileName(buildroot)); } else { - spec->buildRoot = field; + spec->buildRoot = strdup(cleanFileName(field)); } - spec->buildRoot = strdup(cleanFileName(spec->buildRoot)); + xfree(buildroot); } if (!strcmp(spec->buildRoot, "/")) { rpmError(RPMERR_BADSPEC, diff --git a/build/parsePrep.c b/build/parsePrep.c index aae4f8c6c..e11352cc4 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -87,6 +87,9 @@ static char *doPatch(Spec spec, int c, int strip, char *db, } if (compressed) { + const char *zipper = rpmGetPath( + (compressed == COMPRESSED_BZIP2 ? "%{_bzip2bin}" : "%{_gzipbin}"), + NULL); sprintf(buf, "echo \"Patch #%d:\"\n" "%s -d < %s | patch -p%d %s -s\n" @@ -95,9 +98,9 @@ static char *doPatch(Spec spec, int c, int strip, char *db, " exit $STATUS\n" "fi", c, - (compressed == COMPRESSED_BZIP2) ? - rpmGetVar(RPMVAR_BZIP2BIN) : rpmGetVar(RPMVAR_GZIPBIN), + zipper, fn, strip, args); + xfree(zipper); } else { sprintf(buf, "echo \"Patch #%d:\"\n" @@ -137,15 +140,18 @@ static char *doUntar(Spec spec, int c, int quietly) } if (compressed) { + const char *zipper = rpmGetPath( + (compressed == COMPRESSED_BZIP2 ? "%{_bzip2bin}" : "%{_gzipbin}"), + NULL); sprintf(buf, "%s -dc %s | tar %s -\n" "STATUS=$?\n" "if [ $STATUS -ne 0 ]; then\n" " exit $STATUS\n" "fi", - (compressed == COMPRESSED_BZIP2) ? - rpmGetVar(RPMVAR_BZIP2BIN) : rpmGetVar(RPMVAR_GZIPBIN), + zipper, fn, taropts); + xfree(zipper); } else { sprintf(buf, "tar %s %s", taropts, fn); } @@ -281,19 +287,19 @@ static int doSetupMacro(Spec spec, char *line) appendStringBuf(spec->prep, getStringBuf(after)); freeStringBuf(after); - /* clean up permissions etc */ - if (!geteuid()) { - appendLineStringBuf(spec->prep, "chown -R root ."); -#ifdef __LCLINT__ -#define ROOT_GROUP "root" -#endif - appendLineStringBuf(spec->prep, "chgrp -R " ROOT_GROUP " ."); - } - - if (rpmGetVar(RPMVAR_FIXPERMS)) { - appendStringBuf(spec->prep, "chmod -R "); - appendStringBuf(spec->prep, rpmGetVar(RPMVAR_FIXPERMS)); - appendLineStringBuf(spec->prep, " ."); + /* XXX FIXME: owner & group fixes were conditioned on !geteuid() */ + /* Fix the owner, group, and permissions of the setup build tree */ + { static const char *fixmacs[] = { + "%{_fixowner}", "%{_fixgroup}", "%{_fixperms}", NULL + }; + const char **fm; + + for (fm = fixmacs; *fm; fm++) { + const char *fix = rpmExpand(*fm, " .", NULL); + if (fix && *fix != '%') + appendLineStringBuf(spec->prep, fix); + xfree(fix); + } } return 0; diff --git a/build/parseSpec.c b/build/parseSpec.c index 2880c1c42..f29dc8ce4 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -320,15 +320,19 @@ int parseSpec(Spec *specp, const char *specFile, const char *buildRoot, spec->cookie = strdup(cookie); } - if (rpmGetVar(RPMVAR_TIMECHECK)) { - if (parseNum(rpmGetVar(RPMVAR_TIMECHECK), &(spec->timeCheck))) { - rpmError(RPMERR_BADSPEC, _("Timecheck value must be an integer: %s"), - rpmGetVar(RPMVAR_TIMECHECK)); - freeSpec(spec); - return RPMERR_BADSPEC; + { const char *timecheck = rpmExpand("%{_timecheck}", NULL); + if (timecheck && *timecheck != '%') { + if (parseNum(timecheck, &(spec->timeCheck))) { + rpmError(RPMERR_BADSPEC, + _("Timecheck value must be an integer: %s"), timecheck); + xfree(timecheck); + freeSpec(spec); + return RPMERR_BADSPEC; + } + } else { + spec->timeCheck = 0; } - } else { - spec->timeCheck = 0; + xfree(timecheck); } /* All the parse*() functions expect to have a line pre-read */ diff --git a/build/rpmbuild.h b/build/rpmbuild.h index afb396a34..d30713dcb 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -93,7 +93,7 @@ int isPart(char *line); /* from build/misc.h */ -int parseNum(char *line, /*@out@*/int *res); +int parseNum(const char *line, /*@out@*/int *res); char *cleanFileName(const char *name); /* from build/parse.h */ diff --git a/http.c b/http.c deleted file mode 100644 index 7daa61338..000000000 --- a/http.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - * This handles all HTTP transfers. - * - * Written by Alex deVries <puffin@redhat.com> - * - * To do: - * - HTTP proxy authentication - * - non-peek parsing of the header so that querying works - */ - - -#include <netinet/in.h> - -#include "system.h" -#include "build/rpmbuild.h" -#include "url.h" -#include "ftp.h" -#include "http.h" - -int httpProxySetup(const char * url, urlinfo ** uret) -{ - urlinfo *u; - - if (urlSplit(url, &u) < 0) - return -1; - - if (!strcmp(u->service, "http")) { - char *newpath; - char *proxy; - char *proxyport; - - rpmMessage(RPMMESS_DEBUG, _("logging into %s as pw %s\n"), - u->host, - u->user ? u->user : "(none)", - u->password ? u->password : "(none)"); - - if ((proxy = rpmGetVar(RPMVAR_HTTPPROXY)) != NULL) { - if ((newpath = malloc(strlen((*uret)->host)+ - strlen((*uret)->path) + 7 + 6 + 1 )) == NULL) - return HTTPERR_UNKNOWN_ERROR; - - sprintf(newpath,"http://%s:%i%s", - (*uret)->host,(*uret)->port,(*uret)->path); - u->host = strdup(proxy); - free(u->path); /* Get rid of the old one */ - u->path = newpath; - } - - if ((proxyport = rpmGetVar(RPMVAR_HTTPPORT)) != NULL) { - int port; - char *end; - port = strtol(proxyport, &end, 0); - if (*end) { - fprintf(stderr, _("error: httport must be a number\n")); - return HTTPERR_INVALID_PORT; - } - u->port=port; - } - } else { - *uret = NULL; - return HTTPERR_UNSUPPORTED_PROTOCOL; - } - - if (uret != NULL) - *uret = u; - return HTTPERR_OKAY; -} - -int httpOpen(urlinfo *u) -{ - int sock; - FILE * sockfile; - const char *host; - int port; - char *buf; - size_t len; - - if (u == NULL || ((host = u->host) == NULL)) - return HTTPERR_BAD_HOSTNAME; - - if ((port = u->port) < 0) port = 80; - - if ((sock = tcpConnect(host, port)) < 0) - return sock; - - len = strlen(u->path) + sizeof("GET HTTP 1.0\r\n\r\n"); - buf = alloca(len); - sprintf(buf,"GET %s HTTP 1.0\r\n\r\n",u->path); -/* - strcpy(buf, "GET "); - strcat(buf, u->path); - strcat(buf, " HTTP 1.0\r\n"); - strcat(buf,"\r\n"); -*/ - - if(!(sockfile = fdopen(sock,"r+"))) { - return HTTPERR_SERVER_IO_ERROR; - } - - if (write(sock, buf, len) != len) { - close(sock); - return HTTPERR_SERVER_IO_ERROR; - } - - rpmMessage(RPMMESS_DEBUG, _("Buffer: %s\n"), buf); - - return sock; -} - -#define httpTimeoutSecs 15 -#define BUFFER_SIZE 2048 - -int httpSkipHeader(FD_t sfd, char *buf,int * bytesRead, char ** start) { - - int doesContinue = 1; - int dataHere = 0; - char errorCode[4]; - fd_set emptySet, readSet; - char * chptr ; - struct timeval timeout; - int rc = 0; - int bufLength = 0; - unsigned int response; - - errorCode[0] = '\0'; - - - do { - FD_ZERO(&emptySet); - FD_ZERO(&readSet); - FD_SET(sfd->fd_fd, &readSet); - - timeout.tv_sec = httpTimeoutSecs; - timeout.tv_usec = 0; - - rc = select(sfd->fd_fd+1, &readSet, &emptySet, &emptySet, &timeout); - if (rc < 1) { - if (rc==0) - return HTTPERR_SERVER_TIMEOUT; - else - return HTTPERR_SERVER_IO_ERROR; - } else - rc = 0; - - *bytesRead = read(sfd->fd_fd, buf + bufLength, - *bytesRead - bufLength - 1); - - if (*bytesRead == -1) { - return HTTPERR_SERVER_IO_ERROR; - } - - bufLength += (*bytesRead); - - buf[bufLength] = '\0'; - - /* divide the response into lines, checking each one to see if - we are finished or need to continue */ - - *start = chptr =buf; - - if (!dataHere) { - do { - while (*chptr != '\n' && *chptr) chptr++; - - if (*chptr == '\n') { - *chptr = '\0'; - if (*(chptr - 1) == '\r') *(chptr - 1) = '\0'; - - if ((!strncmp(*start,"HTTP",4))) { - char *end; - *start = strchr(*start,' '); - response = strtol (*start,&end,0); - if ((*end != '\0') && (*end != ' ')) { - return HTTPERR_INVALID_SERVER_RESPONSE; - } - doesContinue = 1; - } else { - if (**start == '\0') { - dataHere = 1; - } - } - *start = chptr + 1; - chptr++; - } else { - chptr++; - } - } while (chptr && !dataHere); - } - } while (doesContinue && !rc && !dataHere); - - switch (response) { - case HTTP_OK: - return 0; - default: - return HTTPERR_FILE_UNAVAILABLE; - } -} - -int httpGetFile(FD_t sfd, FD_t tfd) { - - static char buf[BUFFER_SIZE + 1]; - int bytesRead = BUFFER_SIZE, rc = 0; - char * start; - - if ((rc = httpSkipHeader(sfd,buf,&bytesRead,&start)) != HTTPERR_OKAY) - return rc; - - /* Write the buffer out to tfd */ - - if (write (tfd->fd_fd,start,bytesRead-(start-buf))<0) - return HTTPERR_SERVER_IO_ERROR; - do { - bytesRead = read(sfd->fd_fd, buf, - sizeof(buf)-1); - if (write (tfd->fd_fd,buf,bytesRead)<0) - return HTTPERR_SERVER_IO_ERROR; - } while (bytesRead); - return HTTPERR_OKAY; -} - diff --git a/lib/install.c b/lib/install.c index cbb4a105d..9ed8a7f70 100644 --- a/lib/install.c +++ b/lib/install.c @@ -193,13 +193,18 @@ static void trimChangelog(Header h) { int * times; char ** names, ** texts; long numToKeep; - char * buf, * end; + char * end; int count; - buf = rpmGetVar(RPMVAR_INSTCHANGELOG); - if (!buf) return; + { char *buf = rpmExpand("%{_instchangelog}", NULL); + if (!(buf && *buf != '%')) { + xfree(buf); + return; + } + numToKeep = strtol(buf, &end, 10); + xfree(buf); + } - numToKeep = strtol(buf, &end, 10); if (*end) { rpmError(RPMERR_RPMRC, _("instchangelog value in rpmrc should be a " "number, but isn't")); diff --git a/lib/query.c b/lib/query.c index bed550555..25f06742a 100644 --- a/lib/query.c +++ b/lib/query.c @@ -575,7 +575,8 @@ int rpmQuery(const char * prefix, enum rpmQuerySources source, int queryFlags, for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { #if 0 char *binRpm, *errorString; - binRpm = headerSprintf(pkg->header, rpmGetVar(RPMVAR_RPMFILENAME), + binRpm = headerSprintf(pkg->header, + rpmGetPath("%{_rpmfilename}", NULL), rpmTagTable, rpmHeaderFormats, &errorString); if (!(pkg == spec->packages && pkg->next == NULL)) fprintf(stdout, "====== %s\n", binRpm); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 615c91dbc..2e1869a9d 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -185,58 +185,58 @@ extern const struct headerSprintfExtension rpmHeaderFormats[]; /* Stuff for maintaining "variables" like SOURCEDIR, BUILDDIR, etc */ -#define RPMVAR_SOURCEDIR 0 -#define RPMVAR_BUILDDIR 1 +/* #define RPMVAR_SOURCEDIR 0 -- No longer used */ +/* #define RPMVAR_BUILDDIR 1 -- No longer used */ /* #define RPMVAR_DOCDIR 2 -- No longer used */ #define RPMVAR_OPTFLAGS 3 -#define RPMVAR_TOPDIR 4 -#define RPMVAR_SPECDIR 5 -#define RPMVAR_ROOT 6 -#define RPMVAR_RPMDIR 7 -#define RPMVAR_SRPMDIR 8 +/* #define RPMVAR_TOPDIR 4 -- No longer used */ +/* #define RPMVAR_SPECDIR 5 -- No longer used */ +/* #define RPMVAR_ROOT 6 -- No longer used */ +/* #define RPMVAR_RPMDIR 7 -- No longer used */ +/* #define RPMVAR_SRPMDIR 8 -- No longer used */ /* #define RPMVAR_ARCHSENSITIVE 9 -- No longer used */ -#define RPMVAR_REQUIREDISTRIBUTION 10 +/* #define RPMVAR_REQUIREDISTRIBUTION 10 -- No longer used */ /* #define RPMVAR_REQUIREGROUP 11 -- No longer used */ -#define RPMVAR_REQUIREVENDOR 12 -#define RPMVAR_DISTRIBUTION 13 -#define RPMVAR_VENDOR 14 -#define RPMVAR_MESSAGELEVEL 15 -#define RPMVAR_REQUIREICON 16 -#define RPMVAR_TIMECHECK 17 -#define RPMVAR_SIGTYPE 18 -#define RPMVAR_PGP_PATH 19 -#define RPMVAR_PGP_NAME 20 +/* #define RPMVAR_REQUIREVENDOR 12 -- No longer used */ +/* #define RPMVAR_DISTRIBUTION 13 -- No longer used */ +/* #define RPMVAR_VENDOR 14 -- No longer used */ +/* #define RPMVAR_MESSAGELEVEL 15 -- No longer used */ +/* #define RPMVAR_REQUIREICON 16 -- No longer used */ +/* #define RPMVAR_TIMECHECK 17 -- No longer used */ +/* #define RPMVAR_SIGTYPE 18 -- No longer used */ +/* #define RPMVAR_PGP_PATH 19 -- No longer used */ +/* #define RPMVAR_PGP_NAME 20 -- No longer used */ /* #define RPMVAR_PGP_SECRING 21 -- No longer used */ /* #define RPMVAR_PGP_PUBRING 22 -- No longer used */ -#define RPMVAR_EXCLUDEDOCS 23 +/* #define RPMVAR_EXCLUDEDOCS 23 -- No longer used */ /* #define RPMVAR_BUILDARCH 24 -- No longer used */ /* #define RPMVAR_BUILDOS 25 -- No longer used */ -#define RPMVAR_BUILDROOT 26 -#define RPMVAR_DBPATH 27 -#define RPMVAR_PACKAGER 28 +/* #define RPMVAR_BUILDROOT 26 */ +/* #define RPMVAR_DBPATH 27 -- No longer used */ +/* #define RPMVAR_PACKAGER 28 -- No longer used */ #define RPMVAR_FTPPROXY 29 -#define RPMVAR_TMPPATH 30 +/* #define RPMVAR_TMPPATH 30 -- No longer used */ /* #define RPMVAR_CPIOBIN 31 -- No longer used */ #define RPMVAR_FTPPORT 32 -#define RPMVAR_NETSHAREDPATH 33 -#define RPMVAR_DEFAULTDOCDIR 34 -#define RPMVAR_FIXPERMS 35 -#define RPMVAR_GZIPBIN 36 -#define RPMVAR_RPMFILENAME 37 +/* #define RPMVAR_NETSHAREDPATH 33 -- No longer used */ +/* #define RPMVAR_DEFAULTDOCDIR 34 -- No longer used */ +/* #define RPMVAR_FIXPERMS 35 -- No longer used */ +/* #define RPMVAR_GZIPBIN 36 -- No longer used */ +/* #define RPMVAR_RPMFILENAME 37 -- No longer used */ #define RPMVAR_PROVIDES 38 -#define RPMVAR_BUILDSHELL 39 -#define RPMVAR_INSTCHANGELOG 40 -#define RPMVAR_BZIP2BIN 41 -#define RPMVAR_LANGPATT 42 +/* #define RPMVAR_BUILDSHELL 39 -- No longer used */ +/* #define RPMVAR_INSTCHANGELOG 40 -- No longer used */ +/* #define RPMVAR_BZIP2BIN 41 -- No longer used */ +/* #define RPMVAR_LANGPATT 42 -- No longer used */ #define RPMVAR_INCLUDE 43 -/* #define RPMVAR_ARCH 44 -- reserved */ -/* #define RPMVAR_OS 45 -- reserved */ -/* #define RPMVAR_BUILDPLATFORM 46 -- reserved */ -/* #define RPMVAR_BUILDARCH 47 -- reserved */ -/* #define RPMVAR_BUILDOS 48 -- reserved */ +/* #define RPMVAR_ARCH 44 -- No longer used */ +/* #define RPMVAR_OS 45 -- No longer used */ +/* #define RPMVAR_BUILDPLATFORM 46 -- No longer used */ +/* #define RPMVAR_BUILDARCH 47 -- No longer used */ +/* #define RPMVAR_BUILDOS 48 -- No longer used */ #define RPMVAR_MACROFILES 49 -#define RPMVAR_GPG_PATH 51 -#define RPMVAR_GPG_NAME 52 +/* #define RPMVAR_GPG_PATH 51 -- No longer used */ +/* #define RPMVAR_GPG_NAME 52 -- No longer used */ #define RPMVAR_HTTPPROXY 53 #define RPMVAR_HTTPPORT 54 @@ -245,6 +245,8 @@ extern const struct headerSprintfExtension rpmHeaderFormats[]; #define xfree(_p) free((void *)_p) char *rpmExpand(const char *arg, ...); const char *rpmGetPath(const char *path, ...); +int rpmExpandNumeric(const char *arg); + char * rpmGetVar(int var); int rpmGetBooleanVar(int var); void rpmSetVar(int var, const char *val); diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 374929d40..c36f458a1 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -94,47 +94,10 @@ static struct tableType tables[RPM_MACHTABLE_COUNT] = { /* The order of the flags is archSpecific, required, macroize, localize */ static struct rpmOption optionTable[] = { - { "builddir", RPMVAR_BUILDDIR, 0, 0, 1, 2 }, - { "buildroot", RPMVAR_BUILDROOT, 0, 0, 1, 0 }, - { "buildshell", RPMVAR_BUILDSHELL, 0, 0, 1, 0 }, - { "bzip2bin", RPMVAR_BZIP2BIN, 0, 1, 1, 2 }, - { "dbpath", RPMVAR_DBPATH, 0, 1, 1, 2 }, - { "defaultdocdir", RPMVAR_DEFAULTDOCDIR, 0, 0, 1, 1 }, - { "distribution", RPMVAR_DISTRIBUTION, 0, 0, 1, 0 }, - { "excludedocs", RPMVAR_EXCLUDEDOCS, 0, 0, 1, 0 }, - { "fixperms", RPMVAR_FIXPERMS, 0, 1, 1, 2 }, - { "ftpport", RPMVAR_FTPPORT, 0, 0, 1, 0 }, - { "ftpproxy", RPMVAR_FTPPROXY, 0, 0, 1, 0 }, - { "gpg_name", RPMVAR_GPG_NAME, 0, 0, 1, 0 }, - { "gpg_path", RPMVAR_GPG_PATH, 0, 0, 1, 0 }, - { "gzipbin", RPMVAR_GZIPBIN, 0, 1, 1, 2 }, { "include", RPMVAR_INCLUDE, 0, 1, 1, 2 }, - { "instchangelog", RPMVAR_INSTCHANGELOG, 0, 0, 0, 0 }, - { "langpatt", RPMVAR_LANGPATT, 0, 0, 1, 0 }, { "macrofiles", RPMVAR_MACROFILES, 0, 0, 1, 1 }, - { "messagelevel", RPMVAR_MESSAGELEVEL, 0, 0, 1, 0 }, - { "netsharedpath", RPMVAR_NETSHAREDPATH, 0, 0, 1, 0 }, { "optflags", RPMVAR_OPTFLAGS, 1, 0, 1, 0 }, - { "packager", RPMVAR_PACKAGER, 0, 0, 1, 0 }, - { "pgp_name", RPMVAR_PGP_NAME, 0, 0, 1, 0 }, - { "pgp_path", RPMVAR_PGP_PATH, 0, 0, 1, 0 }, { "provides", RPMVAR_PROVIDES, 0, 0, 1, 0 }, - { "require_distribution", RPMVAR_REQUIREDISTRIBUTION, 0, 0, 1, 0 }, - { "require_icon", RPMVAR_REQUIREICON, 0, 0, 1, 0 }, - { "require_vendor", RPMVAR_REQUIREVENDOR, 0, 0, 1, 0 }, - { "rpmdir", RPMVAR_RPMDIR, 0, 0, 1, 1 }, - { "rpmfilename", RPMVAR_RPMFILENAME, 0, 1, 1, 2 }, -#if defined(RPMVAR_SETENV) - { "setenv", RPMVAR_SETENV, 0, 1, 0. 0 }, -#endif - { "signature", RPMVAR_SIGTYPE, 0, 0, 0, 0 }, - { "sourcedir", RPMVAR_SOURCEDIR, 0, 0, 1, 1 }, - { "specdir", RPMVAR_SPECDIR, 0, 0, 1, 1 }, - { "srcrpmdir", RPMVAR_SRPMDIR, 0, 0, 1, 1 }, - { "timecheck", RPMVAR_TIMECHECK, 0, 0, 1, 0 }, - { "tmppath", RPMVAR_TMPPATH, 0, 1, 1, 2 }, - { "topdir", RPMVAR_TOPDIR, 0, 0, 1, 1 }, - { "vendor", RPMVAR_VENDOR, 0, 0, 1, 1 }, }; /*@=fullinitblock@*/ static int optionTableSize = sizeof(optionTable) / sizeof(*optionTable); @@ -480,8 +443,10 @@ int rpmReadConfigFiles(const char * file, const char * target) static void setVarDefault(int var, const char *macroname, const char *val, const char *body) { - if (rpmGetVar(var)) return; - rpmSetVar(var, val); + if (var >= 0) { /* XXX Dying ... */ + if (rpmGetVar(var)) return; + rpmSetVar(var, val); + } if (body == NULL) body = val; addMacro(&globalMacroContext, macroname, NULL, body, RMIL_DEFAULT); @@ -489,21 +454,24 @@ static void setVarDefault(int var, const char *macroname, const char *val, const static void setPathDefault(int var, const char *macroname, const char *subdir) { - const char * topdir; - char * fn; - if (rpmGetVar(var)) return; + if (var >= 0) { /* XXX Dying ... */ + const char * topdir; + char * fn; - topdir = rpmGetVar(RPMVAR_TOPDIR); - if (topdir == NULL) topdir = rpmGetVar(RPMVAR_TMPPATH); + if (rpmGetVar(var)) return; - fn = alloca(strlen(topdir) + strlen(subdir) + 2); - strcpy(fn, topdir); - if (fn[strlen(topdir) - 1] != '/') - strcat(fn, "/"); - strcat(fn, subdir); + topdir = rpmGetPath("%{_topdir}", NULL); - rpmSetVar(var, fn); + fn = alloca(strlen(topdir) + strlen(subdir) + 2); + strcpy(fn, topdir); + if (fn[strlen(topdir) - 1] != '/') + strcat(fn, "/"); + strcat(fn, subdir); + + rpmSetVar(var, fn); + if (topdir) xfree(topdir); + } if (macroname != NULL) { #define _TOPDIRMACRO "%{_topdir}/" @@ -543,24 +511,26 @@ static void setDefaults(void) { setVarDefault(RPMVAR_MACROFILES, "_macrofiles", "/usr/lib/rpm/macros", "%{_usr}/lib/rpm/macros"); - setVarDefault(RPMVAR_TOPDIR, "_topdir", - "/usr/src/redhat", "%{_usr}/src/redhat"); - setVarDefault(RPMVAR_TMPPATH, "_tmppath", - "/var/tmp", "%{_var}/tmp"); - setVarDefault(RPMVAR_DBPATH, "_dbpath", - "/var/lib/rpm", "%{_var}/lib/rpm"); - setVarDefault(RPMVAR_DEFAULTDOCDIR, "_defaultdocdir", - "/usr/doc", "%{_usr}/doc"); + setVarDefault(-1, "_topdir", + "/usr/src/redhat", "%{_usr}/src/redhat"); + setVarDefault(-1, "_tmppath", + "/var/tmp", "%{_var}/tmp"); + setVarDefault(-1, "_dbpath", + "/var/lib/rpm", "%{_var}/lib/rpm"); + setVarDefault(-1, "_defaultdocdir", + "/usr/doc", "%{_usr}/doc"); setVarDefault(RPMVAR_OPTFLAGS, "optflags", "-O2", NULL); - setVarDefault(RPMVAR_SIGTYPE, "sigtype", "none", NULL); - setVarDefault(RPMVAR_BUILDSHELL, "buildshell", "/bin/sh", NULL); + setVarDefault(-1, "sigtype", + "none", NULL); + setVarDefault(-1, "_buildshell", + "/bin/sh", NULL); - setPathDefault(RPMVAR_BUILDDIR, "_builddir", "BUILD"); - setPathDefault(RPMVAR_RPMDIR, "_rpmdir", "RPMS"); - setPathDefault(RPMVAR_SRPMDIR, "_srcrpmdir", "SRPMS"); - setPathDefault(RPMVAR_SOURCEDIR, "_sourcedir", "SOURCES"); - setPathDefault(RPMVAR_SPECDIR, "_specdir", "SPECS"); + setPathDefault(-1, "_builddir", "BUILD"); + setPathDefault(-1, "_rpmdir", "RPMS"); + setPathDefault(-1, "_srcrpmdir", "SRPMS"); + setPathDefault(-1, "_sourcedir", "SOURCES"); + setPathDefault(-1, "_specdir", "SPECS"); } @@ -590,6 +560,32 @@ char * rpmExpand(const char *arg, ...) return strdup(buf); } +int rpmExpandNumeric(const char *arg) +{ + const char *val; + int rc; + + if (arg == NULL) + return 0; + + val = rpmExpand(arg, NULL); + if (!(val && *val != '%')) + rc = 0; + else if (*val == 'Y' || *val == 'y') + rc = 1; + else if (*val == 'N' || *val == 'n') + rc = 0; + else { + char *end; + rc = strtol(val, &end, 0); + if (!(end && *end == '\0')) + rc = 0; + } + xfree(val); + + return rc; +} + /* Return concatenated and expanded path with multiple /'s removed */ const char * rpmGetPath(const char *path, ...) { diff --git a/lib/signature.c b/lib/signature.c index d552e09e0..1a244f8f8 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -38,20 +38,22 @@ static int checkPassPhrase(const char *passPhrase, const int sigType); int rpmLookupSignatureType(void) { - char *name; + const char *name = rpmExpand("%{_signature}", NULL); + int rc; - if (! (name = rpmGetVar(RPMVAR_SIGTYPE))) { - return 0; - } - - if (!strcasecmp(name, "none")) - return 0; + if (!(name && *name != '%')) + rc = 0; + else if (!strcasecmp(name, "none")) + rc = 0; else if (!strcasecmp(name, "pgp")) - return RPMSIGTAG_PGP; + rc = RPMSIGTAG_PGP; else if (!strcasecmp(name, "gpg")) - return RPMSIGTAG_GPG; + rc = RPMSIGTAG_GPG; else - return -1; + rc = -1; + + xfree(name); + return rc; } /* rpmReadSignature() emulates the new style signatures if it finds an */ @@ -189,27 +191,28 @@ int rpmAddSignature(Header header, const char *file, int_32 sigTag, const char * static int makePGPSignature(const char *file, void **sig, int_32 *size, const char *passPhrase) { - char name[1024]; char sigfile[1024]; int pid, status; int inpipe[2]; FILE *fpipe; struct stat statbuf; - sprintf(name, "+myname=\"%s\"", rpmGetVar(RPMVAR_PGP_NAME)); - sprintf(sigfile, "%s.sig", file); pipe(inpipe); if (!(pid = fork())) { + const char *pgp_path = rpmExpand("%{_pgp_path}", NULL); + const char *name = rpmExpand("+myname=\"%{_pgp_name}\"", NULL); + close(STDIN_FILENO); dup2(inpipe[0], 3); close(inpipe[1]); + dosetenv("PGPPASSFD", "3", 1); - if (rpmGetVar(RPMVAR_PGP_PATH)) { - dosetenv("PGPPATH", rpmGetVar(RPMVAR_PGP_PATH), 1); - } + if (pgp_path && *pgp_path != '%') + dosetenv("PGPPATH", pgp_path, 1); + /* dosetenv("PGPPASS", passPhrase, 1); */ execlp("pgp", "pgp", "+batchmode=on", "+verbose=0", "+armor=off", @@ -267,26 +270,26 @@ static int makePGPSignature(const char *file, void **sig, int_32 *size, static int makeGPGSignature(const char *file, void **sig, int_32 *size, const char *passPhrase) { - char name[1024]; char sigfile[1024]; int pid, status; int inpipe[2]; FILE *fpipe; struct stat statbuf; - sprintf(name, "%s", rpmGetVar(RPMVAR_GPG_NAME)); - sprintf(sigfile, "%s.sig", file); pipe(inpipe); if (!(pid = fork())) { + const char *gpg_path = rpmExpand("%{_gpg_path}", NULL); + const char *name = rpmExpand("%{_gpg_name}", NULL); + close(STDIN_FILENO); dup2(inpipe[0], 3); close(inpipe[1]); - if (rpmGetVar(RPMVAR_GPG_PATH)) { - dosetenv("GNUPGHOME", rpmGetVar(RPMVAR_GPG_PATH), 1); - } + + if (gpg_path && *gpg_path != '%') + dosetenv("GNUPGHOME", gpg_path, 1); execlp("gpg", "gpg", "--batch", "--no-verbose", "--no-armor", "--passphrase-fd", "3", "-u", name, "-sbo", sigfile, file, @@ -450,7 +453,10 @@ static int verifyPGPSignature(const char *datafile, void *sig, int res = RPMSIG_OK; /* Write out the signature */ - sigfile = tempnam(rpmGetVar(RPMVAR_TMPPATH), "rpmsig"); + { const char *tmppath = rpmGetPath("%{_tmppath}", NULL); + sigfile = tempnam(tmppath, "rpmsig"); + xfree(tmppath); + } sfd = fdOpen(sigfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); (void)fdWrite(sfd, sig, count); fdClose(sfd); @@ -459,12 +465,14 @@ static int verifyPGPSignature(const char *datafile, void *sig, pipe(outpipe); if (!(pid = fork())) { + const char *pgp_path = rpmExpand("%{_pgp_path}", NULL); + close(outpipe[0]); close(STDOUT_FILENO); /* XXX unnecessary */ dup2(outpipe[1], STDOUT_FILENO); - if (rpmGetVar(RPMVAR_PGP_PATH)) { - dosetenv("PGPPATH", rpmGetVar(RPMVAR_PGP_PATH), 1); - } + + if (pgp_path && *pgp_path != '%') + dosetenv("PGPPATH", pgp_path, 1); execlp("pgp", "pgp", "+batchmode=on", "+verbose=0", sigfile, datafile, @@ -510,7 +518,10 @@ static int verifyGPGSignature(const char *datafile, void *sig, int res = RPMSIG_OK; /* Write out the signature */ - sigfile = tempnam(rpmGetVar(RPMVAR_TMPPATH), "rpmsig"); + { const char *tmppath = rpmGetPath("%{_tmppath}", NULL); + sigfile = tempnam(tmppath, "rpmsig"); + xfree(tmppath); + } sfd = fdOpen(sigfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); (void)fdWrite(sfd, sig, count); fdClose(sfd); @@ -519,13 +530,16 @@ static int verifyGPGSignature(const char *datafile, void *sig, pipe(outpipe); if (!(pid = fork())) { + const char *gpg_path = rpmExpand("%{_gpg_path}", NULL); + close(outpipe[0]); /* gpg version 0.9 sends its output to stderr. */ close(STDERR_FILENO); /* XXX unnecessary */ dup2(outpipe[1], STDERR_FILENO); - if (rpmGetVar(RPMVAR_GPG_PATH)) { - dosetenv("GNUPGHOME", rpmGetVar(RPMVAR_GPG_PATH), 1); - } + + if (gpg_path && *gpg_path != '%') + dosetenv("GNUPGHOME", gpg_path, 1); + execlp("gpg", "gpg", "--batch", "--no-verbose", "--verify", sigfile, datafile, @@ -559,19 +573,28 @@ static int verifyGPGSignature(const char *datafile, void *sig, char *rpmGetPassPhrase(const char *prompt, const int sigTag) { char *pass; + int aok; switch (sigTag) { case RPMSIGTAG_GPG: - if (! rpmGetVar(RPMVAR_GPG_NAME)) { + { const char *name = rpmExpand("%{_gpg_name}", NULL); + aok = (name && *name != '%'); + xfree(name); + } + if (!aok) { rpmError(RPMERR_SIGGEN, - _("You must set \"gpg_name:\" in your rpmrc file")); + _("You must set \"%%_gpg_name\" in your macro file")); return NULL; } break; case RPMSIGTAG_PGP: - if (! rpmGetVar(RPMVAR_PGP_NAME)) { + { const char *name = rpmExpand("%{_pgp_name}", NULL); + aok = (name && *name != '%'); + xfree(name); + } + if (!aok) { rpmError(RPMERR_SIGGEN, - _("You must set \"pgp_name:\" in your rpmrc file")); + _("You must set \"%%_pgp_name\" in your macro file")); return NULL; } break; @@ -599,7 +622,6 @@ char *rpmGetPassPhrase(const char *prompt, const int sigTag) static int checkPassPhrase(const char *passPhrase, const int sigType) { - char name[1024]; int passPhrasePipe[2]; FILE *fpipe; int pid, status; @@ -620,38 +642,37 @@ static int checkPassPhrase(const char *passPhrase, const int sigType) } dup2(passPhrasePipe[0], 3); - switch (sigType) { - case RPMSIGTAG_GPG: - sprintf(name, "%s", rpmGetVar(RPMVAR_GPG_NAME)); - if (rpmGetVar(RPMVAR_GPG_PATH)) { - dosetenv("GNUPGHOME", rpmGetVar(RPMVAR_GPG_PATH), 1); - } + switch (sigType) { + case RPMSIGTAG_GPG: + { const char *gpg_path = rpmExpand("%{_gpg_path}", NULL); + const char *name = rpmExpand("%{_gpg_name}", NULL); + if (gpg_path && *gpg_path != '%') + dosetenv("GNUPGHOME", gpg_path, 1); execlp("gpg", "gpg", "--batch", "--no-verbose", "--passphrase-fd", "3", "-u", name, "-so", "-", NULL); rpmError(RPMERR_EXEC, _("Couldn't exec gpg")); _exit(RPMERR_EXEC); - break; - case RPMSIGTAG_PGP: - sprintf(name, "+myname=\"%s\"", rpmGetVar(RPMVAR_PGP_NAME)); - dosetenv("PGPPASSFD", "3", 1); - if (rpmGetVar(RPMVAR_PGP_PATH)) { - dosetenv("PGPPATH", rpmGetVar(RPMVAR_PGP_PATH), 1); - } + } break; + case RPMSIGTAG_PGP: + { const char *pgp_path = rpmExpand("%{_pgp_path}", NULL); + const char *name = rpmExpand("+myname=\"%{_pgp_name}\"", NULL); + dosetenv("PGPPASSFD", "3", 1); + if (pgp_path && *pgp_path != '%') + dosetenv("PGPPATH", pgp_path, 1); execlp("pgp", "pgp", "+batchmode=on", "+verbose=0", name, "-sf", NULL); rpmError(RPMERR_EXEC, _("Couldn't exec pgp")); _exit(RPMERR_EXEC); - break; - default: - /* This case should have been screened out long ago. */ - rpmError(RPMERR_SIGGEN, - _("Invalid signature spec in rc file")); - _exit(RPMERR_SIGGEN); - } + } break; + default: /* This case should have been screened out long ago. */ + rpmError(RPMERR_SIGGEN, _("Invalid signature spec in rc file")); + _exit(RPMERR_SIGGEN); + break; + } } fpipe = fdopen(passPhrasePipe[1], "w"); diff --git a/lib/transaction.c b/lib/transaction.c index a0ae8c58b..e9b7a304c 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -634,7 +634,7 @@ static Header relocateFileList(struct availablePackage * alp, char ** validRelocations, ** actualRelocations; char ** names; char ** origNames; - int len; + int len = 0; char * newName; int_32 fileCount; Header h; @@ -1199,13 +1199,16 @@ static void skipFiles(struct fileInfo * fi, int noDocs) { char ** fileLangs, ** languages, ** lang; char * oneLang[2] = { NULL, NULL }; int freeLanguages = 0; - char * tmpPath, * chptr; + char * chptr; if (!noDocs) - noDocs = rpmGetBooleanVar(RPMVAR_EXCLUDEDOCS); + noDocs = rpmExpandNumeric("%{_excludedocs}"); - if ((tmpPath = rpmGetVar(RPMVAR_NETSHAREDPATH))) - netsharedPaths = splitString(tmpPath, strlen(tmpPath), ':'); + { const char *tmpPath = rpmExpand("%{_netsharedpath}", NULL); + if (tmpPath && *tmpPath != '%') + netsharedPaths = splitString(tmpPath, strlen(tmpPath), ':'); + xfree(tmpPath); + } if (!headerGetEntry(fi->h, RPMTAG_FILELANGS, NULL, (void **) &fileLangs, NULL)) @@ -1,9 +1,12 @@ -# $Id: macros.in,v 1.15 1999/03/14 00:34:58 jbj Exp $ +# $Id: macros.in,v 1.16 1999/03/20 21:09:50 jbj Exp $ #============================================================================== # Macro naming conventions (preliminary): # # Macros that begin with an underscore are "local" in the sense that -# they (if used) will not be exported in rpm headers. +# they (if used) will not be exported in rpm headers. Some macros +# that don't start with an underscore (but look like they should) +# are compatible with macros generated by rpm-2.5.x and will be made +# more consistent in a future release. # #============================================================================== @@ -33,24 +36,57 @@ %__tar %(which tar) #============================================================================== -# ---- rpmrc macros. -# Macros that are initialized as a side effect of rpmrc parsing. -# These are the default values that will be overridden by any -# explicit values found in /usr/lib/rpm/rpmrc or /etc/rpmrc. +# ---- Required rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager) macro files. # %_builddir %{_topdir}/BUILD +%_buildshell /bin/sh %_bzip2bin @BZIP2BIN@ %_dbpath %{_var}/lib/rpm -%_defaultdocdir /usr/doc -%_fixperms @FIXPERMS@ +%_defaultdocdir %{_usr}/doc +# +# XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup +#%_fixowner chown -R root +#%_fixgroup chgrp -R @ROOT_GROUP@ +%_fixperms chmod -R @FIXPERMS@ +# %_gzipbin @GZIPBIN@ +%_instchangelog 5 %_rpmdir %{_topdir}/RPMS -%_rpmfilename %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm +# +# XXX Note escaped %% for use in headerSprintf +%_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +%_signature none %_sourcedir %{_topdir}/SOURCES %_specdir %{_topdir}/SPECS %_srcrpmdir %{_topdir}/SRPMS %_tmppath %{_var}/tmp %_topdir %{_usrsrc}/redhat +# +#============================================================================== +# ---- Optional rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc and/or +# spec file parsing but were not set in the distributed configuration +# /usr/lib/rpm/rpmrc file. +# +#%buildroot +#%distribution +#%_excludedocs +#%_ftpport +#%_ftpproxy +#%_gpg_name +#%_gpg_path +#%_httpport +#%_httpproxy +#%_langpatt +#%_netsharedpath +#%packager +#%_pgp_name +#%_pgp_path +#%_provides +#%_timecheck #============================================================================== # ---- per-platform macros. @@ -58,9 +94,9 @@ # will be used if the per-platform macro file does not exist.. # %_arch @RPMCANONARCH@ -%_vendor @RPMCANONVENDOR@ +%vendor @RPMCANONVENDOR@ %_os @RPMCANONOS@ -%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os} +%_target_platform %{_target_cpu}-%{vendor}-%{_target_os} # # XXX use the rpmrc instantiated macro for now #%optflags -O2 diff --git a/po/rpm.pot b/po/rpm.pot index be7ab4a65..feb0b0423 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-03-16 15:09-0500\n" +"POT-Creation-Date: 1999-03-20 15:35-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" @@ -46,55 +46,55 @@ msgstr "" msgid "File contains non-printable characters(%c): %s\n" msgstr "" -#: ../build.c:229 +#: ../build.c:233 msgid "buildroot already specified" msgstr "" -#: ../build.c:235 +#: ../build.c:239 msgid "--buildarch has been obsoleted. Use the --target option instead.\n" msgstr "" -#: ../build.c:239 +#: ../build.c:243 msgid "--buildos has been obsoleted. Use the --target option instead.\n" msgstr "" -#: ../build.c:260 +#: ../build.c:264 msgid "override build architecture" msgstr "" -#: ../build.c:262 +#: ../build.c:266 msgid "override build operating system" msgstr "" -#: ../build.c:264 +#: ../build.c:268 msgid "override build root" msgstr "" -#: ../build.c:266 ../rpm.c:447 +#: ../build.c:270 ../rpm.c:447 msgid "remove build tree when done" msgstr "" -#: ../build.c:268 +#: ../build.c:272 msgid "do not execute any stages of the build" msgstr "" -#: ../build.c:270 +#: ../build.c:274 msgid "do not accept I18N msgstr's from specfile" msgstr "" -#: ../build.c:272 +#: ../build.c:276 msgid "remove sources and specfile when done" msgstr "" -#: ../build.c:274 ../rpm.c:445 +#: ../build.c:278 ../rpm.c:445 msgid "skip straight to specified stage (only for c,i)" msgstr "" -#: ../build.c:276 +#: ../build.c:280 msgid "override target platform" msgstr "" -#: ../build.c:278 +#: ../build.c:282 msgid "lookup I18N strings in specfile catalog" msgstr "" @@ -131,7 +131,7 @@ msgstr "" msgid "Couldn't write header/archive to temp file" msgstr "" -#: ../build/pack.c:347 ../checksig.c:91 +#: ../build/pack.c:349 ../checksig.c:91 #, c-format msgid "Generating signature: %d\n" msgstr "" @@ -204,55 +204,55 @@ msgstr "" msgid "rpmconvert 1.0 - converting database in /var/lib/rpm\n" msgstr "" -#: ../ftp.c:644 +#: ../ftp.c:640 msgid "Success" msgstr "" -#: ../ftp.c:647 +#: ../ftp.c:643 msgid "Bad server response" msgstr "" -#: ../ftp.c:650 +#: ../ftp.c:646 msgid "Server IO error" msgstr "" -#: ../ftp.c:653 +#: ../ftp.c:649 msgid "Server timeout" msgstr "" -#: ../ftp.c:656 +#: ../ftp.c:652 msgid "Unable to lookup server host address" msgstr "" -#: ../ftp.c:659 +#: ../ftp.c:655 msgid "Unable to lookup server host name" msgstr "" -#: ../ftp.c:662 +#: ../ftp.c:658 msgid "Failed to connect to server" msgstr "" -#: ../ftp.c:665 +#: ../ftp.c:661 msgid "Failed to establish data connection to server" msgstr "" -#: ../ftp.c:668 +#: ../ftp.c:664 msgid "IO error to local file" msgstr "" -#: ../ftp.c:671 +#: ../ftp.c:667 msgid "Error setting remote server to passive mode" msgstr "" -#: ../ftp.c:674 +#: ../ftp.c:670 msgid "File not found on server" msgstr "" -#: ../ftp.c:677 +#: ../ftp.c:673 msgid "Abort in progress" msgstr "" -#: ../ftp.c:681 +#: ../ftp.c:677 msgid "Unknown or unexpected error" msgstr "" @@ -322,7 +322,7 @@ msgstr "" msgid "installing binary packages\n" msgstr "" -#: ../install.c:352 ../lib/query.c:684 ../verify.c:243 +#: ../install.c:352 ../lib/query.c:685 ../verify.c:243 #, c-format msgid "package %s is not installed\n" msgstr "" @@ -1128,8 +1128,8 @@ msgstr "" #: ../rpm.c:617 ../rpm.c:623 ../rpm.c:630 ../rpm.c:636 ../rpm.c:645 #: ../rpm.c:652 ../rpm.c:699 ../rpm.c:705 ../rpm.c:769 ../rpm.c:777 -#: ../rpm.c:784 ../rpm.c:793 ../rpm.c:800 ../rpm.c:808 ../rpm.c:835 -#: ../rpm.c:887 ../rpm.c:894 +#: ../rpm.c:784 ../rpm.c:793 ../rpm.c:800 ../rpm.c:808 ../rpm.c:833 +#: ../rpm.c:885 ../rpm.c:892 msgid "only one major mode may be specified" msgstr "" @@ -1150,7 +1150,7 @@ msgid "--tarbuild (-t) requires one of a,b,i,c,p,l as its sole argument" msgstr "" #: ../rpm.c:712 ../rpm.c:719 ../rpm.c:727 ../rpm.c:735 ../rpm.c:745 -#: ../rpm.c:753 ../rpm.c:761 ../rpm.c:901 +#: ../rpm.c:753 ../rpm.c:761 ../rpm.c:899 msgid "one type of query/verify may be performed at a time" msgstr "" @@ -1158,259 +1158,259 @@ msgstr "" msgid "arguments to --dbpath must begin with a /" msgstr "" -#: ../rpm.c:841 +#: ../rpm.c:839 msgid "relocations must begin with a /" msgstr "" -#: ../rpm.c:843 +#: ../rpm.c:841 msgid "relocations must contain a =" msgstr "" -#: ../rpm.c:846 +#: ../rpm.c:844 msgid "relocations must have a / following the =" msgstr "" -#: ../rpm.c:855 +#: ../rpm.c:853 msgid "exclude paths must begin with a /" msgstr "" -#: ../rpm.c:864 +#: ../rpm.c:862 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: ../rpm.c:914 +#: ../rpm.c:912 msgid "--dbpath given for operation that does not use a database" msgstr "" -#: ../rpm.c:919 +#: ../rpm.c:917 msgid "--timecheck may only be used during package builds" msgstr "" -#: ../rpm.c:922 ../rpm.c:925 +#: ../rpm.c:920 ../rpm.c:923 msgid "unexpected query specifiers" msgstr "" -#: ../rpm.c:929 +#: ../rpm.c:927 msgid "unexpected query source" msgstr "" -#: ../rpm.c:934 +#: ../rpm.c:932 msgid "only installation, upgrading and rmsource may be forced" msgstr "" -#: ../rpm.c:937 +#: ../rpm.c:935 msgid "files may only be relocated during package installation" msgstr "" -#: ../rpm.c:940 +#: ../rpm.c:938 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: ../rpm.c:943 +#: ../rpm.c:941 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: ../rpm.c:946 +#: ../rpm.c:944 msgid "--prefix may only be used when installing new packages" msgstr "" -#: ../rpm.c:949 +#: ../rpm.c:947 msgid "arguments to --prefix must begin with a /" msgstr "" -#: ../rpm.c:952 +#: ../rpm.c:950 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: ../rpm.c:956 +#: ../rpm.c:954 msgid "--percent may only be specified during package installation" msgstr "" -#: ../rpm.c:960 +#: ../rpm.c:958 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: ../rpm.c:964 +#: ../rpm.c:962 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: ../rpm.c:968 +#: ../rpm.c:966 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: ../rpm.c:972 +#: ../rpm.c:970 msgid "--includedocs may only be specified during package installation" msgstr "" -#: ../rpm.c:976 +#: ../rpm.c:974 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: ../rpm.c:980 +#: ../rpm.c:978 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: ../rpm.c:984 +#: ../rpm.c:982 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: ../rpm.c:988 +#: ../rpm.c:986 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: ../rpm.c:992 +#: ../rpm.c:990 msgid "--allfiles may only be specified during package installation" msgstr "" -#: ../rpm.c:996 +#: ../rpm.c:994 msgid "--justdb may only be specified during package installation and erasure" msgstr "" -#: ../rpm.c:1001 +#: ../rpm.c:999 msgid "" "--noscripts may only be specified during package installation, erasure, and " "verification" msgstr "" -#: ../rpm.c:1005 +#: ../rpm.c:1003 msgid "" "--notriggers may only be specified during package installation, erasure, and " "verification" msgstr "" -#: ../rpm.c:1010 +#: ../rpm.c:1008 msgid "" "--nodeps may only be specified during package installation, erasure, and " "verification" msgstr "" -#: ../rpm.c:1014 +#: ../rpm.c:1012 msgid "--nofiles may only be specified during package verification" msgstr "" -#: ../rpm.c:1019 +#: ../rpm.c:1017 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: ../rpm.c:1024 +#: ../rpm.c:1022 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: ../rpm.c:1029 +#: ../rpm.c:1027 msgid "arguments to --root (-r) must begin with a /" msgstr "" -#: ../rpm.c:1033 +#: ../rpm.c:1031 msgid "--clean may only be used with -b and -t" msgstr "" -#: ../rpm.c:1036 +#: ../rpm.c:1034 msgid "--rmsource may only be used with -b and -t" msgstr "" -#: ../rpm.c:1039 +#: ../rpm.c:1037 msgid "--short-circuit may only be used during package building" msgstr "" -#: ../rpm.c:1043 +#: ../rpm.c:1041 msgid "--short-circuit may only be used with -bc, -bi, -bs, -tc -ti, or -ts" msgstr "" -#: ../rpm.c:1049 +#: ../rpm.c:1047 msgid "--oldpackage may only be used during upgrades" msgstr "" -#: ../rpm.c:1054 +#: ../rpm.c:1052 msgid "" "ftp options can only be used during package queries, installs, and upgrades" msgstr "" -#: ../rpm.c:1060 +#: ../rpm.c:1058 msgid "" "http options can only be used during package queries, installs, and upgrades" msgstr "" -#: ../rpm.c:1064 +#: ../rpm.c:1062 msgid "--nopgp may only be used during signature checking" msgstr "" -#: ../rpm.c:1067 +#: ../rpm.c:1065 msgid "--nogpg may only be used during signature checking" msgstr "" -#: ../rpm.c:1070 +#: ../rpm.c:1068 msgid "" "--nomd5 may only be used during signature checking and package verification" msgstr "" -#: ../rpm.c:1100 +#: ../rpm.c:1094 #, c-format msgid "cannot access file %s\n" msgstr "" -#: ../rpm.c:1114 +#: ../rpm.c:1108 msgid "Pass phrase check failed\n" msgstr "" -#: ../rpm.c:1117 +#: ../rpm.c:1111 msgid "Pass phrase is good.\n" msgstr "" -#: ../rpm.c:1129 +#: ../rpm.c:1123 msgid "--sign may only be used during package building" msgstr "" -#: ../rpm.c:1145 +#: ../rpm.c:1138 msgid "exec failed\n" msgstr "" -#: ../rpm.c:1164 +#: ../rpm.c:1157 msgid "unexpected arguments to --querytags " msgstr "" -#: ../rpm.c:1175 +#: ../rpm.c:1168 msgid "no packages given for signature check" msgstr "" -#: ../rpm.c:1183 +#: ../rpm.c:1176 msgid "no packages given for signing" msgstr "" -#: ../rpm.c:1192 +#: ../rpm.c:1185 msgid "no packages files given for rebuild" msgstr "" -#: ../rpm.c:1249 +#: ../rpm.c:1242 msgid "no spec files given for build" msgstr "" -#: ../rpm.c:1251 +#: ../rpm.c:1244 msgid "no tar files given for build" msgstr "" -#: ../rpm.c:1264 +#: ../rpm.c:1257 msgid "no packages given for uninstall" msgstr "" -#: ../rpm.c:1312 +#: ../rpm.c:1305 msgid "no packages given for install" msgstr "" -#: ../rpm.c:1334 +#: ../rpm.c:1327 msgid "extra arguments given for query of all packages" msgstr "" -#: ../rpm.c:1340 +#: ../rpm.c:1333 msgid "no arguments given for query" msgstr "" -#: ../rpm.c:1358 +#: ../rpm.c:1351 msgid "no arguments given for verify" msgstr "" @@ -1422,31 +1422,31 @@ msgstr "" msgid "error reading header from package\n" msgstr "" -#: ../url.c:138 +#: ../url.c:136 #, c-format msgid "Password for %s@%s: " msgstr "" -#: ../url.c:157 ../url.c:179 +#: ../url.c:160 ../url.c:186 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: ../url.c:261 +#: ../url.c:271 msgid "url port must be a number\n" msgstr "" -#: ../url.c:297 +#: ../url.c:307 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" -#: ../lib/rpmdb.c:168 ../url.c:408 +#: ../lib/rpmdb.c:168 ../url.c:418 #, c-format msgid "failed to open %s\n" msgstr "" -#: ../url.c:423 +#: ../url.c:433 #, c-format msgid "failed to create %s\n" msgstr "" @@ -1470,7 +1470,7 @@ msgstr "" msgid "error: could not read database record\n" msgstr "" -#: ../lib/query.c:594 ../verify.c:179 +#: ../lib/query.c:595 ../verify.c:179 msgid "could not read database record!\n" msgstr "" @@ -1484,36 +1484,36 @@ msgstr "" msgid "%s is not an RPM\n" msgstr "" -#: ../lib/query.c:605 ../verify.c:222 +#: ../lib/query.c:606 ../verify.c:222 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: ../lib/query.c:653 ../verify.c:232 +#: ../lib/query.c:654 ../verify.c:232 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: ../lib/query.c:687 ../verify.c:245 +#: ../lib/query.c:688 ../verify.c:245 #, c-format msgid "error looking for package %s\n" msgstr "" -#: ../build/build.c:86 ../build/pack.c:265 +#: ../build/build.c:85 ../build/pack.c:267 msgid "Unable to open temp file" msgstr "" -#: ../build/build.c:125 +#: ../build/build.c:124 #, c-format msgid "Executing: %s\n" msgstr "" -#: ../build/build.c:129 +#: ../build/build.c:128 #, c-format msgid "Exec of %s failed (%s)" msgstr "" -#: ../build/build.c:139 +#: ../build/build.c:138 #, c-format msgid "Bad exit status from %s (%s)" msgstr "" @@ -1613,122 +1613,122 @@ msgstr "" msgid "Only one entry in %%lang(): %s" msgstr "" -#: ../build/files.c:646 +#: ../build/files.c:644 msgid "Hit limit for %%docdir" msgstr "" -#: ../build/files.c:652 +#: ../build/files.c:650 msgid "Only one arg for %%docdir" msgstr "" #. We already got a file -- error -#: ../build/files.c:677 +#: ../build/files.c:675 #, c-format msgid "Two files on one line: %s" msgstr "" -#: ../build/files.c:690 +#: ../build/files.c:688 #, c-format msgid "File must begin with \"/\": %s" msgstr "" -#: ../build/files.c:702 +#: ../build/files.c:700 msgid "Can't mix special %%doc with other forms: %s" msgstr "" -#: ../build/files.c:790 +#: ../build/files.c:788 #, c-format msgid "File listed twice: %s" msgstr "" -#: ../build/files.c:942 +#: ../build/files.c:940 #, c-format msgid "File doesn't match prefix (%s): %s" msgstr "" -#: ../build/files.c:952 ../build/files.c:1067 +#: ../build/files.c:950 ../build/files.c:1065 #, c-format msgid "File not found: %s" msgstr "" -#: ../build/files.c:995 +#: ../build/files.c:993 #, c-format msgid "Bad owner/group: %s\n" msgstr "" -#: ../build/files.c:1001 +#: ../build/files.c:999 #, c-format msgid "File %4d: 0%o %s.%s\t %s\n" msgstr "" -#: ../build/files.c:1051 +#: ../build/files.c:1049 #, c-format msgid "File needs leading \"/\": %s" msgstr "" -#: ../build/files.c:1108 +#: ../build/files.c:1106 msgid "Could not open %%files file: %s" msgstr "" -#: ../build/files.c:1115 ../build/pack.c:450 +#: ../build/files.c:1113 ../build/pack.c:452 #, c-format msgid "line: %s" msgstr "" -#: ../build/files.c:1383 ../build/parsePrep.c:40 +#: ../build/files.c:1381 ../build/parsePrep.c:40 #, c-format msgid "Bad owner/group: %s" msgstr "" -#: ../build/files.c:1437 +#: ../build/files.c:1435 #, c-format msgid "Couldn't exec %s" msgstr "" -#: ../build/files.c:1441 +#: ../build/files.c:1439 #, c-format msgid "Couldn't fork %s" msgstr "" -#: ../build/files.c:1491 +#: ../build/files.c:1489 #, c-format msgid "%s failed" msgstr "" -#: ../build/files.c:1495 +#: ../build/files.c:1493 #, c-format msgid "failed to write all data to %s" msgstr "" -#: ../build/files.c:1529 +#: ../build/files.c:1527 msgid "Finding provides...\n" msgstr "" -#: ../build/files.c:1536 +#: ../build/files.c:1534 msgid "Failed to find provides" msgstr "" -#: ../build/files.c:1555 +#: ../build/files.c:1553 msgid "Finding requires...\n" msgstr "" -#: ../build/files.c:1562 +#: ../build/files.c:1560 msgid "Failed to find requires" msgstr "" -#: ../build/files.c:1596 +#: ../build/files.c:1594 msgid "Provides:" msgstr "" -#: ../build/files.c:1611 +#: ../build/files.c:1609 msgid "Prereqs:" msgstr "" -#: ../build/files.c:1623 +#: ../build/files.c:1621 msgid "Requires:" msgstr "" -#: ../build/files.c:1647 +#: ../build/files.c:1645 #, c-format msgid "Processing files: %s\n" msgstr "" @@ -1746,96 +1746,96 @@ msgstr "" msgid "Could not canonicalize hostname: %s\n" msgstr "" -#: ../build/pack.c:152 +#: ../build/pack.c:153 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: ../build/pack.c:184 +#: ../build/pack.c:186 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: ../build/pack.c:194 +#: ../build/pack.c:196 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: ../build/pack.c:214 +#: ../build/pack.c:216 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: ../build/pack.c:220 +#: ../build/pack.c:222 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: ../build/pack.c:276 +#: ../build/pack.c:278 msgid "Bad CSA data" msgstr "" -#: ../build/pack.c:299 +#: ../build/pack.c:301 #, c-format msgid "Could not open %s\n" msgstr "" -#: ../build/pack.c:331 ../build/pack.c:374 +#: ../build/pack.c:333 ../build/pack.c:376 #, c-format msgid "Unable to write package: %s" msgstr "" -#: ../build/pack.c:364 +#: ../build/pack.c:366 #, c-format msgid "Unable to read sigtarget: %s" msgstr "" -#: ../build/pack.c:389 +#: ../build/pack.c:391 #, c-format msgid "Wrote: %s\n" msgstr "" -#: ../build/pack.c:404 +#: ../build/pack.c:406 #, c-format msgid "create archive failed on file %s: %s" msgstr "" -#: ../build/pack.c:420 +#: ../build/pack.c:422 #, c-format msgid "cpio_copy write failed: %s" msgstr "" -#: ../build/pack.c:427 +#: ../build/pack.c:429 #, c-format msgid "cpio_copy read failed: %s" msgstr "" -#: ../build/pack.c:506 +#: ../build/pack.c:508 #, c-format msgid "Could not open PreIn file: %s" msgstr "" -#: ../build/pack.c:513 +#: ../build/pack.c:515 #, c-format msgid "Could not open PreUn file: %s" msgstr "" -#: ../build/pack.c:520 +#: ../build/pack.c:522 #, c-format msgid "Could not open PostIn file: %s" msgstr "" -#: ../build/pack.c:527 +#: ../build/pack.c:529 #, c-format msgid "Could not open PostUn file: %s" msgstr "" -#: ../build/pack.c:535 +#: ../build/pack.c:537 #, c-format msgid "Could not open VerifyScript file: %s" msgstr "" -#: ../build/pack.c:551 +#: ../build/pack.c:553 #, c-format msgid "Could not open Trigger script file: %s" msgstr "" @@ -1934,83 +1934,83 @@ msgstr "" msgid "Duplicate %s entries in package: %s" msgstr "" -#: ../build/parsePreamble.c:273 +#: ../build/parsePreamble.c:275 #, c-format msgid "Unable to stat icon: %s" msgstr "" -#: ../build/parsePreamble.c:284 +#: ../build/parsePreamble.c:286 #, c-format msgid "Unable to read icon: %s" msgstr "" -#: ../build/parsePreamble.c:294 +#: ../build/parsePreamble.c:296 #, c-format msgid "Unknown icon type: %s" msgstr "" -#: ../build/parsePreamble.c:357 +#: ../build/parsePreamble.c:359 #, c-format msgid "line %d: Malformed tag: %s" msgstr "" #. Empty field -#: ../build/parsePreamble.c:365 +#: ../build/parsePreamble.c:367 #, c-format msgid "line %d: Empty tag: %s" msgstr "" -#: ../build/parsePreamble.c:388 ../build/parsePreamble.c:395 +#: ../build/parsePreamble.c:390 ../build/parsePreamble.c:397 #, c-format msgid "line %d: Illegal char '-' in %s: %s" msgstr "" -#: ../build/parsePreamble.c:429 +#: ../build/parsePreamble.c:432 #, c-format msgid "line %d: BuildRoot can not be \"/\": %s" msgstr "" -#: ../build/parsePreamble.c:442 +#: ../build/parsePreamble.c:445 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s" msgstr "" -#: ../build/parsePreamble.c:454 +#: ../build/parsePreamble.c:457 #, c-format msgid "line %d: Docdir must begin with '/': %s" msgstr "" -#: ../build/parsePreamble.c:465 +#: ../build/parsePreamble.c:468 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s" msgstr "" -#: ../build/parsePreamble.c:530 +#: ../build/parsePreamble.c:533 #, c-format msgid "line %d: Bad BuildArchitecture format: %s" msgstr "" -#: ../build/parsePreamble.c:540 +#: ../build/parsePreamble.c:543 #, c-format msgid "Internal error: Bogus tag %d" msgstr "" -#: ../build/parsePreamble.c:685 +#: ../build/parsePreamble.c:688 #, c-format msgid "Bad package specification: %s" msgstr "" -#: ../build/parsePreamble.c:691 +#: ../build/parsePreamble.c:694 #, c-format msgid "Package already exists: %s" msgstr "" -#: ../build/parsePreamble.c:718 +#: ../build/parsePreamble.c:721 #, c-format msgid "line %d: Unknown tag: %s" msgstr "" -#: ../build/parsePreamble.c:743 +#: ../build/parsePreamble.c:746 msgid "Spec file can't use BuildRoot" msgstr "" @@ -2024,48 +2024,48 @@ msgstr "" msgid "No patch number %d" msgstr "" -#: ../build/parsePrep.c:125 +#: ../build/parsePrep.c:128 #, c-format msgid "No source number %d" msgstr "" -#: ../build/parsePrep.c:177 +#: ../build/parsePrep.c:183 msgid "Error parsing %%setup: %s" msgstr "" -#: ../build/parsePrep.c:192 +#: ../build/parsePrep.c:198 msgid "line %d: Bad arg to %%setup %c: %s" msgstr "" -#: ../build/parsePrep.c:213 +#: ../build/parsePrep.c:219 msgid "line %d: Bad %%setup option %s: %s" msgstr "" -#: ../build/parsePrep.c:337 +#: ../build/parsePrep.c:343 msgid "line %d: Need arg to %%patch -b: %s" msgstr "" -#: ../build/parsePrep.c:345 +#: ../build/parsePrep.c:351 msgid "line %d: Need arg to %%patch -z: %s" msgstr "" -#: ../build/parsePrep.c:357 +#: ../build/parsePrep.c:363 msgid "line %d: Need arg to %%patch -p: %s" msgstr "" -#: ../build/parsePrep.c:363 +#: ../build/parsePrep.c:369 msgid "line %d: Bad arg to %%patch -p: %s" msgstr "" -#: ../build/parsePrep.c:370 +#: ../build/parsePrep.c:376 msgid "Too many patches!" msgstr "" -#: ../build/parsePrep.c:374 +#: ../build/parsePrep.c:380 msgid "line %d: Bad arg to %%patch: %s" msgstr "" -#: ../build/parsePrep.c:410 +#: ../build/parsePrep.c:416 msgid "line %d: second %%prep" msgstr "" @@ -2147,16 +2147,16 @@ msgstr "" msgid "malformed %%include statement" msgstr "" -#: ../build/parseSpec.c:325 +#: ../build/parseSpec.c:327 #, c-format msgid "Timecheck value must be an integer: %s" msgstr "" -#: ../build/parseSpec.c:406 +#: ../build/parseSpec.c:410 msgid "No buildable architectures" msgstr "" -#: ../build/parseSpec.c:451 +#: ../build/parseSpec.c:455 msgid "Package has no %%description: %s" msgstr "" @@ -2404,77 +2404,77 @@ msgstr "" msgid "group %s does not exist - using root" msgstr "" -#: ../lib/install.c:204 +#: ../lib/install.c:209 msgid "instchangelog value in rpmrc should be a number, but isn't" msgstr "" -#: ../lib/install.c:270 +#: ../lib/install.c:275 #, c-format msgid "package: %s-%s-%s files test = %d\n" msgstr "" -#: ../lib/install.c:328 +#: ../lib/install.c:333 msgid "stopping install as we're running --test\n" msgstr "" -#: ../lib/install.c:333 +#: ../lib/install.c:338 msgid "running preinstall script (if any)\n" msgstr "" -#: ../lib/install.c:363 +#: ../lib/install.c:368 #, c-format msgid "warning: %s created as %s" msgstr "" -#: ../lib/install.c:399 +#: ../lib/install.c:404 #, c-format msgid "warning: %s saved as %s" msgstr "" -#: ../lib/install.c:403 ../lib/install.c:740 ../lib/uninstall.c:337 +#: ../lib/install.c:408 ../lib/install.c:745 ../lib/uninstall.c:337 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" -#: ../lib/install.c:486 +#: ../lib/install.c:491 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:594 +#: ../lib/install.c:599 #, c-format msgid "unpacking of archive failed%s%s: %s" msgstr "" -#: ../lib/install.c:595 +#: ../lib/install.c:600 msgid " on file " msgstr "" -#: ../lib/install.c:634 +#: ../lib/install.c:639 msgid "installing a source package\n" msgstr "" -#: ../lib/install.c:640 ../lib/install.c:646 +#: ../lib/install.c:645 ../lib/install.c:651 #, c-format msgid "cannot write to %s" msgstr "" -#: ../lib/install.c:651 +#: ../lib/install.c:656 #, c-format msgid "sources in: %s\n" msgstr "" -#: ../lib/install.c:652 +#: ../lib/install.c:657 #, c-format msgid "spec file in: %s\n" msgstr "" -#: ../lib/install.c:685 ../lib/install.c:717 +#: ../lib/install.c:690 ../lib/install.c:722 msgid "source package contains no .spec file" msgstr "" -#: ../lib/install.c:738 +#: ../lib/install.c:743 #, c-format msgid "renaming %s to %s\n" msgstr "" @@ -2729,37 +2729,37 @@ msgstr "" msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: ../lib/query.c:615 +#: ../lib/query.c:616 #, c-format msgid "no package provides %s\n" msgstr "" -#: ../lib/query.c:625 +#: ../lib/query.c:626 #, c-format msgid "no package triggers %s\n" msgstr "" -#: ../lib/query.c:635 +#: ../lib/query.c:636 #, c-format msgid "no package requires %s\n" msgstr "" -#: ../lib/query.c:650 +#: ../lib/query.c:651 #, c-format msgid "file %s: %s\n" msgstr "" -#: ../lib/query.c:666 +#: ../lib/query.c:667 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: ../lib/query.c:669 +#: ../lib/query.c:670 #, c-format msgid "showing package: %d\n" msgstr "" -#: ../lib/query.c:672 +#: ../lib/query.c:673 #, c-format msgid "record %d could not be read\n" msgstr "" @@ -2926,228 +2926,229 @@ msgstr "" msgid "read failed: %s (%d)" msgstr "" -#: ../lib/rpmrc.c:221 +#: ../lib/rpmrc.c:184 #, c-format msgid "missing second ':' at %s:%d" msgstr "" -#: ../lib/rpmrc.c:224 +#: ../lib/rpmrc.c:187 #, c-format msgid "missing architecture name at %s:%d" msgstr "" -#: ../lib/rpmrc.c:372 +#: ../lib/rpmrc.c:335 #, c-format msgid "Incomplete data line at %s:%d" msgstr "" -#: ../lib/rpmrc.c:376 +#: ../lib/rpmrc.c:339 #, c-format msgid "Too many args in data line at %s:%d" msgstr "" -#: ../lib/rpmrc.c:383 +#: ../lib/rpmrc.c:346 #, c-format msgid "Bad arch/os number: %s (%s:%d)" msgstr "" -#: ../lib/rpmrc.c:417 +#: ../lib/rpmrc.c:380 #, c-format msgid "Incomplete default line at %s:%d" msgstr "" -#: ../lib/rpmrc.c:422 +#: ../lib/rpmrc.c:385 #, c-format msgid "Too many args in default line at %s:%d" msgstr "" -#: ../lib/rpmrc.c:655 +#: ../lib/rpmrc.c:651 #, c-format msgid "Cannot expand %s" msgstr "" -#: ../lib/rpmrc.c:670 +#: ../lib/rpmrc.c:666 #, c-format msgid "Unable to open %s for reading: %s." msgstr "" -#: ../lib/rpmrc.c:704 +#: ../lib/rpmrc.c:700 #, c-format msgid "Failed to read %s: %s." msgstr "" -#: ../lib/rpmrc.c:735 +#: ../lib/rpmrc.c:731 #, c-format msgid "missing ':' at %s:%d" msgstr "" -#: ../lib/rpmrc.c:751 ../lib/rpmrc.c:799 +#: ../lib/rpmrc.c:747 ../lib/rpmrc.c:795 #, c-format msgid "missing argument for %s at %s:%d" msgstr "" -#: ../lib/rpmrc.c:765 +#: ../lib/rpmrc.c:761 #, c-format msgid "expansion failed at %s:d \"%s\"" msgstr "" -#: ../lib/rpmrc.c:771 +#: ../lib/rpmrc.c:767 #, c-format msgid "cannot open %s at %s:%d" msgstr "" -#: ../lib/rpmrc.c:789 +#: ../lib/rpmrc.c:785 #, c-format msgid "missing architecture for %s at %s:%d" msgstr "" -#: ../lib/rpmrc.c:856 +#: ../lib/rpmrc.c:852 #, c-format msgid "bad option '%s' at %s:%d" msgstr "" -#: ../lib/rpmrc.c:1210 +#: ../lib/rpmrc.c:1206 #, c-format msgid "Unknown system: %s\n" msgstr "" -#: ../lib/rpmrc.c:1211 +#: ../lib/rpmrc.c:1207 msgid "Please contact rpm-list@redhat.com\n" msgstr "" -#: ../lib/signature.c:75 +#: ../lib/signature.c:77 msgid "No signature\n" msgstr "" -#: ../lib/signature.c:78 +#: ../lib/signature.c:80 msgid "Old PGP signature\n" msgstr "" -#: ../lib/signature.c:91 +#: ../lib/signature.c:93 msgid "Old (internal-only) signature! How did you get that!?" msgstr "" -#: ../lib/signature.c:95 +#: ../lib/signature.c:97 msgid "New Header signature\n" msgstr "" #. 8-byte pad -#: ../lib/signature.c:103 ../lib/signature.c:141 +#: ../lib/signature.c:105 ../lib/signature.c:143 #, c-format msgid "Signature size: %d\n" msgstr "" -#: ../lib/signature.c:104 ../lib/signature.c:142 +#: ../lib/signature.c:106 ../lib/signature.c:144 #, c-format msgid "Signature pad : %d\n" msgstr "" -#: ../lib/signature.c:218 ../lib/signature.c:646 +#: ../lib/signature.c:221 ../lib/signature.c:668 msgid "Couldn't exec pgp" msgstr "" -#: ../lib/signature.c:229 +#: ../lib/signature.c:232 msgid "pgp failed" msgstr "" #. PGP failed to write signature #. Just in case -#: ../lib/signature.c:236 +#: ../lib/signature.c:239 msgid "pgp failed to write signature" msgstr "" -#: ../lib/signature.c:241 +#: ../lib/signature.c:244 #, c-format msgid "PGP sig size: %d\n" msgstr "" -#: ../lib/signature.c:252 ../lib/signature.c:328 +#: ../lib/signature.c:255 ../lib/signature.c:331 msgid "unable to read the signature" msgstr "" -#: ../lib/signature.c:257 +#: ../lib/signature.c:260 #, c-format msgid "Got %d bytes of PGP sig\n" msgstr "" -#: ../lib/signature.c:294 ../lib/signature.c:633 +#: ../lib/signature.c:297 ../lib/signature.c:655 msgid "Couldn't exec gpg" msgstr "" -#: ../lib/signature.c:305 +#: ../lib/signature.c:308 msgid "gpg failed" msgstr "" #. GPG failed to write signature #. Just in case -#: ../lib/signature.c:312 +#: ../lib/signature.c:315 msgid "gpg failed to write signature" msgstr "" -#: ../lib/signature.c:317 +#: ../lib/signature.c:320 #, c-format msgid "GPG sig size: %d\n" msgstr "" -#: ../lib/signature.c:333 +#: ../lib/signature.c:336 #, c-format msgid "Got %d bytes of GPG sig\n" msgstr "" -#: ../lib/signature.c:348 +#: ../lib/signature.c:351 #, c-format msgid "sigsize : %d\n" msgstr "" -#: ../lib/signature.c:349 +#: ../lib/signature.c:352 #, c-format msgid "Header + Archive: %d\n" msgstr "" -#: ../lib/signature.c:350 +#: ../lib/signature.c:353 #, c-format msgid "expected size : %d\n" msgstr "" -#: ../lib/signature.c:354 +#: ../lib/signature.c:357 msgid "file is not regular -- skipping size check\n" msgstr "" -#: ../lib/signature.c:472 ../lib/signature.c:533 +#: ../lib/signature.c:480 ../lib/signature.c:547 msgid "exec failed!\n" msgstr "" -#: ../lib/signature.c:474 +#: ../lib/signature.c:482 msgid "Could not run pgp. Use --nopgp to skip PGP checks." msgstr "" -#: ../lib/signature.c:535 +#: ../lib/signature.c:549 msgid "Could not run gpg. Use --nogpg to skip GPG checks." msgstr "" -#: ../lib/signature.c:567 -msgid "You must set \"gpg_name:\" in your rpmrc file" +#: ../lib/signature.c:586 +msgid "You must set \"%%_gpg_name\" in your macro file" msgstr "" -#: ../lib/signature.c:574 -msgid "You must set \"pgp_name:\" in your rpmrc file" +#: ../lib/signature.c:597 +msgid "You must set \"%%_pgp_name\" in your macro file" msgstr "" -#: ../lib/signature.c:583 ../lib/signature.c:652 +#. This case should have been screened out long ago. +#: ../lib/signature.c:606 ../lib/signature.c:672 msgid "Invalid signature spec in rc file" msgstr "" -#: ../lib/transaction.c:722 +#: ../lib/transaction.c:744 #, c-format msgid "relocating %s to %s\n" msgstr "" -#: ../lib/transaction.c:728 +#: ../lib/transaction.c:750 #, c-format msgid "excluding %s\n" msgstr "" -#: ../lib/transaction.c:816 +#: ../lib/transaction.c:838 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" @@ -814,7 +814,6 @@ int main(int argc, char ** argv) { case GETOPT_DBPATH: if (optArg[0] != '/') argerror(_("arguments to --dbpath must begin with a /")); - rpmSetVar(RPMVAR_DBPATH, optArg); addMacro(&globalMacroContext, "_dbpath", NULL, optArg, RMIL_CMDLINE); gotDbpath = 1; break; @@ -825,7 +824,6 @@ int main(int argc, char ** argv) { if ((*tce) || (tce == optArg) || (timeCheck == ULONG_MAX)) { argerror("Argument to --timecheck must be integer"); } - rpmSetVar(RPMVAR_TIMECHECK, optArg); addMacro(&globalMacroContext, "_timecheck", NULL, optArg, RMIL_CMDLINE); timeCheck = 1; break; @@ -1071,19 +1069,15 @@ int main(int argc, char ** argv) { "package verification")); if (ftpProxy) { - rpmSetVar(RPMVAR_FTPPROXY, ftpProxy); addMacro(&globalMacroContext, "_ftpproxy", NULL, ftpProxy, RMIL_CMDLINE); } if (ftpPort) { - rpmSetVar(RPMVAR_FTPPORT, ftpPort); addMacro(&globalMacroContext, "_ftpport", NULL, ftpPort, RMIL_CMDLINE); } if (httpProxy) { - rpmSetVar(RPMVAR_HTTPPROXY, httpProxy); addMacro(&globalMacroContext, "_httpproxy", NULL, httpProxy, RMIL_CMDLINE); } if (httpPort) { - rpmSetVar(RPMVAR_HTTPPORT, httpPort); addMacro(&globalMacroContext, "_httpport", NULL, httpPort, RMIL_CMDLINE); } @@ -1130,8 +1124,7 @@ int main(int argc, char ** argv) { } } else { /* Override any rpmrc setting */ - rpmSetVar(RPMVAR_SIGTYPE, "none"); - addMacro(&globalMacroContext, "_sigtype", NULL, "none", RMIL_CMDLINE); + addMacro(&globalMacroContext, "_signature", NULL, "none", RMIL_CMDLINE); } if (pipeOutput) { @@ -1304,7 +1297,7 @@ int main(int argc, char ** argv) { if (!incldocs) { if (excldocs) installFlags |= RPMTRANS_FLAG_NODOCS; - else if (rpmGetBooleanVar(RPMVAR_EXCLUDEDOCS)) + else if (rpmExpandNumeric("%{_excludedocs}")) installFlags |= RPMTRANS_FLAG_NODOCS; } @@ -1,21 +1,4 @@ -# $Id: rpmrc.in,v 2.3 1999/03/14 00:35:00 jbj Exp $ -############################################################# -# Default values, often overridden in /etc/rpmrc -# -# This file *should not be modified*. Local customizations -# belong in /etc/rpmrc, not here. This file will be replaced -# whenever a new version of RPM is installed. - -dbpath: @varprefix@/lib/rpm -topdir: @prefix@/src/redhat -tmppath: @tmpdir@ -gzipbin: @GZIPBIN@ -bzip2bin: @BZIP2BIN@ -defaultdocdir: @prefix@/doc -fixperms: @FIXPERMS@ -rpmfilename: %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm -instchangelog: 5 - +# $Id: rpmrc.in,v 2.4 1999/03/20 21:09:52 jbj Exp $ ############################################################# # Please send new entries to rpm-list@redhat.com diff --git a/tests/macros.in b/tests/macros.in index d5f3685ff..22aab9965 100644 --- a/tests/macros.in +++ b/tests/macros.in @@ -1,9 +1,12 @@ -# $Id: macros.in,v 1.11 1999/03/14 00:35:06 jbj Exp $ +# $Id: macros.in,v 1.12 1999/03/20 21:10:10 jbj Exp $ #============================================================================== # Macro naming conventions (preliminary): # # Macros that begin with an underscore are "local" in the sense that -# they (if used) will not be exported in rpm headers. +# they (if used) will not be exported in rpm headers. Some macros +# that don't start with an underscore (but look like they should) +# are compatible with macros generated by rpm-2.5.x and will be made +# more consistent in a future release. # #============================================================================== @@ -33,24 +36,57 @@ %__tar %(which tar) #============================================================================== -# ---- rpmrc macros. -# Macros that are initialized as a side effect of rpmrc parsing. -# These are the default values that will be overridden by any -# explicit values found in /usr/lib/rpm/rpmrc or /etc/rpmrc. +# ---- Required rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc parsing. +# These are the default values that can be overridden by other +# (e.g. per-platform, per-system, per-packager) macro files. # %_builddir %{_topdir}/BUILD -%_bzip2bin @BZIP2BIN@ +%_buildshell @testdir@/bin/sh +%_bzip2bin @testdir@@BZIP2BIN@ %_dbpath %{_var}/lib/rpm -%_defaultdocdir /usr/doc -%_fixperms @FIXPERMS@ -%_gzipbin @GZIPBIN@ +%_defaultdocdir %{_usr}/doc +# +# XXX fixowner, fixgroup, and fixperms are run at the end of hardcoded setup +#%_fixowner chown -R root +#%_fixgroup chgrp -R @ROOT_GROUP@ +%_fixperms chmod -R @FIXPERMS@ +# +%_gzipbin @testdir@@GZIPBIN@ +%_instchangelog 5 %_rpmdir %{_topdir}/RPMS -%_rpmfilename %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm +# +# XXX Note escaped %% for use in headerSprintf +%_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +%_signature none %_sourcedir %{_topdir}/SOURCES %_specdir %{_topdir}/SPECS %_srcrpmdir %{_topdir}/SRPMS %_tmppath %{_var}/tmp %_topdir %{_usrsrc}/redhat +# +#============================================================================== +# ---- Optional rpmrc macros. +# Macros that used to be initialized as a side effect of rpmrc and/or +# spec file parsing but were not set in the distributed configuration +# /usr/lib/rpm/rpmrc file. +# +#%buildroot +#%distribution +#%_excludedocs +#%_ftpport +#%_ftpproxy +#%_gpg_name +#%_gpg_path +#%_httpport +#%_httpproxy +#%_langpatt +#%_netsharedpath +#%packager +#%_pgp_name +#%_pgp_path +#%_provides +#%_timecheck #============================================================================== # ---- per-platform macros. @@ -58,9 +94,9 @@ # will be used if the per-platform macro file does not exist.. # %_arch @RPMCANONARCH@ -%_vendor @RPMCANONVENDOR@ +%vendor @RPMCANONVENDOR@ %_os @RPMCANONOS@ -%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os} +%_target_platform %{_target_cpu}-%{vendor}-%{_target_os} # # XXX use the rpmrc instantiated macro for now #%optflags -O2 diff --git a/tests/rpmrc.in b/tests/rpmrc.in index 2825ed81d..c8649d16c 100644 --- a/tests/rpmrc.in +++ b/tests/rpmrc.in @@ -1,198 +1,4 @@ +# $Id: rpmrc.in,v 1.4 1999/03/20 21:10:11 jbj Exp $ ############################################################# -# Default values, often overridden in /etc/rpmrc -# -# This file *should not be modified*. Local customizations -# belong in /etc/rpmrc, not here. This file will be replaced -# whenever a new version of RPM is installed. - macrofiles: @testdir@@MACROFILES@ -dbpath: @testdir@@varprefix@/lib/rpm -topdir: @testdir@@prefix@/src/redhat -tmppath: @testdir@@tmpdir@ -gzipbin: @testdir@@GZIPBIN@ -bzip2bin: @testdir@@BZIP2BIN@ -defaultdocdir: @prefix@/doc -fixperms: a+rX,g-w,o-w -rpmfilename: %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm -instchangelog: 5 - -############################################################# - -# Please send new entries to rpm-list@redhat.com - -############################################################# -# Values for RPM_OPT_FLAGS for various platforms - -optflags: i386 -O2 -m486 -fno-strength-reduce -optflags: alpha -O2 -optflags: sparc -O2 -optflags: m68k -O2 -fomit-frame-pointer -optflags: ppc -O2 -fsigned-char -optflags: parisc -O2 -mpa-risc-1-0 -optflags: hppa1.0 -O2 -mpa-risc-1-0 -optflags: hppa1.1 -O2 -mpa-risc-1-0 -optflags: hppa1.2 -O2 -mpa-risc-1-0 -optflags: hppa2.0 -O2 -mpa-risc-1-0 -optflags: mipseb -O2 -optflags: mipsel -O2 -optflags: arm3 -O2 -optflags: arm4 -O2 - -############################################################# -# Canonical arch names and numbers - -arch_canon: i986: i986 1 -arch_canon: i886: i886 1 -arch_canon: i786: i786 1 -arch_canon: i686: i686 1 -arch_canon: i586: i586 1 -arch_canon: i486: i486 1 -arch_canon: i386: i386 1 -arch_canon: alpha: alpha 2 -arch_canon: sparc: sparc 3 -arch_canon: sun4: sparc 3 -arch_canon: sun4m: sparc 3 -arch_canon: sun4c: sparc 3 -arch_canon: sun4d: sparc 3 -# This is really a place holder for MIPS. -arch_canon: mipseb: mipseb 4 -arch_canon: ppc: ppc 5 -arch_canon: m68k: m68k 6 -arch_canon: IP: sgi 7 -arch_canon: rs6000: rs6000 8 - -arch_canon: sun4u: usparc 10 -arch_canon: mipsel: mipsel 11 - -arch_canon: arm: arm 12 -arch_canon: arm6: arm3 12 -arch_canon: arm610: arm3 12 -arch_canon: arm7: arm3 12 -arch_canon: arm710: arm3 12 -arch_canon: arm8: arm4 12 -arch_canon: arm810: arm4 12 -arch_canon: sa110: arm4 12 - -############################################################# -# Canonical OS names and numbers - -os_canon: Linux: Linux 1 -os_canon: IRIX: Irix 2 -# This is wrong -os_canon: SunOS5: solaris 3 -os_canon: SunOS4: SunOS 4 - -os_canon: AmigaOS: AmigaOS 5 -os_canon: AIX: AIX 5 -os_canon: HP-UX: hpux10 6 -os_canon: OSF1: osf1 7 -os_canon: FreeBSD: FreeBSD 8 -os_canon: SCO_SV: SCO_SV3.2v5.0.2 9 -os_canon: IRIX64: Irix64 10 -os_canon: NEXTSTEP: NextStep 11 -os_canon: BSD/OS: BSD_OS 12 -os_canon: machten: machten 13 -os_canon: CYGWIN32_NT: cygwin32 14 -os_canon: CYGWIN32_95: cygwin32 15 -os_canon: UNIX_SV: MP_RAS: 16 - -############################################################# -# For a given uname().machine, the default build arch - -buildarchtranslate: osfmach3_i986: i386 -buildarchtranslate: osfmach3_i886: i386 -buildarchtranslate: osfmach3_i786: i386 -buildarchtranslate: osfmach3_i686: i386 -buildarchtranslate: osfmach3_i586: i386 -buildarchtranslate: osfmach3_i486: i386 -buildarchtranslate: osfmach3_i386: i386 - -buildarchtranslate: i986: i386 -buildarchtranslate: i886: i386 -buildarchtranslate: i786: i386 -buildarchtranslate: i686: i386 -buildarchtranslate: i586: i386 -buildarchtranslate: i486: i386 -buildarchtranslate: i386: i386 - -buildarchtranslate: osfmach3_ppc: ppc -buildarchtranslate: powerpc: ppc -buildarchtranslate: powerppc: ppc - -############################################################# -# Architecture compatibility - -arch_compat: alpha: axp noarch - -arch_compat: i986: i886 -arch_compat: i886: i786 -arch_compat: i786: i686 -arch_compat: i686: i586 -arch_compat: i586: i486 -arch_compat: i486: i386 -arch_compat: i386: noarch - -arch_compat: osfmach3_i986: i986 osfmach3_i886 -arch_compat: osfmach3_i886: i886 osfmach3_i786 -arch_compat: osfmach3_i786: i786 osfmach3_i686 -arch_compat: osfmach3_i686: i686 osfmach3_i586 -arch_compat: osfmach3_i586: i586 osfmach3_i486 -arch_compat: osfmach3_i486: i486 osfmach3_i386 -arch_compat: osfmach3_i386: i486 - -arch_compat: osfmach3_ppc: ppc -arch_compat: powerpc: ppc -arch_compat: powerppc: ppc - -arch_compat: usparc: sparc -arch_compat: sparc: noarch - -arch_compat: ppc: rs6000 -arch_compat: rs6000: noarch -arch_compat: mipseb: noarch -arch_compat: mipsel: noarch - -arch_compat: hppa2.0: hppa1.2 -arch_compat: hppa1.2: hppa1.1 -arch_compat: hppa1.1: hppa1.0 -arch_compat: hppa1.0: parisc -arch_compat: parisc: noarch - -arch_compat: arm4: arm3 -arch_compat: arm3: noarch - -os_compat: IRIX64: IRIX -os_compat: solaris2.6: solaris2.3 solaris2.4 solaris2.5 -os_compat: solaris2.5: solaris2.3 solaris2.4 -os_compat: solaris2.4: solaris2.3 - -os_compat: hpux11.00: hpux10.30 -os_compat: hpux10.30: hpux10.20 -os_compat: hpux10.20: hpux10.10 -os_compat: hpux10.10: hpux10.01 -os_compat: hpux10.01: hpux10.00 -os_compat: hpux10.00: hpux9.07 -os_compat: hpux9.07: hpux9.05 -os_compat: hpux9.05: hpux9.04 - -os_compat: osf4.0: osf3.2 - -os_compat: ncr-sysv4.3: ncr-sysv4.2 - -buildarch_compat: i986: i886 -buildarch_compat: i886: i786 -buildarch_compat: i786: i686 -buildarch_compat: i686: i586 -buildarch_compat: i586: i486 -buildarch_compat: i486: i386 -buildarch_compat: i386: noarch - -buildarch_compat: sparc: noarch -buildarch_compat: alpha: noarch -buildarch_compat: m68k: noarch -buildarch_compat: ppc: noarch -buildarch_compat: mipsel: noarch -buildarch_compat: mipseb: noarch -buildarch_compat: arm4: noarch -buildarch_compat: arm3: noarch -buildarch_compat: parisc: noarch +include: @testdir@/../rpmrc diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index 832152bc9..df144d288 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -1016,8 +1016,7 @@ main(int argc, char **argv) exit(1); } - /* XXX I don't want to read rpmrc yet */ - rpmSetVar(RPMVAR_TMPPATH, "/tmp"); + /* XXX I don't want to read rpmrc */ addMacro(&globalMacroContext, "_tmppath", NULL, "/tmp", RMIL_DEFAULT); fdi = fdDup(STDIN_FILENO); @@ -128,8 +128,6 @@ static void findUrlinfo(urlinfo **uret, int mustAsk) /* Perform one-time FTP initialization */ if (!strcmp(u->service, "ftp")) { - char *proxy; - char *proxyport; if (mustAsk || (u->user != NULL && u->password == NULL)) { char * prompt; @@ -139,49 +137,61 @@ static void findUrlinfo(urlinfo **uret, int mustAsk) u->password = strdup(getpass(prompt)); } - if (u->proxyh == NULL && (proxy = rpmGetVar(RPMVAR_FTPPROXY)) != NULL) { - const char *uu = (u->user ? u->user : "anonymous"); - char *nu = malloc(strlen(uu) + sizeof("@") + strlen(u->host)); - strcpy(nu, uu); - strcat(nu, "@"); - strcat(nu, u->host); - u->proxyu = nu; - u->proxyh = strdup(proxy); + if (u->proxyh == NULL) { + const char *proxy = rpmExpand("%{_ftpproxy}", NULL); + if (proxy && *proxy != '%') { + const char *uu = (u->user ? u->user : "anonymous"); + char *nu = malloc(strlen(uu) + sizeof("@") + strlen(u->host)); + strcpy(nu, uu); + strcat(nu, "@"); + strcat(nu, u->host); + u->proxyu = nu; + u->proxyh = strdup(proxy); + } + xfree(proxy); } - if (u->proxyp < 0 && (proxyport = rpmGetVar(RPMVAR_FTPPORT)) != NULL) { - int port; - char *end; - port = strtol(proxyport, &end, 0); - if (*end) { - fprintf(stderr, _("error: %sport must be a number\n"), + if (u->proxyp < 0) { + const char *proxy = rpmExpand("%{_ftpport}", NULL); + if (proxy && *proxy != '%') { + char *end; + int port = strtol(proxy, &end, 0); + if (!(end && *end == '\0')) { + fprintf(stderr, _("error: %sport must be a number\n"), u->service); - return; + return; + } + u->proxyp = port; } - u->proxyp = port; + xfree(proxy); } } /* Perform one-time HTTP initialization */ if (!strcmp(u->service, "http")) { - char *proxy; - char *proxyport; - if (u->proxyh == NULL && (proxy = rpmGetVar(RPMVAR_HTTPPROXY)) != NULL) { - u->proxyh = strdup(proxy); + if (u->proxyh == NULL) { + const char *proxy = rpmExpand("%{_httpproxy}", NULL); + if (proxy && *proxy != '%') + u->proxyh = strdup(proxy); + xfree(proxy); } - if (u->proxyp < 0 && (proxyport = rpmGetVar(RPMVAR_HTTPPORT)) != NULL) { - int port; - char *end; - port = strtol(proxyport, &end, 0); - if (*end) { - fprintf(stderr, _("error: %sport must be a number\n"), + if (u->proxyp < 0) { + const char *proxy = rpmExpand("%{_httpport}", NULL); + if (proxy && *proxy != '%') { + char *end; + int port = strtol(proxy, &end, 0); + if (!(end && *end == '\0')) { + fprintf(stderr, _("error: %sport must be a number\n"), u->service); - return; + return; + } + u->proxyp = port; } - u->proxyp = port; + xfree(proxy); } + } return; |