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);
return fl.processingFailed;
}
-int processBinaryFiles(Spec spec, int installSpecialDoc)
+int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
{
Package pkg;
int res, rc;
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;
}
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;
/* 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 */
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);