diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 10:24:22 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 10:24:22 +0300 |
commit | 6e1e700a251cd91b1177b56ae74fc52ea18b0432 (patch) | |
tree | c8e94919baaa60f1acbc789e2e314b5b2debedd2 /build | |
parent | e0787e828b0a73b96d8928586d5a15d30a3c61cb (diff) | |
download | rpm-6e1e700a251cd91b1177b56ae74fc52ea18b0432.tar.gz rpm-6e1e700a251cd91b1177b56ae74fc52ea18b0432.tar.bz2 rpm-6e1e700a251cd91b1177b56ae74fc52ea18b0432.zip |
Make parsePrep() return PART_ERROR on errors
Diffstat (limited to 'build')
-rw-r--r-- | build/parsePrep.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index ff51ff5e2..e64080992 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -510,7 +510,7 @@ int parsePrep(rpmSpec spec) if (spec->prep != NULL) { rpmlog(RPMLOG_ERR, _("line %d: second %%prep\n"), spec->lineNum); - return RPMRC_FAIL; + return PART_ERROR; } spec->prep = newStringBuf(); @@ -518,9 +518,9 @@ int parsePrep(rpmSpec spec) /* There are no options to %prep */ if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { return PART_NONE; + } else if (rc < 0) { + return PART_ERROR; } - if (rc) - return rc; sb = newStringBuf(); @@ -531,9 +531,9 @@ int parsePrep(rpmSpec spec) if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { nextPart = PART_NONE; break; + } else if (rc < 0) { + goto exit; } - if (rc) - return rc; } argvSplit(&saveLines, getStringBuf(sb), "\n"); @@ -547,12 +547,14 @@ int parsePrep(rpmSpec spec) appendLineStringBuf(spec->prep, *lines); } if (res && !spec->force) { - argvFree(saveLines); - sb = freeStringBuf(sb); - return res; + /* fixup from RPMRC_FAIL do*Macro() codes for now */ + res = PART_ERROR; + goto exit; } } + res = nextPart; +exit: argvFree(saveLines); sb = freeStringBuf(sb); |