- make %doc script obey --test
authormarc <devnull@localhost>
Thu, 21 May 1998 03:21:13 +0000 (03:21 +0000)
committermarc <devnull@localhost>
Thu, 21 May 1998 03:21:13 +0000 (03:21 +0000)
- hopefully fix temp file creation problems

CVS patchset: 2120
CVS date: 1998/05/21 03:21:13

CHANGES
build/build.c
build/files.c
build/files.h
lib/misc.c

diff --git a/CHANGES b/CHANGES
index bda5fd8..4756c3a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
 2.5 -> 2.5.1:
        - fail if sources are not regular files
        - wasn't catching readLine() errors
+       - fixed (hopefully) temp file creation problems
+       - make %doc obey --test
 
 2.4.109 -> 2.5:
        - fixed return code bug in build code
index 447d88a..49e4d28 100644 (file)
@@ -63,7 +63,8 @@ int buildSpec(Spec spec, int what, int test)
 
        if ((what & RPMBUILD_INSTALL) || (what & RPMBUILD_PACKAGEBINARY) ||
            (what & RPMBUILD_FILECHECK)) {
-           if ((rc = processBinaryFiles(spec, what & RPMBUILD_INSTALL))) {
+           if ((rc = processBinaryFiles(spec, what & RPMBUILD_INSTALL,
+                                        test))) {
                return rc;
            }
        }
index dcc68d0..88885bf 100644 (file)
@@ -84,7 +84,8 @@ struct FileList {
     int fileListRecsUsed;
 };
 
-static int processPackageFiles(Spec spec, Package pkg, int installSpecialDoc);
+static int processPackageFiles(Spec spec, Package pkg,
+                              int installSpecialDoc, int test);
 static void freeFileList(struct FileListRec *fileList, int count);
 static int compareFileListRecs(const void *ap, const void *bp);
 static int isDoc(struct FileList *fl, char *fileName);
@@ -270,7 +271,7 @@ int processSourceFiles(Spec spec)
     return fl.processingFailed;
 }
 
-int processBinaryFiles(Spec spec, int installSpecialDoc)
+int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
 {
     Package pkg;
     int res, rc;
@@ -287,7 +288,7 @@ int processBinaryFiles(Spec spec, int installSpecialDoc)
        headerGetEntry(pkg->header, RPMTAG_NAME, NULL, (void **)&name, NULL);
        rpmMessage(RPMMESS_NORMAL, "Processing files: %s\n", name);
                   
-       if ((rc = processPackageFiles(spec, pkg, installSpecialDoc))) {
+       if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) {
            res = rc;
        }
 
@@ -300,7 +301,8 @@ int processBinaryFiles(Spec spec, int installSpecialDoc)
     return res;
 }
 
-static int processPackageFiles(Spec spec, Package pkg, int installSpecialDoc)
+static int processPackageFiles(Spec spec, Package pkg,
+                              int installSpecialDoc, int test)
 {
     struct FileList fl;
     char *s, **files, **fp, *fileName;
@@ -459,7 +461,7 @@ static int processPackageFiles(Spec spec, Package pkg, int installSpecialDoc)
     /* Now process special doc, if there is one */
     if (specialDoc) {
        if (installSpecialDoc) {
-           doScript(spec, RPMBUILD_STRINGBUF, "%doc", pkg->specialDoc, 0);
+           doScript(spec, RPMBUILD_STRINGBUF, "%doc", pkg->specialDoc, test);
        }
 
        /* fl.current now takes on "ownership" of the specialDocAttrRec */
index 61239e2..242bfc9 100644 (file)
@@ -3,6 +3,6 @@
 #include "lib/cpio.h"
 
 
-int processBinaryFiles(Spec spec, int installSpecialDoc);
+int processBinaryFiles(Spec spec, int installSpecialDoc, int test);
 int processSourceFiles(Spec spec);
 void freeCpioList(struct cpioFileMapping *cpioList, int cpioCount);
index 3b31d49..f6b3aa7 100644 (file)
@@ -346,14 +346,8 @@ int makeTempFile(char * prefix, char ** fnptr, int * fdptr) {
     ran = rand() % 100000;
     do {
        sprintf(fn, "%s%s/rpm-tmp.%d", prefix, tmpdir, ran++);
-    } while (!access(fn, X_OK));
-    
-    fd = open(fn, O_CREAT | O_RDWR | O_EXCL, 0700);
-
-    if (fd < 0) {
-       rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), fn);
-       return 1;
-    }
+       fd = open(fn, O_CREAT | O_RDWR | O_EXCL, 0700);
+    } while (fd < 0);
 
     if (!stat(fn, &sb) && S_ISLNK(sb.st_mode)) {
        rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), fn);