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. Signed-off-by: Erich Eckner <git@eckner.net>
This commit is contained in:
parent
7b09525003
commit
8310abb348
|
@ -250,18 +250,14 @@ download_sources() {
|
||||||
local copydir=$1
|
local copydir=$1
|
||||||
local makepkg_user=$2
|
local makepkg_user=$2
|
||||||
|
|
||||||
local builddir
|
setup_workdir
|
||||||
builddir="$(mktemp -d)"
|
chown "$makepkg_user:" "$WORKDIR"
|
||||||
chown "$makepkg_user:" "$builddir"
|
|
||||||
|
|
||||||
# Ensure sources are downloaded
|
# Ensure sources are downloaded
|
||||||
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
|
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 ||
|
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
|
||||||
die "Could not download sources."
|
die "Could not download sources."
|
||||||
|
|
||||||
# Clean up garbage from verifysource
|
|
||||||
rm -rf "$builddir"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: move_products $copydir $owner
|
# Usage: move_products $copydir $owner
|
||||||
|
|
Loading…
Reference in New Issue