diff options
author | jbj <devnull@localhost> | 1998-11-20 00:29:46 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1998-11-20 00:29:46 +0000 |
commit | 2b44c3a5c3528eb84df457317243f82f1a98dd36 (patch) | |
tree | 7ed3442fcbae9ea78d87fbca019085f6c64f2821 /build/parsePrep.c | |
parent | 8d6486d50f9bac50b3d49245e15b159933958cf9 (diff) | |
download | rpm-2b44c3a5c3528eb84df457317243f82f1a98dd36.tar.gz |
permit "rpm -q --specfile ... file.spec" queries.
CVS patchset: 2547
CVS date: 1998/11/20 00:29:46
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r-- | build/parsePrep.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index 078deb8f2..bf04260d2 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -51,7 +51,7 @@ static char *doPatch(Spec spec, int c, int strip, char *db, char file[BUFSIZ]; char args[BUFSIZ]; struct Source *sp; - int compressed; + int compressed = 0; for (sp = spec->sources; sp != NULL; sp = sp->next) { if ((sp->flags & RPMBUILD_ISPATCH) && (sp->num == c)) { @@ -82,12 +82,10 @@ static char *doPatch(Spec spec, int c, int strip, char *db, strcat(args, " -E"); } - if (isCompressed(file, &compressed)) { + /* XXX On non-build parse's, file cannot be stat'd or read */ + if (!spec->force && (isCompressed(file, &compressed) || checkOwners(file))) return NULL; - } - if (checkOwners(file)) { - return NULL; - } + if (compressed) { sprintf(buf, "echo \"Patch #%d:\"\n" @@ -115,7 +113,7 @@ static char *doUntar(Spec spec, int c, int quietly) char file[BUFSIZ]; char *taropts; struct Source *sp; - int compressed; + int compressed = 0; for (sp = spec->sources; sp != NULL; sp = sp->next) { if ((sp->flags & RPMBUILD_ISSOURCE) && (sp->num == c)) { @@ -133,12 +131,10 @@ static char *doUntar(Spec spec, int c, int quietly) taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf"); - if (isCompressed(file, &compressed)) { + /* XXX On non-build parse's, file cannot be stat'd or read */ + if (!spec->force && (isCompressed(file, &compressed) || checkOwners(file))) return NULL; - } - if (checkOwners(file)) { - return NULL; - } + if (compressed) { sprintf(buf, "%s -dc %s | tar %s -\n" @@ -402,7 +398,7 @@ static int doPatchMacro(Spec spec, char *line) return 0; } -int parsePrep(Spec spec, int force) +int parsePrep(Spec spec) { int nextPart, res, rc; StringBuf buf; @@ -449,7 +445,7 @@ int parsePrep(Spec spec, int force) } else { appendLineStringBuf(spec->prep, *lines); } - if (res && !force) { + if (res && !spec->force) { freeSplitString(saveLines); freeStringBuf(buf); return res; |