diff options
author | jbj <devnull@localhost> | 1999-01-05 23:13:56 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-01-05 23:13:56 +0000 |
commit | 8af5b5af8757e9385ea90770997b45f4f82c06db (patch) | |
tree | d6f50fbd74db96d5038a46d89223ab38bb7d5e9b /build.c | |
parent | c7c985480ab320547dbdb977a0e8682c24710393 (diff) | |
download | rpm-8af5b5af8757e9385ea90770997b45f4f82c06db.tar.gz rpm-8af5b5af8757e9385ea90770997b45f4f82c06db.tar.bz2 rpm-8af5b5af8757e9385ea90770997b45f4f82c06db.zip |
Expand path macros with rpmGetPath(path, ...).
CVS patchset: 2652
CVS date: 1999/01/05 23:13:56
Diffstat (limited to 'build.c')
-rw-r--r-- | build.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -19,9 +19,6 @@ static int buildForTarget(char *arg, int buildAmount, char *passPhrase, char * specfile; int res = 0; struct stat statbuf; - char * specDir; - char * tmpSpecFile; - char * cmd; char * s; int count, fd; char buf[BUFSIZ]; @@ -30,13 +27,15 @@ static int buildForTarget(char *arg, int buildAmount, char *passPhrase, rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS); if (fromTarball) { - specDir = alloca(BUFSIZ); - strcpy(specDir, "%{_specdir}"); - /* XXX can't use spec->macros yet */ - expandMacros(NULL, &globalMacroContext, specDir, BUFSIZ); + const char *specDir; + const char * tmpSpecFile; + char * cmd; + char tfn[64]; - tmpSpecFile = alloca(BUFSIZ); - sprintf(tmpSpecFile, "%s/rpm-spec-file-%d", specDir, (int) getpid()); + specDir = rpmGetPath("%{_specdir}", NULL); + + sprintf(tfn, "rpm-spec-file-%d", (int) getpid()); + tmpSpecFile = rpmGetPath("%{_specdir}", tfn, NULL); cmd = alloca(strlen(arg) + 50 + strlen(tmpSpecFile)); sprintf(cmd, "gunzip < %s | tar xOvf - Specfile 2>&1 > %s", arg, @@ -103,6 +102,8 @@ static int buildForTarget(char *arg, int buildAmount, char *passPhrase, *cmd = '\0'; addMacro(&globalMacroContext, "_sourcedir", NULL, buf, RMIL_TARBALL); + xfree(specDir); + xfree(tmpSpecFile); } else if (arg[0] == '/') { specfile = arg; } else { |