makechrootpkg: use var instead of file in $copydir

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
This commit is contained in:
Sébastien Luttringer 2013-03-02 05:21:12 +01:00 committed by Pierre Schmitz
parent 0c62649b64
commit 0dc2550af3
1 changed files with 4 additions and 7 deletions

View File

@ -22,6 +22,7 @@ run_namcap=false
chrootdir= chrootdir=
passeddir= passeddir=
declare -a install_pkgs declare -a install_pkgs
declare -i ret=0
default_copy=$USER default_copy=$USER
[[ -n $SUDO_USER ]] && default_copy=$SUDO_USER [[ -n $SUDO_USER ]] && default_copy=$SUDO_USER
@ -155,7 +156,6 @@ if [[ ! -d $copydir ]] || $clean_first; then
fi fi
if [[ -n "${install_pkgs[*]}" ]]; then if [[ -n "${install_pkgs[*]}" ]]; then
declare -i ret=0
for install_pkg in "${install_pkgs[@]}"; do for install_pkg in "${install_pkgs[@]}"; do
pkgname="${install_pkg##*/}" pkgname="${install_pkg##*/}"
cp "$install_pkg" "$copydir/$pkgname" cp "$install_pkg" "$copydir/$pkgname"
@ -272,9 +272,7 @@ cat >"$copydir/chrootbuild" <<EOF
export HOME=/build export HOME=/build
cd /build cd /build
sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED sudo -u nobody makepkg $makepkg_args || exit 1
[[ -f BUILD_FAILED ]] && exit 1
if $run_namcap; then if $run_namcap; then
pacman -S --needed --noconfirm namcap pacman -S --needed --noconfirm namcap
@ -308,7 +306,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
done done
else else
# Just in case. We returned 1, make sure we fail # Just in case. We returned 1, make sure we fail
touch "$copydir/build/BUILD_FAILED" ret=1
fi fi
for f in "$copydir"/srcdest/*; do for f in "$copydir"/srcdest/*; do
@ -316,7 +314,6 @@ for f in "$copydir"/srcdest/*; do
mv "$f" "$SRCDEST" mv "$f" "$SRCDEST"
done done
if [[ -e $copydir/build/BUILD_FAILED ]]; then if (( ret != 0 )); then
rm "$copydir/build/BUILD_FAILED"
die "Build failed, check $copydir/build" die "Build failed, check $copydir/build"
fi fi