summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-07-31 20:37:42 +0200
committerErich Eckner <git@eckner.net>2018-06-27 08:37:47 +0200
commitddbcfa0c2dfc7b6a95690767e436c8b52b5adcba (patch)
tree5dab276882e2068d0a166386a80113ec172b1bed /makechrootpkg.in
parent6364b3c9b9fae2b43bf3e02b9e84c814fc3f502f (diff)
downloaddevtools-ddbcfa0c2dfc7b6a95690767e436c8b52b5adcba.tar.xz
remove empty tree if "--verifysource" failed
makechrootpkg's download_sources() leaves a stray directory if "makepkg --verifysource" failed. We use "setup_workdir" instead of "mktemp -d", because this ensures the correct garbage collection.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in10
1 files changed, 3 insertions, 7 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index d81be84..4b72a36 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -250,18 +250,14 @@ download_sources() {
local copydir=$1
local makepkg_user=$2
- local builddir
- builddir="$(mktemp -d)"
- chown "$makepkg_user:" "$builddir"
+ setup_workdir
+ chown "$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