diff options
author | ewt <devnull@localhost> | 1996-08-20 16:28:40 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1996-08-20 16:28:40 +0000 |
commit | 4ed78096b767334b11d28f85de8beb4b32bc271d (patch) | |
tree | 699ac91face1429bea18409cc6a3341eee58a770 | |
parent | 226c40250a8095f152db5145a05f029b69b5c195 (diff) | |
download | rpm-4ed78096b767334b11d28f85de8beb4b32bc271d.tar.gz rpm-4ed78096b767334b11d28f85de8beb4b32bc271d.tar.bz2 rpm-4ed78096b767334b11d28f85de8beb4b32bc271d.zip |
uses RPMVAR_TMPPATH
CVS patchset: 976
CVS date: 1996/08/20 16:28:40
-rw-r--r-- | build/build.c | 2 | ||||
-rw-r--r-- | build/pack.c | 6 | ||||
-rw-r--r-- | lib/install.c | 8 | ||||
-rw-r--r-- | lib/signature.c | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/build/build.c b/build/build.c index bc0ec0805..03d6e7a84 100644 --- a/build/build.c +++ b/build/build.c @@ -57,7 +57,7 @@ struct Script *openScript(Spec spec, int builddir, char *name) exit(RPMERR_INTERNAL); } - script->name = tempnam("/var/tmp", "rpmbuild"); + script->name = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild"); script->file = fopen(script->name, "w"); /* Prepare the script */ diff --git a/build/pack.c b/build/pack.c index 508790472..33e64c15c 100644 --- a/build/pack.c +++ b/build/pack.c @@ -54,7 +54,7 @@ static int generateRPM(char *name, /* name-version-release */ Header sig; /* Write the archive to a temp file so we can get the size */ - archiveTemp = tempnam("/var/tmp", "rpmbuild"); + archiveTemp = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild"); if ((fd = open(archiveTemp, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) { fprintf(stderr, "Could not open %s\n", archiveTemp); return 1; @@ -70,7 +70,7 @@ static int generateRPM(char *name, /* name-version-release */ addEntry(header, RPMTAG_ARCHIVESIZE, INT32_TYPE, &archiveSize, 1); /* Now write the header and append the archive */ - sigtarget = tempnam("/var/tmp", "rpmbuild"); + sigtarget = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild"); if ((fd = open(sigtarget, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) { fprintf(stderr, "Could not open %s\n", sigtarget); unlink(archiveTemp); @@ -618,7 +618,7 @@ int packageSource(Spec s, char *passPhrase) /**** Create links for all the sources ****/ - tempdir = tempnam("/var/tmp", "rpmbuild"); + tempdir = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild"); mkdir(tempdir, 0700); filelist = newStringBuf(); /* List in the header */ diff --git a/lib/install.c b/lib/install.c index 0f48d3d1b..59f18fe9b 100644 --- a/lib/install.c +++ b/lib/install.c @@ -410,9 +410,9 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd, char * location, if (rootdir) { tmpPath = alloca(strlen(rootdir) + 15); strcpy(tmpPath, rootdir); - strcat(tmpPath, "/var/tmp"); + strcat(tmpPath, getVar(RPMVAR_TMPPATH)); } else - tmpPath = "/var/tmp"; + tmpPath = getVar(RPMVAR_TMPPATH); /* the file pointer for fd is pointing at the cpio archive */ if (installArchive(archivePrefix, fd, files, archiveFileCount, notify, @@ -1267,9 +1267,9 @@ static int installSources(char * rootdir, int fd, char ** specFilePtr) { if (rootdir) { tmpPath = alloca(strlen(rootdir) + 15); strcpy(tmpPath, rootdir); - strcat(tmpPath, "/var/tmp"); + strcat(tmpPath, getVar(RPMVAR_TMPPATH)); } else - tmpPath = "/var/tmp"; + tmpPath = getVar(RPMVAR_TMPPATH); if (installArchive(realSourceDir, fd, NULL, 0, NULL, &specFile, tmpPath)) { return 1; diff --git a/lib/signature.c b/lib/signature.c index 29451424c..34c09c631 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -7,6 +7,7 @@ * size key you like). We also honor PGPPATH finally. */ +#include <paths.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -346,7 +347,7 @@ static int verifyPGPSignature(char *datafile, void *sig, int res = RPMSIG_OK; /* Write out the signature */ - sigfile = tempnam("/var/tmp", "rpmsig"); + sigfile = tempnam(getVar(RPMVAR_TMPPATH), "rpmsig"); sfd = open(sigfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); write(sfd, sig, count); close(sfd); |