uses RPMVAR_TMPPATH
authorewt <devnull@localhost>
Tue, 20 Aug 1996 16:28:40 +0000 (16:28 +0000)
committerewt <devnull@localhost>
Tue, 20 Aug 1996 16:28:40 +0000 (16:28 +0000)
CVS patchset: 976
CVS date: 1996/08/20 16:28:40

build/build.c
build/pack.c
lib/install.c
lib/signature.c

index bc0ec08..03d6e7a 100644 (file)
@@ -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 */
index 5087904..33e64c1 100644 (file)
@@ -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 */
index 0f48d3d..59f18fe 100644 (file)
@@ -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;
index 2945142..34c09c6 100644 (file)
@@ -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);