offload-build: remove empty src dir when SRCDEST is set

Right now there is a bug in makepkg that leaves back an empty src
directory if SRCDEST is set. This is purely cosmetic, but lets just
politely try to rmdir it and fail silently if its empty or non-existent.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Levente Polyak 2019-11-07 22:28:17 +01:00
parent 6fffbfbc8a
commit 20eec484fa
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,10 @@ trap 'rm -rf $SRCPKGDEST' EXIT INT TERM QUIT
export SRCPKGDEST=$(mktemp -d)
makepkg --source || die "unable to make source package"
# Temporary cosmetic workaround makepkg if SRCDEST is set somewhere else
# but an empty src dir is created in PWD. Remove once fixed in makepkg.
rmdir --ignore-fail-on-non-empty src 2>/dev/null || true
mapfile -t files < <(
# This is sort of bash golfing but it allows running a mildly complex
# command over ssh with a single connection.