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.
This commit is contained in:
parent
af0e201fbd
commit
fa053f4dd8
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue