makepkg: only run --clean actions if we built a package

Fixes issue where users were allowed to run cleanup while running
--geninteg or --printsrcinfo or --packagelist, thus mixing invalid
responses into stdout.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2019-10-28 11:37:39 -04:00 committed by Allan McRae
parent 0272fca993
commit 5c2059db28

View file

@ -133,7 +133,7 @@ clean_up() {
rm "$logpipe"
fi
if (( (EXIT_CODE == E_OK || EXIT_CODE == E_INSTALL_FAILED) && CLEANUP )); then
if (( (EXIT_CODE == E_OK || EXIT_CODE == E_INSTALL_FAILED) && BUILDPKG && CLEANUP )); then
local pkg file
# If it's a clean exit and -c/--clean has been passed...