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-05-31 16:09:42 +0200
commit9810581c7df43eed3d8b60c38b369dc9baaad1e4 (patch)
tree1eab88aad6c47da378599ff928206e80dba64bec /makechrootpkg.in
parentd830abdfe5e41706aedb0ff5c4df5099a3feee54 (diff)
downloaddevtools32-9810581c7df43eed3d8b60c38b369dc9baaad1e4.tar.xz
remove empty tree if "--verifysource" failed
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