summaryrefslogtreecommitdiff
path: root/build/parsePrep.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-05-24 16:55:31 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-05-24 16:55:31 +0300
commitfa053f4dd853a2f6e1451539c2d69e3e5c882553 (patch)
tree323cf03bf9d0878b34e23f62e170b83d5a36d0b4 /build/parsePrep.c
parentaf0e201fbdfaebed4533b97624c506f54c949668 (diff)
downloadrpm-fa053f4dd853a2f6e1451539c2d69e3e5c882553.tar.gz
rpm-fa053f4dd853a2f6e1451539c2d69e3e5c882553.tar.bz2
rpm-fa053f4dd853a2f6e1451539c2d69e3e5c882553.zip
Fix %prep parse error to abort build
- Previously in some cases parse error in %prep could emit an error msg but still continue building due to error code bogosity. Clean up the mess a bit: assume failure and actually return the res(ult) we calculated instead of nextPart.
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r--build/parsePrep.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c
index 9e61dde11..be908b01c 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -475,7 +475,7 @@ exit:
int parsePrep(rpmSpec spec)
{
- int nextPart, res, rc;
+ int nextPart, rc, res = PART_ERROR;
ARGV_t saveLines = NULL;
if (spec->prep != NULL) {
@@ -505,17 +505,15 @@ int parsePrep(rpmSpec spec)
}
for (ARGV_const_t lines = saveLines; lines && *lines; lines++) {
- res = 0;
+ rc = RPMRC_OK;
if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
- res = doSetupMacro(spec, *lines);
+ rc = doSetupMacro(spec, *lines);
} else if (rstreqn(*lines, "%patch", sizeof("%patch")-1)) {
- res = doPatchMacro(spec, *lines);
+ rc = doPatchMacro(spec, *lines);
} else {
appendStringBuf(spec->prep, *lines);
}
- if (res && !(spec->flags & RPMSPEC_FORCE)) {
- /* fixup from RPMRC_FAIL do*Macro() codes for now */
- nextPart = PART_ERROR;
+ if (rc != RPMRC_OK && !(spec->flags & RPMSPEC_FORCE)) {
goto exit;
}
}
@@ -524,5 +522,5 @@ int parsePrep(rpmSpec spec)
exit:
argvFree(saveLines);
- return nextPart;
+ return res;
}