From e4aafd20dfff71c41b46c86b88d0bb0090e24d89 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 31 Jul 2017 20:37:42 +0200 Subject: remove empty tree if "--verifysource" failed --- makechrootpkg.in | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'makechrootpkg.in') 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 -- cgit v1.2.3-70-g09d2