summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-07-31 20:37:42 +0200
committerErich Eckner <git@eckner.net>2018-05-16 16:39:44 +0200
commite4aafd20dfff71c41b46c86b88d0bb0090e24d89 (patch)
tree7df4f9e887b2bb0c87507fada36f2f5b76b1a283
parent7bc982317f7398c26c62b261f19e9582add6dce8 (diff)
downloaddevtools32-e4aafd20dfff71c41b46c86b88d0bb0090e24d89.tar.xz
remove empty tree if "--verifysource" failed
-rw-r--r--makechrootpkg.in10
1 files changed, 3 insertions, 7 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index bfc447a..c451443 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -249,18 +249,14 @@ download_sources() {
local copydir=$1
local makepkg_user=$2
- local builddir
- builddir="$(mktemp -d)"
- chown "$makepkg_user:$makepkg_user" "$builddir"
+ setup_workdir
+ chown "$makepkg_user:$makepkg_user" "$WORKDIR"
# Ensure sources are downloaded
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
- env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
+ env SRCDEST="$SRCDEST" BUILDDIR="$WORKDIR" \
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
die "Could not download sources."
-
- # Clean up garbage from verifysource
- rm -rf "$builddir"
}
# Usage: move_products $copydir $owner