summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarc <devnull@localhost>1998-05-21 03:21:13 +0000
committermarc <devnull@localhost>1998-05-21 03:21:13 +0000
commit7e3b1b2197df204e1063a2c207516ab5b74576f2 (patch)
treee23d79086c4231aafecea277646e50bdcfd5d9b6
parentf0d4eed0dbd83837bc3abaf19f0c0957103a0786 (diff)
downloadrpm-7e3b1b2197df204e1063a2c207516ab5b74576f2.tar.gz
rpm-7e3b1b2197df204e1063a2c207516ab5b74576f2.tar.bz2
rpm-7e3b1b2197df204e1063a2c207516ab5b74576f2.zip
- make %doc script obey --test
- hopefully fix temp file creation problems CVS patchset: 2120 CVS date: 1998/05/21 03:21:13
-rw-r--r--CHANGES2
-rw-r--r--build/build.c3
-rw-r--r--build/files.c12
-rw-r--r--build/files.h2
-rw-r--r--lib/misc.c10
5 files changed, 14 insertions, 15 deletions
diff --git a/CHANGES b/CHANGES
index bda5fd894..4756c3a8c 100644
--- 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
diff --git a/build/build.c b/build/build.c
index 447d88acb..49e4d288a 100644
--- a/build/build.c
+++ b/build/build.c
@@ -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;
}
}
diff --git a/build/files.c b/build/files.c
index dcc68d016..88885bf63 100644
--- a/build/files.c
+++ b/build/files.c
@@ -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 */
diff --git a/build/files.h b/build/files.h
index 61239e2ea..242bfc94f 100644
--- a/build/files.h
+++ b/build/files.h
@@ -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);
diff --git a/lib/misc.c b/lib/misc.c
index 3b31d49c5..f6b3aa7e3 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -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);