diff options
author | Andreas Scherer <andreas_github@freenet.de> | 2018-11-26 15:50:15 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2018-11-27 13:00:53 +0200 |
commit | 76c429c3178c965c6517629957a633768132904c (patch) | |
tree | 4757f2b22cb136ec727febc20b6e5e14709d056a /build/parsePrep.c | |
parent | a22b5973bd3a86df3ac78dd2c684fd302ba94a12 (diff) | |
download | rpm-76c429c3178c965c6517629957a633768132904c.tar.gz |
Handle %setup archive unpack exit code centrally and consistently
Previously the exit code handling was missing from uncompressed tar-case.
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r-- | build/parsePrep.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index 07fc9a5eb..2141cef85 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -207,11 +207,7 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) } zipper = rpmGetPath(t, NULL); if (needtar) { - rasprintf(&buf, "%s '%s' | %s %s - \n" - "STATUS=$?\n" - "if [ $STATUS -ne 0 ]; then\n" - " exit $STATUS\n" - "fi", zipper, fn, tar, taropts); + rasprintf(&buf, "%s '%s' | %s %s -", zipper, fn, tar, taropts); } else if (needgemspec) { char *gem = rpmGetPath("%{__gem}", NULL); char *gemspec = NULL; @@ -220,20 +216,13 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) rstrlcpy(gemnameversion, sp->source, strlen(sp->source) - 3); gemspec = rpmGetPath("%{_builddir}/", gemnameversion, ".gemspec", NULL); - rasprintf(&buf, "%s '%s' && %s spec '%s' --ruby > '%s'\n" - "STATUS=$?\n" - "if [ $STATUS -ne 0 ]; then\n" - " exit $STATUS\n" - "fi", zipper, fn, gem, fn, gemspec); + rasprintf(&buf, "%s '%s' && %s spec '%s' --ruby > '%s'", + zipper, fn, gem, fn, gemspec); free(gemspec); free(gem); } else { - rasprintf(&buf, "%s '%s'\n" - "STATUS=$?\n" - "if [ $STATUS -ne 0 ]; then\n" - " exit $STATUS\n" - "fi", zipper, fn); + rasprintf(&buf, "%s '%s'", zipper, fn); } free(zipper); } else { @@ -243,7 +232,11 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) exit: free(fn); free(tar); - return buf; + return rstrcat(&buf, + "\nSTATUS=$?\n" + "if [ $STATUS -ne 0 ]; then\n" + " exit $STATUS\n" + "fi"); } /** |