From 20eec484fadd7212367749ee7cd37d3aa18e8c4e Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Thu, 7 Nov 2019 22:28:17 +0100 Subject: [PATCH] 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 --- offload-build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/offload-build b/offload-build index 688adf3..dab036d 100755 --- a/offload-build +++ b/offload-build @@ -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.