macros.in: Add buildsubdir and scriptlet template macros.

build/build.c: Rewrite to use scriptlet templates.
build/files.c: Rename variables to prepare for (possibly) URL's in %files.
build/myftw.c: Use Lstat.
build/parsePreamble.c: Permit URL's in BuildRoot tag if not from spec file.
build/parseSpec.c: ditto
build/parsePrep.c: Add buildsubdir macro.
lib/macro.c: Add url2path (nickname u2p) and verbose macro primitives.
lib/url.c: urlPath returns "" if url is NULL (rpmGenPath memory corruption).

CVS patchset: 3430
CVS date: 1999/11/19 18:19:41
This commit is contained in:
jbj 1999-11-19 18:19:41 +00:00
parent 1f6614e61e
commit c6d768583e
19 changed files with 563 additions and 318 deletions

View File

@ -35,136 +35,232 @@ static void doRmSource(Spec spec)
* The _preScript string is expanded to export values to a script environment. * The _preScript string is expanded to export values to a script environment.
*/ */
static char *_preScriptEnvironment = "%{_preScriptEnvironment}";
static char *_preScriptChdir =
"umask 022\n"
"cd %{_builddir}\n"
;
int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
{ {
const char * rootURL = spec->rootURL;
const char * rootDir;
const char *scriptName = NULL;
const char * buildURL = rpmGenPath(rootURL, "%{_builddir}", "");
#ifdef DYING
const char * buildDir;
const char * buildSubdir;
const char * buildScript;
const char * remsh = rpmGetPath("%{?_remsh:%{_remsh}}", NULL);
const char * remchroot = rpmGetPath("%{?_remchroot:%{_remchroot}}", NULL);
const char * buildShell =
rpmGetPath("%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}", NULL);
const char * buildEnv = rpmExpand("%{_preScriptEnvironment}", NULL);
#else
const char * buildScript;
const char * buildCmd = NULL;
const char * buildTemplate = NULL;
const char * buildPost = NULL;
const char * mTemplate = NULL;
const char * mPost = NULL;
int argc = 0;
const char **argv = NULL;
#endif
FILE * fp = NULL;
urlinfo u = NULL;
FD_t fd; FD_t fd;
FD_t xfd; FD_t xfd;
const char *scriptName; int child;
int pid;
int status; int status;
char buf[BUFSIZ]; int rc;
FILE * fp = NULL;
switch (what) { switch (what) {
case RPMBUILD_PREP: case RPMBUILD_PREP:
name = "%prep"; name = "%prep";
sb = spec->prep; sb = spec->prep;
mTemplate = "%{__spec_prep_template}";
mPost = "%{__spec_prep_post}";
break; break;
case RPMBUILD_BUILD: case RPMBUILD_BUILD:
name = "%build"; name = "%build";
sb = spec->build; sb = spec->build;
mTemplate = "%{__spec_build_template}";
mPost = "%{__spec_build_post}";
break; break;
case RPMBUILD_INSTALL: case RPMBUILD_INSTALL:
name = "%install"; name = "%install";
sb = spec->install; sb = spec->install;
mTemplate = "%{__spec_install_template}";
mPost = "%{__spec_install_post}";
break; break;
case RPMBUILD_CLEAN: case RPMBUILD_CLEAN:
name = "%clean"; name = "%clean";
sb = spec->clean; sb = spec->clean;
mTemplate = "%{__spec_clean_template}";
mPost = "%{__spec_clean_post}";
break; break;
case RPMBUILD_RMBUILD: case RPMBUILD_RMBUILD:
name = "--clean"; name = "--clean";
mTemplate = "%{__spec_clean_template}";
mPost = "%{__spec_clean_post}";
break; break;
case RPMBUILD_STRINGBUF: case RPMBUILD_STRINGBUF:
default:
mTemplate = "%{___build_template}";
mPost = "%{___build_post}";
break; break;
} }
if ((what != RPMBUILD_RMBUILD) && sb == NULL) if ((what != RPMBUILD_RMBUILD) && sb == NULL) {
return 0; rc = 0;
goto exit;
if (makeTempFile(spec->rootdir, &scriptName, &fd)) {
Fclose(fd);
FREE(scriptName);
rpmError(RPMERR_SCRIPT, _("Unable to open temp file"));
return RPMERR_SCRIPT;
} }
if (makeTempFile(rootURL, &scriptName, &fd)) {
Fclose(fd);
rpmError(RPMERR_SCRIPT, _("Unable to open temp file"));
rc = RPMERR_SCRIPT;
goto exit;
}
#ifdef HAVE_FCHMOD #ifdef HAVE_FCHMOD
(void)fchmod(Fileno(fd), 0600); /* XXX fubar on ufdio */ switch (rootut) {
#endif case URL_IS_PATH:
#ifdef DYING case URL_IS_UNKNOWN:
/* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */ (void)fchmod(Fileno(fd), 0600); /* XXX fubar on ufdio */
xfd = Fdopen(fd, "w.fdio"); break;
#else default:
xfd = Fdopen(fd, "w.fpio"); break;
#endif
fp = fdGetFp(fd);
strcpy(buf, _preScriptEnvironment);
expandMacros(spec, spec->macros, buf, sizeof(buf));
strcat(buf, "\n");
fputs(buf, fp);
fprintf(fp, rpmIsVerbose() ? "set -x\n\n" : "exec > /dev/null\n\n");
/* XXX umask 022; cd %{_builddir} */
strcpy(buf, _preScriptChdir);
expandMacros(spec, spec->macros, buf, sizeof(buf));
fputs(buf, fp);
if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD) {
if (spec->buildSubdir)
fprintf(fp, "cd %s\n", spec->buildSubdir);
} }
#endif
if (fdGetFp(fd) == NULL)
xfd = Fdopen(fd, "w.fpio");
else
xfd = fd;
if ((fp = fdGetFp(xfd)) == NULL) {
rc = RPMERR_SCRIPT;
goto exit;
}
(void) urlPath(rootURL, &rootDir);
if (*rootDir == '\0') rootDir = "/";
#ifdef DYING
(void) urlPath(buildURL, &buildDir);
(void) urlPath(spec->buildSubdir, &buildSubdir);
#endif
(void) urlPath(scriptName, &buildScript);
buildTemplate = rpmExpand(mTemplate, NULL);
buildPost = rpmExpand(mPost, NULL);
#ifdef DYING
fprintf(fp, "#!%s\n", buildShell);
fputs(buildEnv, fp);
fputs("\n", fp);
fprintf(fp, rpmIsVerbose()
? "set -x\n\n"
: "exec > /dev/null\n\n");
fprintf(fp, "umask 022\ncd %s\n", buildDir);
#else
fputs(buildTemplate, fp);
#endif
if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir)
fprintf(fp, "cd %s\n", spec->buildSubdir);
if (what == RPMBUILD_RMBUILD) { if (what == RPMBUILD_RMBUILD) {
if (spec->buildSubdir) if (spec->buildSubdir)
fprintf(fp, "rm -rf %s\n", spec->buildSubdir); fprintf(fp, "rm -rf %s\n", spec->buildSubdir);
} else } else
fprintf(fp, "%s", getStringBuf(sb)); fprintf(fp, "%s", getStringBuf(sb));
#ifdef DYING
fprintf(fp, "\nexit 0\n"); fprintf(fp, "\nexit 0\n");
#else
fputs(buildPost, fp);
#endif
Fclose(xfd); Fclose(xfd);
if (test) { if (test) {
FREE(scriptName); rc = 0;
return 0; goto exit;
} }
rpmMessage(RPMMESS_NORMAL, _("Executing: %s\n"), name); if (buildURL && buildURL[0] != '/' && (urlSplit(buildURL, &u) != 0)) {
if (!(pid = fork())) { rc = RPMERR_SCRIPT;
const char *buildShell = rpmGetPath("%{_buildshell}", NULL); goto exit;
}
if (u)
addMacro(spec->macros, "_build_hostname", NULL, u->path, RMIL_SPEC);
if (spec->rootdir) buildCmd = rpmExpand("%{___build_cmd}", " ", buildScript, NULL);
Chroot(spec->rootdir); poptParseArgvString(buildCmd, &argc, &argv);
chdir("/");
switch (urlIsURL(scriptName)) { rpmMessage(RPMMESS_NORMAL, _("Executing(%s): %s\n"), name, buildCmd);
case URL_IS_PATH: if (!(child = fork())) {
scriptName += sizeof("file://") - 1;
scriptName = strchr(scriptName, '/'); #ifdef DYING
/*@fallthrough@*/ fprintf(stderr, "*** root %s buildDir %s script %s remsh %s \n", rootDir, buildDir, scriptName, remsh);
case URL_IS_UNKNOWN:
execl(buildShell, buildShell, "-e", scriptName, scriptName, NULL); if (u == NULL || *remsh == '\0') {
break; fprintf(stderr, "*** LOCAL %s %s -e %s %s\n", buildShell, buildShell, buildScript, buildScript);
default: if (rootURL) {
break; if (!(rootDir[0] == '/' && rootDir[1] == '\0')) {
chroot(rootDir);
chdir("/");
}
}
errno = 0;
execl(buildShell, buildShell, "-e", buildScript, buildScript, NULL);
} else {
if (*remchroot == '\0') {
fprintf(stderr, "*** REMSH %s %s %s -e %s %s\n", remsh, u->host, buildShell, buildScript, buildScript);
errno = 0;
execl(remsh, remsh, u->host, buildShell, "-e", buildScript, buildScript, NULL);
} else {
fprintf(stderr, "*** REMCHROOT %s %s %s %s -e %s %s\n", remsh, u->host, remchroot, buildShell, buildScript, buildScript);
errno = 0;
execl(remsh, remsh, u->host, remchroot, buildShell, "-e", buildScript, buildScript, NULL);
}
} }
#else
execvp(argv[0], (char *const *)argv);
#endif
rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s"), scriptName, name, strerror(errno));
rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s)"), scriptName, name);
_exit(-1); _exit(-1);
} }
(void)wait(&status); rc = waitpid(child, &status, 0);
if (! WIFEXITED(status) || WEXITSTATUS(status)) {
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)"), rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)"),
scriptName, name); scriptName, name);
#if HACK rc = RPMERR_SCRIPT;
Unlink(scriptName); } else
#endif rc = 0;
FREE(scriptName);
return RPMERR_SCRIPT;
}
Unlink(scriptName); exit:
FREE(scriptName); if (scriptName) {
if (!rc)
Unlink(scriptName);
xfree(scriptName);
}
#ifdef DYING
FREE(buildShell);
FREE(buildEnv);
FREE(remsh);
FREE(remchroot);
#else
if (u)
delMacro(spec->macros, "_build_hostname");
FREE(argv);
FREE(buildCmd);
FREE(buildTemplate);
#endif
FREE(buildURL);
return 0; return rc;
} }
int buildSpec(Spec spec, int what, int test) int buildSpec(Spec spec, int what, int test)

View File

@ -50,7 +50,7 @@ typedef struct {
} AttrRec; } AttrRec;
struct FileList { struct FileList {
const char *buildRoot; const char *buildURL;
const char *prefix; const char *prefix;
int fileCount; int fileCount;
@ -929,14 +929,14 @@ static int addFile(struct FileList *fl, const char *diskName, struct stat *statp
const char *fileGname; const char *fileGname;
char *lang; char *lang;
/* Path may have prepended buildroot, so locate the original filename. */ /* Path may have prepended buildURL, so locate the original filename. */
{ const char *s; { const char *s;
char c; char c;
if ((s = fl->buildRoot) != NULL) { if ((s = fl->buildURL) != NULL) {
c = '\0'; c = '\0';
while (*s) { while (*s) {
if (c == '/') if (c == '/' && !(s[0] == '/' && s[1] == ':'))
while(*s && *s == '/') s++; while(*s && *s == '/') s++;
if (*s) { if (*s) {
fileName++; fileName++;
@ -977,7 +977,7 @@ static int addFile(struct FileList *fl, const char *diskName, struct stat *statp
/* instead of lstat(), which causes it to follow symlinks! */ /* instead of lstat(), which causes it to follow symlinks! */
/* It also has better callback support. */ /* It also has better callback support. */
fl->inFtw = 1; /* Flag to indicate file has buildRoot prefixed */ fl->inFtw = 1; /* Flag to indicate file has buildURL prefixed */
fl->isDir = 1; /* Keep it from following myftw() again */ fl->isDir = 1; /* Keep it from following myftw() again */
myftw(diskName, 16, (myftwFunc) addFile, fl); myftw(diskName, 16, (myftwFunc) addFile, fl);
fl->isDir = 0; fl->isDir = 0;
@ -1100,16 +1100,16 @@ static int processBinaryFile(/*@unused@*/Package pkg, struct FileList *fl,
/* Copy file name or glob pattern removing multiple "/" chars. */ /* Copy file name or glob pattern removing multiple "/" chars. */
{ const char *s; { const char *s;
char c, *t = alloca((fl->buildRoot ? strlen(fl->buildRoot) : 0) + char c, *t = alloca((fl->buildURL ? strlen(fl->buildURL) : 0) +
strlen(fileName) + 1); strlen(fileName) + 1);
fn = t; fn = t;
*t = c = '\0'; *t = c = '\0';
/* With a buildroot, prepend the buildroot now. */ /* With a buildroot, prepend the buildURL now. */
if ((s = fl->buildRoot) != NULL) { if ((s = fl->buildURL) != NULL) {
while (*s) { while (*s) {
if (c == '/') if (c == '/' && !(s[0] == '/' && s[1] == ':'))
while(*s && *s == '/') s++; while(*s && *s == '/') s++;
if (*s) if (*s)
*t++ = c = *s++; *t++ = c = *s++;
@ -1119,7 +1119,7 @@ static int processBinaryFile(/*@unused@*/Package pkg, struct FileList *fl,
} }
if ((s = fileName) != NULL) { if ((s = fileName) != NULL) {
while (*s) { while (*s) {
if (c == '/') if (c == '/' && !(s[0] == '/' && s[1] == ':'))
while(*s && *s == '/') s++; while(*s && *s == '/') s++;
if (*s) if (*s)
*t++ = c = *s++; *t++ = c = *s++;
@ -1198,8 +1198,8 @@ static int processPackageFiles(Spec spec, Package pkg,
/* Init the file list structure */ /* Init the file list structure */
/* XXX spec->buildRoot == NULL, then xstrdup("") is returned */ /* XXX spec->buildURL == NULL, then xstrdup("") is returned */
fl.buildRoot = rpmGetPath(spec->buildRoot, NULL); fl.buildURL = rpmGenPath(spec->rootURL, spec->buildURL, NULL);
if (headerGetEntry(pkg->header, RPMTAG_DEFAULTPREFIX, if (headerGetEntry(pkg->header, RPMTAG_DEFAULTPREFIX,
NULL, (void **)&fl.prefix, NULL)) { NULL, (void **)&fl.prefix, NULL)) {
@ -1333,7 +1333,7 @@ static int processPackageFiles(Spec spec, Package pkg,
} }
/* Clean up */ /* Clean up */
FREE(fl.buildRoot); FREE(fl.buildURL);
FREE(fl.prefix); FREE(fl.prefix);
freeAttrRec(&fl.cur_ar); freeAttrRec(&fl.cur_ar);

View File

@ -1,4 +1,4 @@
/* Modified ftw() -- uses lstat() instead of stat() */ /* Modified ftw() -- uses Lstat() instead of stat() */
/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. /* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -21,6 +21,8 @@ Cambridge, MA 02139, USA. */
#include "system.h" #include "system.h"
#include <rpmio.h>
#ifndef NAMLEN #ifndef NAMLEN
#define NAMLEN(a) strlen((a)->d_name) #define NAMLEN(a) strlen((a)->d_name)
#endif #endif
@ -84,7 +86,7 @@ myftw_dir (DIR **dirs, int level, int descriptors,
dir[len] = '/'; dir[len] = '/';
memcpy ((void *) (dir + len + 1), (void *) entry->d_name, d_namlen); memcpy ((void *) (dir + len + 1), (void *) entry->d_name, d_namlen);
if (lstat (dir, &s) < 0) if (Lstat (dir, &s) < 0)
{ {
/* Following POSIX.1 2.4 ENOENT is returned if the file cannot /* Following POSIX.1 2.4 ENOENT is returned if the file cannot
* be stat'ed. This can happen for a file returned by readdir * be stat'ed. This can happen for a file returned by readdir
@ -182,7 +184,7 @@ int myftw (const char *dir,
while (i-- > 0) while (i-- > 0)
dirs[i] = NULL; dirs[i] = NULL;
if (lstat (dir, &s) < 0) if (Lstat (dir, &s) < 0)
{ {
/* Following POSIX.1 2.4 ENOENT is returned if the file cannot /* Following POSIX.1 2.4 ENOENT is returned if the file cannot
* be stat'ed. This can happen for a file returned by readdir * be stat'ed. This can happen for a file returned by readdir

View File

@ -245,9 +245,6 @@ int writeRPM(Header h, const char *fileName, int type,
char buf[BUFSIZ]; char buf[BUFSIZ];
Header sig; Header sig;
struct rpmlead lead; struct rpmlead lead;
#ifdef DYING
int fdno;
#endif
if (Fileno(csa->cpioFdIn) < 0) { if (Fileno(csa->cpioFdIn) < 0) {
csa->cpioArchiveSize = 0; csa->cpioArchiveSize = 0;
@ -271,11 +268,6 @@ int writeRPM(Header h, const char *fileName, int type,
return RPMERR_CREATE; return RPMERR_CREATE;
} }
#ifdef DYING
fd = fdLink(fd, "persist"); /* XXX keep fd from being freed */
fdno = Fileno(fd); /* XXX HACK HACK HACK to keep fdno open */
#endif
if (headerWrite(fd, h, HEADER_MAGIC_YES)) { if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE; rc = RPMERR_NOSPACE;
} else { /* Write the archive and get the size */ } else { /* Write the archive and get the size */
@ -289,10 +281,6 @@ int writeRPM(Header h, const char *fileName, int type,
} }
} }
#ifdef DYING
fdSetFdno(fd, fdno); /* XXX HACK HACK HACK to keep fdno open */
#endif
if (rc != 0) { if (rc != 0) {
Fclose(fd); Fclose(fd);
unlink(sigtarget); unlink(sigtarget);
@ -434,11 +422,7 @@ static int cpio_doio(FD_t fdo, CSA_t * csa, const char * fmode)
const char *failedFile = NULL; const char *failedFile = NULL;
(void) Fflush(fdo); (void) Fflush(fdo);
#ifndef DYING
cfd = Fdopen(fdDup(Fileno(fdo)), fmode); cfd = Fdopen(fdDup(Fileno(fdo)), fmode);
#else
cfd = Fdopen(fdo, fmode);
#endif
rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL, rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL,
&csa->cpioArchiveSize, &failedFile); &csa->cpioArchiveSize, &failedFile);
if (rc) { if (rc) {

View File

@ -1,6 +1,7 @@
#include "system.h" #include "system.h"
#include <rpmbuild.h> #include <rpmbuild.h>
#include <rpmurl.h>
static int_32 copyTagsDuringParse[] = { static int_32 copyTagsDuringParse[] = {
RPMTAG_EPOCH, RPMTAG_EPOCH,
@ -229,9 +230,6 @@ static int readIcon(Header h, const char *file)
{ {
const char *fn = NULL; const char *fn = NULL;
char *icon; char *icon;
#ifdef DYING
struct stat statbuf;
#endif
FD_t fd; FD_t fd;
int rc = 0; int rc = 0;
off_t size; off_t size;
@ -240,14 +238,6 @@ static int readIcon(Header h, const char *file)
/* XXX use rpmGenPath(rootdir, "%{_sourcedir}/", file) for icon path. */ /* XXX use rpmGenPath(rootdir, "%{_sourcedir}/", file) for icon path. */
fn = rpmGetPath("%{_sourcedir}/", file, NULL); fn = rpmGetPath("%{_sourcedir}/", file, NULL);
#ifdef DYING
if (Stat(fn, &statbuf)) {
rpmError(RPMERR_BADSPEC, _("Unable to stat icon: %s"), fn);
rc = RPMERR_BADSPEC;
goto exit;
}
#endif
fd = Fopen(fn, "r.ufdio"); fd = Fopen(fn, "r.ufdio");
if (fd == NULL || Ferror(fd)) { if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s"), rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s"),
@ -330,8 +320,8 @@ if (multiToken) { \
extern int noLang; /* XXX FIXME: pass as arg */ extern int noLang; /* XXX FIXME: pass as arg */
static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro, static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro,
char *lang) const char *lang)
{ {
char *field = spec->line; char *field = spec->line;
char *end; char *end;
@ -406,28 +396,38 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
break; break;
case RPMTAG_BUILDROOT: case RPMTAG_BUILDROOT:
SINGLE_TOKEN_ONLY; SINGLE_TOKEN_ONLY;
if (spec->buildRoot == NULL) { { const char * buildRoot = NULL;
/* XXX use rpmGenPath(rootdir, "%{buildroot}/", file) for buildroot path. */ const char * buildURL = spec->buildURL;
const char *buildroot = rpmGetPath("%{buildroot}", NULL);
/* XXX FIXME make sure that buildroot has path, add urlbuildroot. */ if (buildURL == NULL) {
if (buildroot && *buildroot != '%') {
spec->buildRoot = xstrdup(cleanFileName(buildroot)); buildURL = rpmGenPath(spec->rootURL, "%{?buildroot:%{buildroot}}", NULL);
if (strcmp(spec->rootURL, buildURL)) {
spec->buildURL = buildURL;
macro = NULL; macro = NULL;
} else { } else {
spec->buildRoot = xstrdup(cleanFileName(field)); const char * specURL = field;
(void) urlPath(specURL, (const char **)&field);
xfree(buildURL);
buildURL = rpmGenPath(NULL, specURL, NULL);
spec->buildURL = buildURL;
} }
xfree(buildroot);
} else { } else {
macro = NULL; macro = NULL;
} }
if (!strcmp(spec->buildRoot, "/")) { (void) urlPath(buildURL, &buildRoot);
if (*buildRoot == '\0') buildRoot = "/";
if (!strcmp(buildRoot, "/")) {
rpmError(RPMERR_BADSPEC, rpmError(RPMERR_BADSPEC,
_("line %d: BuildRoot can not be \"/\": %s"), _("line %d: BuildRoot can not be \"/\": %s"),
spec->lineNum, spec->line); spec->lineNum, spec->line);
return RPMERR_BADSPEC; return RPMERR_BADSPEC;
} }
spec->gotBuildRoot = 1; spec->gotBuildURL = 1;
break; } break;
case RPMTAG_PREFIXES: case RPMTAG_PREFIXES:
addOrAppendListEntry(pkg->header, tag, field); addOrAppendListEntry(pkg->header, tag, field);
headerGetEntry(pkg->header, tag, NULL, (void **)&array, &num); headerGetEntry(pkg->header, tag, NULL, (void **)&array, &num);
@ -735,7 +735,7 @@ int parsePreamble(Spec spec, int initialPackage)
/* Do some final processing on the header */ /* Do some final processing on the header */
if (!spec->gotBuildRoot && spec->buildRoot) { if (!spec->gotBuildURL && spec->buildURL) {
rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot")); rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot"));
return RPMERR_BADSPEC; return RPMERR_BADSPEC;
} }

View File

@ -200,7 +200,6 @@ static int checkOwners(const char *file)
static int doSetupMacro(Spec spec, char *line) static int doSetupMacro(Spec spec, char *line)
{ {
char *version, *name;
char buf[BUFSIZ]; char buf[BUFSIZ];
StringBuf before; StringBuf before;
StringBuf after; StringBuf after;
@ -264,19 +263,18 @@ static int doSetupMacro(Spec spec, char *line)
if (dirName) { if (dirName) {
spec->buildSubdir = xstrdup(dirName); spec->buildSubdir = xstrdup(dirName);
} else { } else {
headerGetEntry(spec->packages->header, RPMTAG_VERSION, NULL, const char *name, *version;
(void **) &version, NULL); headerNVR(spec->packages->header, &name, &version, NULL);
headerGetEntry(spec->packages->header, RPMTAG_NAME, NULL,
(void **) &name, NULL);
sprintf(buf, "%s-%s", name, version); sprintf(buf, "%s-%s", name, version);
spec->buildSubdir = xstrdup(buf); spec->buildSubdir = xstrdup(buf);
} }
addMacro(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC);
free(argv); free(argv);
poptFreeContext(optCon); poptFreeContext(optCon);
/* cd to the build dir */ /* cd to the build dir */
{ const char * buildURL = rpmGenPath(spec->rootdir, "%{_builddir}", ""); { const char * buildURL = rpmGenPath(spec->rootURL, "%{_builddir}", "");
const char *buildDir; const char *buildDir;
(void) urlPath(buildURL, &buildDir); (void) urlPath(buildURL, &buildDir);

View File

@ -1,6 +1,7 @@
#include "system.h" #include "system.h"
#include "rpmbuild.h" #include <rpmbuild.h>
#include <rpmurl.h>
static struct PartRec { static struct PartRec {
int part; int part;
@ -326,8 +327,8 @@ void closeSpec(Spec spec)
int noLang = 0; /* XXX FIXME: pass as arg */ int noLang = 0; /* XXX FIXME: pass as arg */
int parseSpec(Spec *specp, const char *specFile, const char *rootdir, int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
const char *buildRoot, int inBuildArch, const char *passPhrase, const char *buildURL, int inBuildArch, const char *passPhrase,
char *cookie, int anyarch, int force) char *cookie, int anyarch, int force)
{ {
int parsePart = PART_PREAMBLE; int parsePart = PART_PREAMBLE;
@ -345,9 +346,11 @@ int parseSpec(Spec *specp, const char *specFile, const char *rootdir,
spec->fileStack->fileName = xstrdup(specFile); spec->fileStack->fileName = xstrdup(specFile);
spec->specFile = xstrdup(specFile); spec->specFile = xstrdup(specFile);
if (buildRoot) { if (buildURL) {
spec->gotBuildRoot = 1; const char * buildRoot;
spec->buildRoot = xstrdup(buildRoot); spec->gotBuildURL = 1;
spec->buildURL = xstrdup(buildURL);
(void) urlPath(buildURL, &buildRoot);
addMacro(spec->macros, "buildroot", NULL, buildRoot, RMIL_SPEC); addMacro(spec->macros, "buildroot", NULL, buildRoot, RMIL_SPEC);
} }
addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC); addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC);
@ -355,8 +358,8 @@ int parseSpec(Spec *specp, const char *specFile, const char *rootdir,
spec->anyarch = anyarch; spec->anyarch = anyarch;
spec->force = force; spec->force = force;
if (rootdir && strcmp(rootdir, "/")) if (rootURL)
spec->rootdir = xstrdup(rootdir); spec->rootURL = xstrdup(rootURL);
if (passPhrase) if (passPhrase)
spec->passPhrase = xstrdup(passPhrase); spec->passPhrase = xstrdup(passPhrase);
if (cookie) if (cookie)
@ -435,7 +438,7 @@ int parseSpec(Spec *specp, const char *specFile, const char *rootdir,
saveArch = xstrdup(saveArch); saveArch = xstrdup(saveArch);
rpmSetMachine(spec->buildArchitectures[x], NULL); rpmSetMachine(spec->buildArchitectures[x], NULL);
if (parseSpec(&(spec->buildArchitectureSpecs[index]), if (parseSpec(&(spec->buildArchitectureSpecs[index]),
specFile, spec->rootdir, buildRoot, 1, specFile, spec->rootURL, buildURL, 1,
passPhrase, cookie, anyarch, force)) { passPhrase, cookie, anyarch, force)) {
spec->buildArchitectureCount = index; spec->buildArchitectureCount = index;
freeSpec(spec); freeSpec(spec);

View File

@ -97,8 +97,8 @@ struct SpecStruct {
int force; int force;
int anyarch; int anyarch;
int gotBuildRoot; int gotBuildURL;
/*@only@*/ const char *buildRoot; /*@only@*/ const char *buildURL;
/*@only@*/ const char *buildSubdir; /*@only@*/ const char *buildSubdir;
char *passPhrase; char *passPhrase;
@ -115,7 +115,7 @@ struct SpecStruct {
/*@dependent@*/ struct MacroContext *macros; /*@dependent@*/ struct MacroContext *macros;
/*@only@*/ const char *rootdir; /*@only@*/ const char *rootURL;
/*@only@*/ StringBuf prep; /*@only@*/ StringBuf prep;
/*@only@*/ StringBuf build; /*@only@*/ StringBuf build;
/*@only@*/ StringBuf install; /*@only@*/ StringBuf install;

View File

@ -413,7 +413,7 @@ Spec newSpec(void)
spec->readStack->next = NULL; spec->readStack->next = NULL;
spec->readStack->reading = 1; spec->readStack->reading = 1;
spec->rootdir = NULL; spec->rootURL = NULL;
spec->prep = NULL; spec->prep = NULL;
spec->build = NULL; spec->build = NULL;
spec->install = NULL; spec->install = NULL;
@ -429,8 +429,8 @@ Spec newSpec(void)
spec->sourceCpioCount = 0; spec->sourceCpioCount = 0;
spec->sourceCpioList = NULL; spec->sourceCpioList = NULL;
spec->gotBuildRoot = 0; spec->gotBuildURL = 0;
spec->buildRoot = NULL; spec->buildURL = NULL;
spec->buildSubdir = NULL; spec->buildSubdir = NULL;
spec->passPhrase = NULL; spec->passPhrase = NULL;
@ -464,7 +464,7 @@ void freeSpec(/*@only@*/ Spec spec)
freeStringBuf(spec->install); spec->install = NULL; freeStringBuf(spec->install); spec->install = NULL;
freeStringBuf(spec->clean); spec->clean = NULL; freeStringBuf(spec->clean); spec->clean = NULL;
FREE(spec->buildRoot); FREE(spec->buildURL);
FREE(spec->buildSubdir); FREE(spec->buildSubdir);
FREE(spec->specFile); FREE(spec->specFile);
FREE(spec->sourceRpmName); FREE(spec->sourceRpmName);

View File

@ -155,21 +155,19 @@ dnl
dnl Find some common programs dnl Find some common programs
dnl dnl
AC_PATH_PROG(BZIP2BIN, bzip2, /usr/bin/bzip2, $MYPATH) AC_PATH_PROG(BZIP2BIN, bzip2, /usr/bin/bzip2, $MYPATH)
AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH) AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH) AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH)
AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH) AC_PATH_PROG(__CHMOD, chmod, /bin/chmod, $MYPATH)
AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH) AC_PATH_PROG(__CHOWN, chown, /bin/chown, $MYPATH)
AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH) AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH)
AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH) AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
AC_PATH_PROG(GZIPBIN, gzip, /bin/gzip, $MYPATH) AC_PATH_PROG(GZIPBIN, gzip, /bin/gzip, $MYPATH)
dnl Solaris prefers /usr/xpg4/bin/id dnl Solaris prefers /usr/xpg4/bin/id
AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH) AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH) AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH)
AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH) AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH)
AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH) AC_PATH_PROG(__PATCH, patch, /usr/bin/patch, $MYPATH)
AC_MSG_CHECKING(old version of patch) AC_MSG_CHECKING(old version of patch)
PATCHVERSION=`patch --version 2>&1` PATCHVERSION=`patch --version 2>&1`
@ -183,7 +181,13 @@ dnl Solaris prefers /usr/xpg4/bin/id
AC_PATH_PROG(PGPBIN, pgp, /usr/bin/pgp, $MYPATH) AC_PATH_PROG(PGPBIN, pgp, /usr/bin/pgp, $MYPATH)
AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH) AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH)
AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH)
AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH) AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH)
AC_PATH_PROG(__OBJCOPY, objcopy, /usr/bin/objcopy, $MYPATH)
AC_PATH_PROG(__OBJDUMP, objdump, /usr/bin/objdump, $MYPATH)
AC_PATH_PROG(__STRIP, strip, /usr/bin/strip, $MYPATH)
fi fi
addlib() { addlib() {

View File

@ -26,13 +26,13 @@ unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno) {
dbiIndex * dbiOpenIndex(const char * urlfn, int flags, int perms, DBTYPE type) { dbiIndex * dbiOpenIndex(const char * urlfn, int flags, int perms, DBTYPE type) {
dbiIndex * dbi; dbiIndex * dbi;
const char * filename; const char * filename;
int urltype = urlPath(urlfn, &filename);
(void) urlPath(urlfn, &filename);
dbi = xmalloc(sizeof(*dbi)); dbi = xmalloc(sizeof(*dbi));
dbi->db = dbopen(filename, flags, perms, type, NULL); if (*filename == '\0' ||
if (!dbi->db) { (dbi->db = dbopen(filename, flags, perms, type, NULL)) == NULL) {
free(dbi); free(dbi);
rpmError(RPMERR_DBOPEN, _("cannot open file %s: %s"), filename, rpmError(RPMERR_DBOPEN, _("cannot open file %s: %s"), urlfn,
strerror(errno)); strerror(errno));
return NULL; return NULL;
} }

View File

@ -349,11 +349,7 @@ static int installArchive(FD_t fd, struct fileInfo * files,
notifyData); notifyData);
(void) Fflush(fd); (void) Fflush(fd);
#ifndef DYING
cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio"); cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio");
#else
cfd = Fdopen(fd, "r.gzdio");
#endif
rc = cpioInstallArchive(cfd, map, mappedFiles, rc = cpioInstallArchive(cfd, map, mappedFiles,
((notify && archiveSize) || specFile) ? callback : NULL, ((notify && archiveSize) || specFile) ? callback : NULL,
&info, &failedFile); &info, &failedFile);

View File

@ -785,7 +785,7 @@ doOutput(MacroBuf *mb, int waserror, const char *msg, size_t msglen)
} }
static void static void
doFoo(MacroBuf *mb, const char *f, size_t fn, const char *g, size_t glen) doFoo(MacroBuf *mb, int negate, const char *f, size_t fn, const char *g, size_t glen)
{ {
char buf[BUFSIZ], *b = NULL, *be; char buf[BUFSIZ], *b = NULL, *be;
int c; int c;
@ -811,6 +811,14 @@ doFoo(MacroBuf *mb, const char *f, size_t fn, const char *g, size_t glen)
b++; b++;
} else if (STREQ("expand", f, fn)) { } else if (STREQ("expand", f, fn)) {
b = buf; b = buf;
} else if (STREQ("verbose", f, fn)) {
if (negate)
b = (rpmIsVerbose() ? NULL : buf);
else
b = (rpmIsVerbose() ? buf : NULL);
} else if (STREQ("url2path", f, fn) || STREQ("u2p", f, fn)) {
(void)urlPath(buf, (const char **)&b);
if (*b == '\0') b = "/";
} else if (STREQ("uncompress", f, fn)) { } else if (STREQ("uncompress", f, fn)) {
int compressed = 1; int compressed = 1;
for (b = buf; (c = *b) && isblank(c);) for (b = buf; (c = *b) && isblank(c);)
@ -1061,11 +1069,14 @@ expandMacro(MacroBuf *mb)
if (STREQ("basename", f, fn) || if (STREQ("basename", f, fn) ||
STREQ("suffix", f, fn) || STREQ("suffix", f, fn) ||
STREQ("expand", f, fn) || STREQ("expand", f, fn) ||
STREQ("verbose", f, fn) ||
STREQ("uncompress", f, fn) || STREQ("uncompress", f, fn) ||
STREQ("url2path", f, fn) ||
STREQ("u2p", f, fn) ||
STREQ("S", f, fn) || STREQ("S", f, fn) ||
STREQ("P", f, fn) || STREQ("P", f, fn) ||
STREQ("F", f, fn)) { STREQ("F", f, fn)) {
doFoo(mb, f, fn, g, gn); doFoo(mb, negate, f, fn, g, gn);
s = se; s = se;
continue; continue;
} }

View File

@ -53,6 +53,7 @@ int rpmfileexists(const char * urlfn) {
int urltype = urlPath(urlfn, &fn); int urltype = urlPath(urlfn, &fn);
struct stat buf; struct stat buf;
if (*fn == '\0') fn = "/";
switch (urltype) { switch (urltype) {
case URL_IS_FTP: /* XXX WRONG WRONG WRONG */ case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */ case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
@ -355,16 +356,14 @@ char * gidToGname(gid_t gid) {
} }
int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
const char * tempfn; const char * tempfn = NULL;
const char * tfn; const char * tfn = NULL;
int temput; int temput;
FD_t fd; FD_t fd;
int ran; int ran;
if (!prefix) prefix = ""; if (!prefix) prefix = "";
tfn = NULL;
/* XXX should probably use mktemp here */ /* XXX should probably use mktemp here */
srand(time(NULL)); srand(time(NULL));
ran = rand() % 100000; ran = rand() % 100000;
@ -375,15 +374,17 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
char tfnbuf[64]; char tfnbuf[64];
#ifndef NOTYET #ifndef NOTYET
sprintf(tfnbuf, "rpm-tmp.%d", ran++); sprintf(tfnbuf, "rpm-tmp.%d", ran++);
if (tfn) xfree(tfn); if (tempfn) xfree(tempfn);
tempfn = rpmGenPath(prefix, "%{_tmppath}/", tfnbuf); tempfn = rpmGenPath(prefix, "%{_tmppath}/", tfnbuf);
#else #else
strcpy(tfnbuf, "rpm-tmp.XXXXXX"); strcpy(tfnbuf, "rpm-tmp.XXXXXX");
if (tfn) xfree(tfn); if (tempfn) xfree(tempfn);
tempfn = rpmGenPath(prefix, "%{_tmppath}/", mktemp(tfnbuf)); tempfn = rpmGenPath(prefix, "%{_tmppath}/", mktemp(tfnbuf));
#endif #endif
temput = urlPath(tempfn, &tfn); temput = urlPath(tempfn, &tfn);
if (*tfn == '\0') goto errxit;
switch (temput) { switch (temput) {
case URL_IS_HTTP: case URL_IS_HTTP:
case URL_IS_DASH: case URL_IS_DASH:
@ -393,12 +394,7 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
break; break;
} }
/* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */ fd = Fopen(tempfn, "w+x.ufdio");
#ifdef DYING
fd = fdio->open(tfn, (O_CREAT|O_RDWR|O_EXCL), 0700);
#else
fd = Fopen(tfn, "w+x.ufdio");
#endif
} while ((fd == NULL || Ferror(fd)) && errno == EEXIST); } while ((fd == NULL || Ferror(fd)) && errno == EEXIST);
switch(temput) { switch(temput) {
@ -427,15 +423,15 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
} }
if (fnptr) if (fnptr)
*fnptr = tfn; *fnptr = tempfn;
else else if (tempfn)
xfree(tempfn); xfree(tempfn);
*fdptr = fd; *fdptr = fd;
return 0; return 0;
errxit: errxit:
xfree(tempfn); if (tempfn) xfree(tempfn);
return 1; return 1;
} }

View File

@ -309,17 +309,12 @@ urltype urlIsURL(const char * url) {
return URL_IS_UNKNOWN; return URL_IS_UNKNOWN;
} }
/* Return path portion of url (or pointer to NUL if url == NULL) */
int urlPath(const char * url, const char ** pathp) int urlPath(const char * url, const char ** pathp)
{ {
const char *path; const char *path;
int urltype; int urltype;
if (url == NULL) { /* XXX paranoia */
if (pathp)
*pathp = xstrdup("/");
return URL_IS_UNKNOWN;
}
path = url; path = url;
urltype = urlIsURL(url); urltype = urlIsURL(url);
switch (urltype) { switch (urltype) {
@ -338,8 +333,8 @@ int urlPath(const char * url, const char ** pathp)
path = ""; path = "";
break; break;
} }
if (path == NULL) if (path == NULL) /* XXX gotta return something */
path = "/"; path = "";
if (pathp) if (pathp)
*pathp = path; *pathp = path;
return urltype; return urltype;
@ -370,14 +365,6 @@ int urlSplit(const char * url, urlinfo *uret)
while (1) { while (1) {
/* Point to end of next item */ /* Point to end of next item */
while (*se && *se != '/') se++; while (*se && *se != '/') se++;
#ifdef DYING
if (*se == '\0') {
/* XXX can't find path */
if (myurl) free(myurl);
u = urlFree(u, "urlSplit (error #2)");
return -1;
}
#endif
/* Item was service. Save service and go for the rest ...*/ /* Item was service. Save service and go for the rest ...*/
if (*se && (se != s) && se[-1] == ':' && se[0] == '/' && se[1] == '/') { if (*se && (se != s) && se[-1] == ':' && se[0] == '/' && se[1] == '/') {
se[-1] = '\0'; se[-1] = '\0';

210
macros.in
View File

@ -1,4 +1,4 @@
# $Id: macros.in,v 1.37 1999/09/29 23:29:57 jbj Exp $ # $Id: macros.in,v 1.38 1999/11/19 18:19:41 jbj Exp $
#============================================================================== #==============================================================================
# Macro naming conventions (preliminary): # Macro naming conventions (preliminary):
# #
@ -22,9 +22,9 @@
%_var @varprefix@ %_var @varprefix@
#============================================================================== #==============================================================================
# ---- path macros # ---- Generally useful path macros.
# XXX The use of which here is overly simple (read: dumb).
# #
%__awk @AWK@
%__bzip2 %{_bzip2bin} %__bzip2 %{_bzip2bin}
%__cat @__CAT@ %__cat @__CAT@
%__chgrp @__CHGRP@ %__chgrp @__CHGRP@
@ -34,17 +34,33 @@
%__cpio @__CPIO@ %__cpio @__CPIO@
%__gzip %{_gzipbin} %__gzip %{_gzipbin}
%__id @__ID@ %__id @__ID@
%__install %(which install) %__install @__INSTALL@
%__ln_s @LN_S@
%__make @__MAKE@ %__make @__MAKE@
%__mkdir @__MKDIR@ %__mkdir @__MKDIR@
%__mkdir_p @MKDIR_P@
%__mv @__MV@ %__mv @__MV@
%__patch @__PATCH@ %__patch @__PATCH@
%__ranlib %(which ranlib) %__pgp %{_pgpbin}
%__rm @__RM@ %__rm @__RM@
%__strip %(which strip) %__rsh @__RSH@
%__ssh @__SSH@
%__tar @__TAR@ %__tar @__TAR@
# XXX avoid weird failures from which if tools are not installed #==============================================================================
# ---- Build system path macros.
#
%__ar @AR@
%__cc @CC@
%__cpp @CPP@
%__ld @LD@
%__nm @NM@
%__objcopy @__OBJCOPY@
%__objdump @__OBJDUMP@
%__ranlib @RANLIB@
%__strip @__STRIP@
# XXX avoid failures if tools are not installed when rpm is built.
%__libtoolize libtoolize %__libtoolize libtoolize
%__aclocal aclocal %__aclocal aclocal
%__autoheader autoheader %__autoheader autoheader
@ -90,11 +106,11 @@
# #
#============================================================================== #==============================================================================
# ---- Optional rpmrc macros. # ---- Optional rpmrc macros.
# Macros that used to be initialized as a side effect of rpmrc and/or # Macros that are initialized as a side effect of rpmrc and/or spec
# spec file parsing but were not set in the distributed configuration # file parsing.
# /usr/lib/rpm/rpmrc file.
# #
#%buildroot #%buildroot
#%buildsubdir
#%distribution #%distribution
#%_excludedocs #%_excludedocs
#%_ftpport #%_ftpport
@ -127,25 +143,165 @@
#%optflags -O2 #%optflags -O2
#============================================================================== #==============================================================================
# ---- script environment macros. # ---- Scriptlet template templates.
# Macro(s) that establish the environment for running a script. # Global defaults for building scriptlet templates.
# #
# XXX legacy configuration.
%_preScriptEnvironment \ %_preScriptEnvironment \
RPM_SOURCE_DIR=\"%{_sourcedir}\"\ RPM_SOURCE_DIR=\"%{_sourcedir}\"\
RPM_BUILD_DIR=\"%{_builddir}\"\ RPM_BUILD_DIR=\"%{_builddir}\"\
RPM_OPT_FLAGS=\"%{optflags}\"\ RPM_OPT_FLAGS=\"%{optflags}\"\
RPM_ARCH=\"%{_arch}\"\ RPM_ARCH=\"%{_arch}\"\
RPM_OS=\"%{_os}\"\ RPM_OS=\"%{_os}\"\
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
RPM_DOC_DIR=\"%{_docdir}\"\ RPM_DOC_DIR=\"%{_docdir}\"\
export RPM_DOC_DIR\ export RPM_DOC_DIR\
RPM_PACKAGE_NAME=\"%{name}\"\ RPM_PACKAGE_NAME=\"%{name}\"\
RPM_PACKAGE_VERSION=\"%{version}\"\ RPM_PACKAGE_VERSION=\"%{version}\"\
RPM_PACKAGE_RELEASE=\"%{release}\"\ RPM_PACKAGE_RELEASE=\"%{release}\"\
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\ export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
%{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\ %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
export RPM_BUILD_ROOT\ export RPM_BUILD_ROOT}
}
%___build_shell %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
%___build_args -e
%___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_build_hostname}}%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} }%{___build_shell} %{___build_args}
%___build_pre \
RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
RPM_OPT_FLAGS=\"%{optflags}\"\
RPM_ARCH=\"%{_arch}\"\
RPM_OS=\"%{_os}\"\
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
RPM_DOC_DIR=\"%{_docdir}\"\
export RPM_DOC_DIR\
RPM_PACKAGE_NAME=\"%{name}\"\
RPM_PACKAGE_VERSION=\"%{version}\"\
RPM_PACKAGE_RELEASE=\"%{release}\"\
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
%{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
export RPM_BUILD_ROOT}\
\
%{verbose:set -x}%{!verbose:exec > /dev/null}\
umask 022\
cd %{u2p:%{_builddir}}\
#%___build_body %{nil}
%___build_post exit 0
%___build_template #!%{___build_shell}\
%{___build_pre}\
%{nil}
#%{___build_body}\
#%{___build_post}\
#%{nil}
#==============================================================================
# ---- Scriptlet templates.
# Macro(s) that expand to a command and script that is executed.
# CAVEAT: All macro expansions must fit in a BUFSIZ (8192 byte) buffer.
#
%__spec_prep_shell %{___build_shell}
%__spec_prep_args %{___build_args}
%__spec_prep_cmd %{___build_cmd}
%__spec_prep_pre %{___build_pre}
%__spec_prep_body %{___build_body}
%__spec_prep_post %{___build_post}
%__spec_prep_template #!%{__spec_prep_shell}\
%{__spec_prep_pre}\
%{nil}
#%{__spec_prep_body}\
#%{__spec_prep_post}\
#%{nil}
%__spec_build_shell %{___build_shell}
%__spec_build_args %{___build_args}
%__spec_build_cmd %{___build_cmd}
%__spec_build_pre %{___build_pre}
%__spec_build_body %{___build_body}
%__spec_build_post %{___build_post}
%__spec_build_template #!%{__spec_build_shell}\
%{__spec_build_pre}\
%{nil}
#%{__spec_build_body}\
#%{__spec_build_post}\
#%{nil}
%__spec_install_shell %{___build_shell}
%__spec_install_args %{___build_args}
%__spec_install_cmd %{___build_cmd}
%__spec_install_pre %{___build_pre}
%__spec_install_body %{___build_body}
%__spec_install_post %{___build_post}
%__spec_install_template #!%{__spec_install_shell}\
%{__spec_install_pre}\
%{nil}
#%{__spec_install_body}\
#%{__spec_install_post}\
#%{nil}
#%__spec_autodep_shell %{___build_shell}
#%__spec_autodep_args %{___build_args}
#%__spec_autodep_cmd %{___build_cmd}
#%__spec_autodep_pre %{___build_pre}
#%__spec_autodep_body %{___build_body}
#%__spec_autodep_post %{___build_post}
#%__spec_autodep_template #!%{__spec_autodep_shell}\
#%{__spec_autodep_pre}\
#%{nil}
#%{__spec_autodep_body}\
#%{__spec_autodep_post}\
#%{nil}
%__spec_clean_shell %{___build_shell}
%__spec_clean_args %{___build_args}
%__spec_clean_cmd %{___build_cmd}
%__spec_clean_pre %{___build_pre}
%__spec_clean_body %{___build_body}
%__spec_clean_post %{___build_post}
%__spec_clean_template #!%{__spec_clean_shell}\
%{__spec_clean_pre}\
%{nil}
#%{__spec_clean_body}\
#%{__spec_clean_post}\
#%{nil}
%__spec_rmbuild_shell %{___build_shell}
%__spec_rmbuild_args %{___build_args}
%__spec_rmbuild_cmd %{___build_cmd}
%__spec_rmbuild_pre %{___build_pre}
%__spec_rmbuild_body %{___build_body}
%__spec_rmbuild_post %{___build_post}
%__spec_rmbuild_template #!%{__spec_rmbuild_shell}\
%{__spec_rmbuild_pre}\
%{nil}
#%{__spec_rmbuild_body}\
#%{__spec_rmbuild_post}\
#%{nil}
# XXX We don't expand pre/post install scriptlets (yet).
#%__spec_pre_pre %{nil}
#%__spec_pre_post %{nil}
#%__spec_post_pre %{nil}
#%__spec_post_post %{nil}
#%__spec_preun_pre %{nil}
#%__spec_preun_post %{nil}
#%__spec_postun_pre %{nil}
#%__spec_postun_post %{nil}
#%__spec_triggerpostun_pre %{nil}
#%__spec_triggerpostun_post %{nil}
#%__spec_triggerun_pre %{nil}
#%__spec_triggerun_post %{nil}
#%__spec_triggerin_pre %{nil}
#%__spec_triggerin_post %{nil}
#============================================================================== #==============================================================================
# ---- configure macros. # ---- configure macros.

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-11-18 12:30-0500\n" "POT-Creation-Date: 1999-11-19 12:50-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -1234,21 +1234,21 @@ msgstr ""
msgid "cannot re-open payload: %s\n" msgid "cannot re-open payload: %s\n"
msgstr "" msgstr ""
#: build/build.c:85 build/pack.c:270 #: build/build.c:116 build/pack.c:267
msgid "Unable to open temp file" msgid "Unable to open temp file"
msgstr "" msgstr ""
#: build/build.c:129 #: build/build.c:198
#, c-format #, c-format
msgid "Executing: %s\n" msgid "Executing(%s): %s\n"
msgstr "" msgstr ""
#: build/build.c:149 #: build/build.c:229
#, c-format #, c-format
msgid "Exec of %s failed (%s)" msgid "Exec of %s failed (%s): %s"
msgstr "" msgstr ""
#: build/build.c:155 #: build/build.c:237
#, c-format #, c-format
msgid "Bad exit status from %s (%s)" msgid "Bad exit status from %s (%s)"
msgstr "" msgstr ""
@ -1416,7 +1416,7 @@ msgstr ""
msgid "Could not open %%files file %s: %s" msgid "Could not open %%files file %s: %s"
msgstr "" msgstr ""
#: build/files.c:1191 build/pack.c:496 #: build/files.c:1191 build/pack.c:480
#, c-format #, c-format
msgid "line: %s" msgid "line: %s"
msgstr "" msgstr ""
@ -1505,86 +1505,86 @@ msgstr ""
msgid "readRPM: reading header from %s\n" msgid "readRPM: reading header from %s\n"
msgstr "" msgstr ""
#: build/pack.c:287 #: build/pack.c:279
msgid "Bad CSA data" msgid "Bad CSA data"
msgstr "" msgstr ""
#: build/pack.c:326 #: build/pack.c:314
#, c-format #, c-format
msgid "Could not open %s: %s\n" msgid "Could not open %s: %s\n"
msgstr "" msgstr ""
#: build/pack.c:359 #: build/pack.c:347
#, c-format #, c-format
msgid "Unable to write package: %s" msgid "Unable to write package: %s"
msgstr "" msgstr ""
#: build/pack.c:374 #: build/pack.c:362
#, c-format #, c-format
msgid "Generating signature: %d\n" msgid "Generating signature: %d\n"
msgstr "" msgstr ""
#: build/pack.c:390 #: build/pack.c:378
#, c-format #, c-format
msgid "Unable to open sigtarget %s: %s" msgid "Unable to open sigtarget %s: %s"
msgstr "" msgstr ""
#: build/pack.c:400 #: build/pack.c:388
#, c-format #, c-format
msgid "Unable to read sigtarget %s: %s" msgid "Unable to read sigtarget %s: %s"
msgstr "" msgstr ""
#: build/pack.c:410 #: build/pack.c:398
#, c-format #, c-format
msgid "Unable to write package %s: %s" msgid "Unable to write package %s: %s"
msgstr "" msgstr ""
#: build/pack.c:425 #: build/pack.c:413
#, c-format #, c-format
msgid "Wrote: %s\n" msgid "Wrote: %s\n"
msgstr "" msgstr ""
#: build/pack.c:445 #: build/pack.c:429
#, c-format #, c-format
msgid "create archive failed on file %s: %s" msgid "create archive failed on file %s: %s"
msgstr "" msgstr ""
#: build/pack.c:464 #: build/pack.c:448
#, c-format #, c-format
msgid "cpio_copy write failed: %s" msgid "cpio_copy write failed: %s"
msgstr "" msgstr ""
#: build/pack.c:471 #: build/pack.c:455
#, c-format #, c-format
msgid "cpio_copy read failed: %s" msgid "cpio_copy read failed: %s"
msgstr "" msgstr ""
#: build/pack.c:552 #: build/pack.c:536
#, c-format #, c-format
msgid "Could not open PreIn file: %s" msgid "Could not open PreIn file: %s"
msgstr "" msgstr ""
#: build/pack.c:559 #: build/pack.c:543
#, c-format #, c-format
msgid "Could not open PreUn file: %s" msgid "Could not open PreUn file: %s"
msgstr "" msgstr ""
#: build/pack.c:566 #: build/pack.c:550
#, c-format #, c-format
msgid "Could not open PostIn file: %s" msgid "Could not open PostIn file: %s"
msgstr "" msgstr ""
#: build/pack.c:573 #: build/pack.c:557
#, c-format #, c-format
msgid "Could not open PostUn file: %s" msgid "Could not open PostUn file: %s"
msgstr "" msgstr ""
#: build/pack.c:581 #: build/pack.c:565
#, c-format #, c-format
msgid "Could not open VerifyScript file: %s" msgid "Could not open VerifyScript file: %s"
msgstr "" msgstr ""
#: build/pack.c:597 #: build/pack.c:581
#, c-format #, c-format
msgid "Could not open Trigger script file: %s" msgid "Could not open Trigger script file: %s"
msgstr "" msgstr ""
@ -1650,68 +1650,63 @@ msgstr ""
msgid "line %d: Second %%files list" msgid "line %d: Second %%files list"
msgstr "" msgstr ""
#: build/parsePreamble.c:141 #: build/parsePreamble.c:142
#, c-format #, c-format
msgid "Architecture is excluded: %s" msgid "Architecture is excluded: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:146 #: build/parsePreamble.c:147
#, c-format #, c-format
msgid "Architecture is not included: %s" msgid "Architecture is not included: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:151 #: build/parsePreamble.c:152
#, c-format #, c-format
msgid "OS is excluded: %s" msgid "OS is excluded: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:156 #: build/parsePreamble.c:157
#, c-format #, c-format
msgid "OS is not included: %s" msgid "OS is not included: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:170 #: build/parsePreamble.c:171
#, c-format #, c-format
msgid "%s field must be present in package: %s" msgid "%s field must be present in package: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:195 #: build/parsePreamble.c:196
#, c-format #, c-format
msgid "Duplicate %s entries in package: %s" msgid "Duplicate %s entries in package: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:245 #: build/parsePreamble.c:243
#, c-format
msgid "Unable to stat icon: %s"
msgstr ""
#: build/parsePreamble.c:253
#, c-format #, c-format
msgid "Unable to open icon %s: %s" msgid "Unable to open icon %s: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:271 #: build/parsePreamble.c:261
#, c-format #, c-format
msgid "Unable to read icon %s: %s" msgid "Unable to read icon %s: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:284 #: build/parsePreamble.c:274
#, c-format #, c-format
msgid "Unknown icon type: %s" msgid "Unknown icon type: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:347 #: build/parsePreamble.c:337
#, c-format #, c-format
msgid "line %d: Malformed tag: %s" msgid "line %d: Malformed tag: %s"
msgstr "" msgstr ""
#. Empty field #. Empty field
#: build/parsePreamble.c:355 #: build/parsePreamble.c:345
#, c-format #, c-format
msgid "line %d: Empty tag: %s" msgid "line %d: Empty tag: %s"
msgstr "" msgstr ""
#: build/parsePreamble.c:378 build/parsePreamble.c:385 #: build/parsePreamble.c:368 build/parsePreamble.c:375
#, c-format #, c-format
msgid "line %d: Illegal char '-' in %s: %s" msgid "line %d: Illegal char '-' in %s: %s"
msgstr "" msgstr ""
@ -1785,43 +1780,43 @@ msgstr ""
msgid "Couldn't download nosource %s: %s" msgid "Couldn't download nosource %s: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:220 #: build/parsePrep.c:219
msgid "Error parsing %%setup: %s" msgid "Error parsing %%setup: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:235 #: build/parsePrep.c:234
msgid "line %d: Bad arg to %%setup %c: %s" msgid "line %d: Bad arg to %%setup %c: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:253 #: build/parsePrep.c:252
msgid "line %d: Bad %%setup option %s: %s" msgid "line %d: Bad %%setup option %s: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:381 #: build/parsePrep.c:379
msgid "line %d: Need arg to %%patch -b: %s" msgid "line %d: Need arg to %%patch -b: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:389 #: build/parsePrep.c:387
msgid "line %d: Need arg to %%patch -z: %s" msgid "line %d: Need arg to %%patch -z: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:401 #: build/parsePrep.c:399
msgid "line %d: Need arg to %%patch -p: %s" msgid "line %d: Need arg to %%patch -p: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:407 #: build/parsePrep.c:405
msgid "line %d: Bad arg to %%patch -p: %s" msgid "line %d: Bad arg to %%patch -p: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:414 #: build/parsePrep.c:412
msgid "Too many patches!" msgid "Too many patches!"
msgstr "" msgstr ""
#: build/parsePrep.c:418 #: build/parsePrep.c:416
msgid "line %d: Bad arg to %%patch: %s" msgid "line %d: Bad arg to %%patch: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:454 #: build/parsePrep.c:452
msgid "line %d: second %%prep" msgid "line %d: second %%prep"
msgstr "" msgstr ""
@ -1871,50 +1866,50 @@ msgstr ""
msgid "line %d: Second %s" msgid "line %d: Second %s"
msgstr "" msgstr ""
#: build/parseSpec.c:126 #: build/parseSpec.c:127
#, c-format #, c-format
msgid "line %d: %s" msgid "line %d: %s"
msgstr "" msgstr ""
#. XXX Fstrerror #. XXX Fstrerror
#: build/parseSpec.c:175 #: build/parseSpec.c:176
#, c-format #, c-format
msgid "Unable to open %s: %s\n" msgid "Unable to open %s: %s\n"
msgstr "" msgstr ""
#: build/parseSpec.c:187 #: build/parseSpec.c:188
msgid "Unclosed %%if" msgid "Unclosed %%if"
msgstr "" msgstr ""
#: build/parseSpec.c:246 #: build/parseSpec.c:247
#, c-format #, c-format
msgid "%s:%d: parseExpressionBoolean returns %d" msgid "%s:%d: parseExpressionBoolean returns %d"
msgstr "" msgstr ""
#. Got an else with no %if ! #. Got an else with no %if !
#: build/parseSpec.c:254 #: build/parseSpec.c:255
msgid "%s:%d: Got a %%else with no if" msgid "%s:%d: Got a %%else with no if"
msgstr "" msgstr ""
#. Got an end with no %if ! #. Got an end with no %if !
#: build/parseSpec.c:265 #: build/parseSpec.c:266
msgid "%s:%d: Got a %%endif with no if" msgid "%s:%d: Got a %%endif with no if"
msgstr "" msgstr ""
#: build/parseSpec.c:279 build/parseSpec.c:288 #: build/parseSpec.c:280 build/parseSpec.c:289
msgid "malformed %%include statement" msgid "malformed %%include statement"
msgstr "" msgstr ""
#: build/parseSpec.c:369 #: build/parseSpec.c:372
#, c-format #, c-format
msgid "Timecheck value must be an integer: %s" msgid "Timecheck value must be an integer: %s"
msgstr "" msgstr ""
#: build/parseSpec.c:452 #: build/parseSpec.c:455
msgid "No buildable architectures" msgid "No buildable architectures"
msgstr "" msgstr ""
#: build/parseSpec.c:499 #: build/parseSpec.c:502
msgid "Package has no %%description: %s" msgid "Package has no %%description: %s"
msgstr "" msgstr ""
@ -2226,86 +2221,86 @@ msgstr ""
#. this would probably be a good place to check if disk space #. this would probably be a good place to check if disk space
#. was used up - if so, we should return a different error #. was used up - if so, we should return a different error
#: lib/install.c:366 #: lib/install.c:362
#, c-format #, c-format
msgid "unpacking of archive failed%s%s: %s" msgid "unpacking of archive failed%s%s: %s"
msgstr "" msgstr ""
#: lib/install.c:367 #: lib/install.c:363
msgid " on file " msgid " on file "
msgstr "" msgstr ""
#: lib/install.c:410 #: lib/install.c:406
msgid "installing a source package\n" msgid "installing a source package\n"
msgstr "" msgstr ""
#: lib/install.c:421 #: lib/install.c:417
#, c-format #, c-format
msgid "cannot create %s: %s" msgid "cannot create %s: %s"
msgstr "" msgstr ""
#: lib/install.c:429 lib/install.c:451 #: lib/install.c:425 lib/install.c:447
#, c-format #, c-format
msgid "cannot write to %s" msgid "cannot write to %s"
msgstr "" msgstr ""
#: lib/install.c:433 #: lib/install.c:429
#, c-format #, c-format
msgid "sources in: %s\n" msgid "sources in: %s\n"
msgstr "" msgstr ""
#: lib/install.c:444 #: lib/install.c:440
#, c-format #, c-format
msgid "cannot create %s" msgid "cannot create %s"
msgstr "" msgstr ""
#: lib/install.c:455 #: lib/install.c:451
#, c-format #, c-format
msgid "spec file in: %s\n" msgid "spec file in: %s\n"
msgstr "" msgstr ""
#: lib/install.c:489 lib/install.c:517 #: lib/install.c:485 lib/install.c:513
msgid "source package contains no .spec file" msgid "source package contains no .spec file"
msgstr "" msgstr ""
#: lib/install.c:539 #: lib/install.c:535
#, c-format #, c-format
msgid "renaming %s to %s\n" msgid "renaming %s to %s\n"
msgstr "" msgstr ""
#: lib/install.c:541 lib/install.c:820 lib/uninstall.c:27 #: lib/install.c:537 lib/install.c:816 lib/uninstall.c:27
#, c-format #, c-format
msgid "rename of %s to %s failed: %s" msgid "rename of %s to %s failed: %s"
msgstr "" msgstr ""
#: lib/install.c:632 #: lib/install.c:628
msgid "source package expected, binary found" msgid "source package expected, binary found"
msgstr "" msgstr ""
#: lib/install.c:689 #: lib/install.c:685
#, c-format #, c-format
msgid "package: %s-%s-%s files test = %d\n" msgid "package: %s-%s-%s files test = %d\n"
msgstr "" msgstr ""
#: lib/install.c:750 #: lib/install.c:746
msgid "stopping install as we're running --test\n" msgid "stopping install as we're running --test\n"
msgstr "" msgstr ""
#: lib/install.c:755 #: lib/install.c:751
msgid "running preinstall script (if any)\n" msgid "running preinstall script (if any)\n"
msgstr "" msgstr ""
#: lib/install.c:780 #: lib/install.c:776
#, c-format #, c-format
msgid "warning: %s created as %s" msgid "warning: %s created as %s"
msgstr "" msgstr ""
#: lib/install.c:816 #: lib/install.c:812
#, c-format #, c-format
msgid "warning: %s saved as %s" msgid "warning: %s saved as %s"
msgstr "" msgstr ""
#: lib/install.c:890 #: lib/install.c:886
msgid "running postinstall scripts (if any)\n" msgid "running postinstall scripts (if any)\n"
msgstr "" msgstr ""
@ -2363,35 +2358,35 @@ msgstr ""
msgid "Unknown option %c in %s(%s)" msgid "Unknown option %c in %s(%s)"
msgstr "" msgstr ""
#: lib/macro.c:882 #: lib/macro.c:890
#, c-format #, c-format
msgid "Recursion depth(%d) greater than max(%d)" msgid "Recursion depth(%d) greater than max(%d)"
msgstr "" msgstr ""
#: lib/macro.c:948 lib/macro.c:964 #: lib/macro.c:956 lib/macro.c:972
#, c-format #, c-format
msgid "Unterminated %c: %s" msgid "Unterminated %c: %s"
msgstr "" msgstr ""
#: lib/macro.c:1004 #: lib/macro.c:1012
msgid "A %% is followed by an unparseable macro" msgid "A %% is followed by an unparseable macro"
msgstr "" msgstr ""
#: lib/macro.c:1127 #: lib/macro.c:1138
msgid "Macro %%%.*s not found, skipping" msgid "Macro %%%.*s not found, skipping"
msgstr "" msgstr ""
#: lib/macro.c:1208 #: lib/macro.c:1219
msgid "Target buffer overflow" msgid "Target buffer overflow"
msgstr "" msgstr ""
#. XXX Fstrerror #. XXX Fstrerror
#: lib/macro.c:1363 lib/macro.c:1368 #: lib/macro.c:1374 lib/macro.c:1379
#, c-format #, c-format
msgid "File %s: %s" msgid "File %s: %s"
msgstr "" msgstr ""
#: lib/macro.c:1371 #: lib/macro.c:1382
#, c-format #, c-format
msgid "File %s is smaller than %d bytes" msgid "File %s is smaller than %d bytes"
msgstr "" msgstr ""
@ -2412,7 +2407,7 @@ msgstr ""
msgid "internal error (rpm bug?): " msgid "internal error (rpm bug?): "
msgstr "" msgstr ""
#: lib/misc.c:409 lib/misc.c:414 lib/misc.c:420 #: lib/misc.c:405 lib/misc.c:410 lib/misc.c:416
#, c-format #, c-format
msgid "error creating temporary file %s" msgid "error creating temporary file %s"
msgstr "" msgstr ""
@ -2843,7 +2838,7 @@ msgstr ""
msgid "opening database mode 0x%x in %s\n" msgid "opening database mode 0x%x in %s\n"
msgstr "" msgstr ""
#: lib/rpmdb.c:155 lib/url.c:457 #: lib/rpmdb.c:155 lib/url.c:444
#, c-format #, c-format
msgid "failed to open %s: %s\n" msgid "failed to open %s: %s\n"
msgstr "" msgstr ""
@ -3089,7 +3084,7 @@ msgstr ""
msgid "Unknown or unexpected error" msgid "Unknown or unexpected error"
msgstr "" msgstr ""
#: lib/rpmio.c:1243 #: lib/rpmio.c:1232
#, c-format #, c-format
msgid "logging into %s as %s, pw %s\n" msgid "logging into %s as %s, pw %s\n"
msgstr "" msgstr ""
@ -3413,12 +3408,12 @@ msgstr ""
msgid "error: %sport must be a number\n" msgid "error: %sport must be a number\n"
msgstr "" msgstr ""
#: lib/url.c:421 #: lib/url.c:408
msgid "url port must be a number\n" msgid "url port must be a number\n"
msgstr "" msgstr ""
#. XXX Fstrerror #. XXX Fstrerror
#: lib/url.c:480 #: lib/url.c:467
#, c-format #, c-format
msgid "failed to create %s: %s\n" msgid "failed to create %s: %s\n"
msgstr "" msgstr ""

View File

@ -785,7 +785,7 @@ doOutput(MacroBuf *mb, int waserror, const char *msg, size_t msglen)
} }
static void static void
doFoo(MacroBuf *mb, const char *f, size_t fn, const char *g, size_t glen) doFoo(MacroBuf *mb, int negate, const char *f, size_t fn, const char *g, size_t glen)
{ {
char buf[BUFSIZ], *b = NULL, *be; char buf[BUFSIZ], *b = NULL, *be;
int c; int c;
@ -811,6 +811,14 @@ doFoo(MacroBuf *mb, const char *f, size_t fn, const char *g, size_t glen)
b++; b++;
} else if (STREQ("expand", f, fn)) { } else if (STREQ("expand", f, fn)) {
b = buf; b = buf;
} else if (STREQ("verbose", f, fn)) {
if (negate)
b = (rpmIsVerbose() ? NULL : buf);
else
b = (rpmIsVerbose() ? buf : NULL);
} else if (STREQ("url2path", f, fn) || STREQ("u2p", f, fn)) {
(void)urlPath(buf, (const char **)&b);
if (*b == '\0') b = "/";
} else if (STREQ("uncompress", f, fn)) { } else if (STREQ("uncompress", f, fn)) {
int compressed = 1; int compressed = 1;
for (b = buf; (c = *b) && isblank(c);) for (b = buf; (c = *b) && isblank(c);)
@ -1061,11 +1069,14 @@ expandMacro(MacroBuf *mb)
if (STREQ("basename", f, fn) || if (STREQ("basename", f, fn) ||
STREQ("suffix", f, fn) || STREQ("suffix", f, fn) ||
STREQ("expand", f, fn) || STREQ("expand", f, fn) ||
STREQ("verbose", f, fn) ||
STREQ("uncompress", f, fn) || STREQ("uncompress", f, fn) ||
STREQ("url2path", f, fn) ||
STREQ("u2p", f, fn) ||
STREQ("S", f, fn) || STREQ("S", f, fn) ||
STREQ("P", f, fn) || STREQ("P", f, fn) ||
STREQ("F", f, fn)) { STREQ("F", f, fn)) {
doFoo(mb, f, fn, g, gn); doFoo(mb, negate, f, fn, g, gn);
s = se; s = se;
continue; continue;
} }

View File

@ -134,11 +134,17 @@ __CHOWN = @__CHOWN@
__CP = @__CP@ __CP = @__CP@
__CPIO = @__CPIO@ __CPIO = @__CPIO@
__ID = @__ID@ __ID = @__ID@
__INSTALL = @__INSTALL@
__MAKE = @__MAKE@ __MAKE = @__MAKE@
__MKDIR = @__MKDIR@ __MKDIR = @__MKDIR@
__MV = @__MV@ __MV = @__MV@
__OBJCOPY = @__OBJCOPY@
__OBJDUMP = @__OBJDUMP@
__PATCH = @__PATCH@ __PATCH = @__PATCH@
__RM = @__RM@ __RM = @__RM@
__RSH = @__RSH@
__SSH = @__SSH@
__STRIP = @__STRIP@
__TAR = @__TAR@ __TAR = @__TAR@
l = @l@ l = @l@
testdir = @testdir@ testdir = @testdir@