2007-11-28 16:10:41 +01:00
|
|
|
#!/bin/bash
|
2007-10-22 04:08:55 +02:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-10-04 06:24:29 +02:00
|
|
|
|
2011-11-01 15:33:08 +01:00
|
|
|
m4_include(lib/common.sh)
|
|
|
|
|
2011-09-17 15:14:08 +02:00
|
|
|
shopt -s nullglob
|
|
|
|
|
2011-09-27 06:42:14 +02:00
|
|
|
makepkg_args='-s --noconfirm -L'
|
2011-09-17 14:46:10 +02:00
|
|
|
repack=false
|
|
|
|
update_first=false
|
|
|
|
clean_first=false
|
|
|
|
install_pkg=
|
2011-09-17 15:59:57 +02:00
|
|
|
run_namcap=false
|
2013-03-14 03:55:40 +01:00
|
|
|
temp_chroot=false
|
2011-09-17 14:46:10 +02:00
|
|
|
chrootdir=
|
2012-01-02 03:38:20 +01:00
|
|
|
passeddir=
|
2013-03-02 05:21:08 +01:00
|
|
|
declare -a install_pkgs
|
2013-03-02 05:21:12 +01:00
|
|
|
declare -i ret=0
|
2007-10-04 06:24:29 +02:00
|
|
|
|
2013-03-14 03:55:40 +01:00
|
|
|
copy=$USER
|
|
|
|
[[ -n $SUDO_USER ]] && copy=$SUDO_USER
|
|
|
|
[[ -z "$copy" || $copy = root ]] && copy=copy
|
2012-08-11 12:17:56 +02:00
|
|
|
src_owner=${SUDO_USER:-$USER}
|
2011-03-13 19:07:04 +01:00
|
|
|
|
2010-02-13 19:47:16 +01:00
|
|
|
usage() {
|
2012-11-15 15:22:50 +01:00
|
|
|
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
|
2010-02-13 19:47:16 +01:00
|
|
|
echo ' Run this script in a PKGBUILD dir to build a package inside a'
|
|
|
|
echo ' clean chroot. All unrecognized arguments passed to this script'
|
|
|
|
echo ' will be passed to makepkg.'
|
|
|
|
echo ''
|
|
|
|
echo ' The chroot dir consists of the following directories:'
|
|
|
|
echo ' <chrootdir>/{root, copy} but only "root" is required'
|
|
|
|
echo ' by default. The working copy will be created as needed'
|
|
|
|
echo ''
|
|
|
|
echo 'The chroot "root" directory must be created via the following'
|
|
|
|
echo 'command:'
|
2013-03-14 03:55:39 +01:00
|
|
|
echo ' mkarchroot <chrootdir>/root base-devel'
|
2010-02-13 19:47:16 +01:00
|
|
|
echo ''
|
2011-09-17 14:46:10 +02:00
|
|
|
echo "Default makepkg args: $makepkg_args"
|
2010-02-13 19:47:16 +01:00
|
|
|
echo ''
|
|
|
|
echo 'Flags:'
|
|
|
|
echo '-h This help'
|
|
|
|
echo '-c Clean the chroot before building'
|
|
|
|
echo '-u Update the working copy of the chroot before building'
|
|
|
|
echo ' This is useful for rebuilds without dirtying the pristine'
|
|
|
|
echo ' chroot'
|
|
|
|
echo '-r <dir> The chroot dir to use'
|
|
|
|
echo '-I <pkg> Install a package into the working copy of the chroot'
|
|
|
|
echo '-l <copy> The directory to use as the working copy of the chroot'
|
2013-03-14 03:55:40 +01:00
|
|
|
echo ' Useful for maintaining multiple copies'
|
|
|
|
echo " Default: $copy"
|
2011-12-30 16:26:08 +01:00
|
|
|
echo '-n Run namcap on the package'
|
2013-03-14 03:55:40 +01:00
|
|
|
echo '-T Build in a temporary directory'
|
2010-02-13 19:47:16 +01:00
|
|
|
exit 1
|
2007-10-04 06:24:29 +02:00
|
|
|
}
|
|
|
|
|
2013-05-02 07:22:58 +02:00
|
|
|
while getopts 'hcur:I:l:nT' arg; do
|
2011-09-17 14:46:10 +02:00
|
|
|
case "$arg" in
|
2010-02-13 19:47:16 +01:00
|
|
|
h) usage ;;
|
2011-09-17 14:46:10 +02:00
|
|
|
c) clean_first=true ;;
|
|
|
|
u) update_first=true ;;
|
2012-01-02 03:38:20 +01:00
|
|
|
r) passeddir="$OPTARG" ;;
|
2013-03-02 05:21:08 +01:00
|
|
|
I) install_pkgs+=("$OPTARG") ;;
|
2011-03-13 19:07:04 +01:00
|
|
|
l) copy="$OPTARG" ;;
|
2012-03-05 16:28:09 +01:00
|
|
|
n) run_namcap=true; makepkg_args="$makepkg_args -i" ;;
|
2013-03-14 03:55:40 +01:00
|
|
|
T) temp_chroot=true; copy+="-$RANDOM" ;;
|
2011-09-17 14:46:10 +02:00
|
|
|
*) makepkg_args="$makepkg_args -$arg $OPTARG" ;;
|
2010-02-13 19:47:16 +01:00
|
|
|
esac
|
2007-10-04 06:24:29 +02:00
|
|
|
done
|
|
|
|
|
2011-03-13 17:57:28 +01:00
|
|
|
# Canonicalize chrootdir, getting rid of trailing /
|
2012-01-02 03:38:20 +01:00
|
|
|
chrootdir=$(readlink -e "$passeddir")
|
2011-03-13 17:57:28 +01:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ ${copy:0:1} = / ]]; then
|
2011-07-25 20:28:31 +02:00
|
|
|
copydir=$copy
|
|
|
|
else
|
|
|
|
copydir="$chrootdir/$copy"
|
|
|
|
fi
|
2007-12-16 02:57:39 +01:00
|
|
|
|
2007-11-05 00:01:22 +01:00
|
|
|
# Pass all arguments after -- right to makepkg
|
2011-09-17 14:46:10 +02:00
|
|
|
makepkg_args="$makepkg_args ${*:$OPTIND}"
|
2007-11-05 00:01:22 +01:00
|
|
|
|
2008-01-16 14:12:38 +01:00
|
|
|
# See if -R was passed to makepkg
|
|
|
|
for arg in ${*:$OPTIND}; do
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ $arg = -R ]]; then
|
2011-11-08 21:50:08 +01:00
|
|
|
repack=true
|
2011-09-17 14:46:10 +02:00
|
|
|
break
|
2010-02-13 19:47:16 +01:00
|
|
|
fi
|
2008-01-16 14:12:38 +01:00
|
|
|
done
|
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
if (( EUID )); then
|
2011-11-01 15:33:08 +01:00
|
|
|
die 'This script must be run as root.'
|
2007-11-28 00:54:58 +01:00
|
|
|
fi
|
|
|
|
|
2013-03-02 05:21:08 +01:00
|
|
|
if [[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]]; then
|
2011-11-01 15:33:08 +01:00
|
|
|
die 'This must be run in a directory containing a PKGBUILD.'
|
2007-11-28 00:54:58 +01:00
|
|
|
fi
|
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ ! -d $chrootdir ]]; then
|
2012-01-02 03:38:20 +01:00
|
|
|
die "No chroot dir defined, or invalid path '$passeddir'"
|
2007-10-04 06:24:29 +02:00
|
|
|
fi
|
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ ! -d $chrootdir/root ]]; then
|
2013-03-14 03:55:39 +01:00
|
|
|
die "Missing chroot dir root directory. Try using: mkarchroot $chrootdir/root base-devel"
|
2007-10-04 06:24:29 +02:00
|
|
|
fi
|
|
|
|
|
2010-02-13 07:22:54 +01:00
|
|
|
umask 0022
|
2011-03-13 19:06:27 +01:00
|
|
|
|
2013-03-14 03:55:41 +01:00
|
|
|
# Detect chrootdir filesystem type
|
|
|
|
chroottype=$(stat -f -c %T "$chrootdir")
|
|
|
|
|
2011-03-13 19:06:27 +01:00
|
|
|
# Lock the chroot we want to use. We'll keep this lock until we exit.
|
2013-05-02 07:03:12 +02:00
|
|
|
lock 9 "$copydir.lock" "Locking chroot copy [$copy]"
|
2011-03-13 19:06:27 +01:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ ! -d $copydir ]] || $clean_first; then
|
2011-03-13 19:06:27 +01:00
|
|
|
# Get a read lock on the root chroot to make
|
|
|
|
# sure we don't clone a half-updated chroot
|
2013-05-02 07:03:12 +02:00
|
|
|
slock 8 "$chrootdir/root.lock" "Locking clean chroot"
|
2011-03-13 19:06:27 +01:00
|
|
|
|
2013-03-02 05:21:09 +01:00
|
|
|
stat_busy "Creating clean working copy [$copy]"
|
2013-03-02 05:21:10 +01:00
|
|
|
if [[ "$chroottype" == btrfs ]]; then
|
|
|
|
if [[ -d $copydir ]]; then
|
|
|
|
btrfs subvolume delete "$copydir" >/dev/null ||
|
|
|
|
die "Unable to delete subvolume $copydir"
|
|
|
|
fi
|
|
|
|
btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null ||
|
|
|
|
die "Unable to create subvolume $copydir"
|
2011-03-13 15:19:20 +01:00
|
|
|
else
|
|
|
|
mkdir -p "$copydir"
|
|
|
|
rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir"
|
|
|
|
fi
|
2011-11-01 15:33:08 +01:00
|
|
|
stat_done
|
2011-03-13 19:06:27 +01:00
|
|
|
|
|
|
|
# Drop the read lock again
|
|
|
|
exec 8>&-
|
2008-02-06 06:59:52 +01:00
|
|
|
fi
|
2007-10-04 06:24:29 +02:00
|
|
|
|
2013-03-02 05:21:08 +01:00
|
|
|
if [[ -n "${install_pkgs[*]}" ]]; then
|
|
|
|
for install_pkg in "${install_pkgs[@]}"; do
|
|
|
|
pkgname="${install_pkg##*/}"
|
|
|
|
cp "$install_pkg" "$copydir/$pkgname"
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2013-05-02 05:24:28 +02:00
|
|
|
arch-nspawn "$copydir" pacman -U /$pkgname --noconfirm
|
2013-03-02 05:21:08 +01:00
|
|
|
(( ret += !! $? ))
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2013-03-02 05:21:08 +01:00
|
|
|
rm "$copydir/$pkgname"
|
|
|
|
done
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2013-01-02 01:42:45 +01:00
|
|
|
# If there is no PKGBUILD we have done
|
|
|
|
[[ -f PKGBUILD ]] || exit $ret
|
2008-04-22 06:13:47 +02:00
|
|
|
fi
|
|
|
|
|
2013-05-02 05:24:28 +02:00
|
|
|
$update_first && arch-nspawn "$copydir" pacman -Syu --noconfirm
|
2009-02-23 23:30:28 +01:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
mkdir -p "$copydir/build"
|
2007-12-16 02:57:39 +01:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
# Remove anything in there UNLESS -R (repack) was passed to makepkg
|
|
|
|
$repack || rm -rf "$copydir"/build/*
|
2008-01-16 14:12:38 +01:00
|
|
|
|
2011-10-29 20:37:28 +02:00
|
|
|
# Read .makepkg.conf and .gnupg/pubring.gpg even if called via sudo
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ -n $SUDO_USER ]]; then
|
2011-10-29 20:37:28 +02:00
|
|
|
SUDO_HOME="$(eval echo ~$SUDO_USER)"
|
|
|
|
makepkg_conf="$SUDO_HOME/.makepkg.conf"
|
|
|
|
if [[ -r "$SUDO_HOME/.gnupg/pubring.gpg" ]]; then
|
|
|
|
install -D "$SUDO_HOME/.gnupg/pubring.gpg" "$copydir/build/.gnupg/pubring.gpg"
|
|
|
|
fi
|
2010-08-18 21:43:27 +02:00
|
|
|
else
|
2011-09-17 14:46:10 +02:00
|
|
|
makepkg_conf="$HOME/.makepkg.conf"
|
2011-10-29 20:37:28 +02:00
|
|
|
if [[ -r "$HOME/.gnupg/pubring.gpg" ]]; then
|
|
|
|
install -D "$HOME/.gnupg/pubring.gpg" "$copydir/build/.gnupg/pubring.gpg"
|
|
|
|
fi
|
2010-08-18 21:43:27 +02:00
|
|
|
fi
|
|
|
|
|
2009-12-16 19:54:59 +01:00
|
|
|
# Get SRC/PKGDEST from makepkg.conf
|
2011-09-17 14:46:10 +02:00
|
|
|
if [[ -f $makepkg_conf ]]; then
|
|
|
|
eval $(grep '^SRCDEST=' "$makepkg_conf")
|
|
|
|
eval $(grep '^PKGDEST=' "$makepkg_conf")
|
|
|
|
eval $(grep '^MAKEFLAGS=' "$makepkg_conf")
|
|
|
|
eval $(grep '^PACKAGER=' "$makepkg_conf")
|
2010-07-01 16:51:43 +02:00
|
|
|
fi
|
2009-12-16 19:54:59 +01:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
[[ -z $SRCDEST ]] && eval $(grep '^SRCDEST=' /etc/makepkg.conf)
|
|
|
|
[[ -z $PKGDEST ]] && eval $(grep '^PKGDEST=' /etc/makepkg.conf)
|
|
|
|
[[ -z $MAKEFLAGS ]] && eval $(grep '^MAKEFLAGS=' /etc/makepkg.conf)
|
|
|
|
[[ -z $PACKAGER ]] && eval $(grep '^PACKAGER=' /etc/makepkg.conf)
|
|
|
|
|
2011-09-17 15:05:35 +02:00
|
|
|
# Use PKGBUILD directory if PKGDEST or SRCDEST don't exist
|
|
|
|
[[ -d $PKGDEST ]] || PKGDEST=.
|
|
|
|
[[ -d $SRCDEST ]] || SRCDEST=.
|
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
mkdir -p "$copydir/pkgdest"
|
|
|
|
if ! grep -q 'PKGDEST="/pkgdest"' "$copydir/etc/makepkg.conf"; then
|
2010-08-18 21:43:27 +02:00
|
|
|
echo 'PKGDEST="/pkgdest"' >> "$copydir/etc/makepkg.conf"
|
2007-12-16 02:57:39 +01:00
|
|
|
fi
|
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
mkdir -p "$copydir/srcdest"
|
|
|
|
if ! grep -q 'SRCDEST="/srcdest"' "$copydir/etc/makepkg.conf"; then
|
2010-08-18 21:43:27 +02:00
|
|
|
echo 'SRCDEST="/srcdest"' >> "$copydir/etc/makepkg.conf"
|
2007-12-16 02:57:39 +01:00
|
|
|
fi
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2012-10-27 09:51:36 +02:00
|
|
|
if [[ -n $MAKEFLAGS ]]; then
|
2011-09-17 14:46:10 +02:00
|
|
|
sed -i '/^MAKEFLAGS=/d' "$copydir/etc/makepkg.conf"
|
|
|
|
echo "MAKEFLAGS='${MAKEFLAGS}'" >> "$copydir/etc/makepkg.conf"
|
2011-03-18 08:49:37 +01:00
|
|
|
fi
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2012-10-27 09:51:36 +02:00
|
|
|
if [[ -n $PACKAGER ]]; then
|
2011-09-17 14:46:10 +02:00
|
|
|
sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf"
|
|
|
|
echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf"
|
2011-03-18 08:49:37 +01:00
|
|
|
fi
|
2007-12-16 02:57:39 +01:00
|
|
|
|
2010-05-02 15:23:54 +02:00
|
|
|
# Set target CARCH as it might be used within the PKGBUILD to select correct sources
|
2010-08-18 21:43:27 +02:00
|
|
|
eval $(grep '^CARCH=' "$copydir/etc/makepkg.conf")
|
|
|
|
export CARCH
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2007-12-16 02:57:39 +01:00
|
|
|
# Copy PKGBUILD and sources
|
2010-02-11 10:26:45 +01:00
|
|
|
cp PKGBUILD "$copydir/build/"
|
2011-09-17 14:46:10 +02:00
|
|
|
(
|
|
|
|
source PKGBUILD
|
2011-09-17 15:50:30 +02:00
|
|
|
for file in "${source[@]}"; do
|
|
|
|
file="${file%%::*}"
|
|
|
|
file="${file##*://*/}"
|
|
|
|
if [[ -f $file ]]; then
|
|
|
|
cp "$file" "$copydir/srcdest/"
|
|
|
|
elif [[ -f $SRCDEST/$file ]]; then
|
|
|
|
cp "$SRCDEST/$file" "$copydir/srcdest/"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Find all changelog and install files, even inside functions
|
2011-10-31 12:43:16 +01:00
|
|
|
for i in 'changelog' 'install'; do
|
|
|
|
while read -r file; do
|
2011-09-17 14:46:10 +02:00
|
|
|
# evaluate any bash variables used
|
2011-10-31 12:43:16 +01:00
|
|
|
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
|
2011-09-17 14:46:10 +02:00
|
|
|
[[ -f $file ]] && cp "$file" "$copydir/build/"
|
2011-10-31 12:43:16 +01:00
|
|
|
done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
|
2010-06-28 09:48:21 +02:00
|
|
|
done
|
2010-08-20 11:55:33 +02:00
|
|
|
)
|
2008-04-14 18:19:33 +02:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
chown -R nobody "$copydir"/{build,pkgdest,srcdest}
|
2009-12-27 11:42:11 +01:00
|
|
|
|
2011-10-29 20:37:28 +02:00
|
|
|
cat > "$copydir/etc/sudoers.d/nobody-pacman" <<EOF
|
|
|
|
Defaults env_keep += "HOME"
|
|
|
|
nobody ALL = NOPASSWD: /usr/bin/pacman
|
|
|
|
EOF
|
2010-12-09 12:51:47 +01:00
|
|
|
chmod 440 "$copydir/etc/sudoers.d/nobody-pacman"
|
2007-10-07 19:31:22 +02:00
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
# This is a little gross, but this way the script is recreated every time in the
|
|
|
|
# working copy
|
|
|
|
cat >"$copydir/chrootbuild" <<EOF
|
2007-10-07 19:31:22 +02:00
|
|
|
#!/bin/bash
|
2011-12-03 07:26:42 +01:00
|
|
|
. /etc/profile
|
2008-03-17 18:55:24 +01:00
|
|
|
export HOME=/build
|
2011-09-17 14:46:10 +02:00
|
|
|
|
|
|
|
cd /build
|
2013-03-02 05:21:12 +01:00
|
|
|
sudo -u nobody makepkg $makepkg_args || exit 1
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2011-09-17 15:59:57 +02:00
|
|
|
if $run_namcap; then
|
|
|
|
pacman -S --needed --noconfirm namcap
|
2011-11-06 10:31:37 +01:00
|
|
|
for pkgfile in /build/PKGBUILD /pkgdest/*.pkg.tar.?z; do
|
|
|
|
echo "Checking \${pkgfile##*/}"
|
2012-10-03 12:32:55 +02:00
|
|
|
sudo -u nobody namcap "\$pkgfile" 2>&1 | tee "/build/\${pkgfile##*/}-namcap.log"
|
2011-11-06 10:31:37 +01:00
|
|
|
done
|
2011-09-17 15:59:57 +02:00
|
|
|
fi
|
2011-09-17 14:46:10 +02:00
|
|
|
|
2009-03-09 20:24:43 +01:00
|
|
|
exit 0
|
2007-10-04 06:24:29 +02:00
|
|
|
EOF
|
2010-02-11 10:26:45 +01:00
|
|
|
chmod +x "$copydir/chrootbuild"
|
2007-10-04 06:24:29 +02:00
|
|
|
|
2013-05-02 05:24:28 +02:00
|
|
|
if arch-nspawn "$copydir" /chrootbuild; then
|
2011-11-06 10:31:37 +01:00
|
|
|
for pkgfile in "$copydir"/pkgdest/*.pkg.tar.?z; do
|
2012-08-11 12:17:56 +02:00
|
|
|
chown "$src_owner" "$pkgfile"
|
2011-09-17 15:05:35 +02:00
|
|
|
mv "$pkgfile" "$PKGDEST"
|
2010-02-13 19:47:16 +01:00
|
|
|
done
|
|
|
|
|
2011-11-06 10:31:37 +01:00
|
|
|
for l in "$copydir"/build/*-{build,check,namcap,package,package_*}.log; do
|
2012-08-11 12:17:56 +02:00
|
|
|
chown "$src_owner" "$l"
|
2011-09-17 14:56:49 +02:00
|
|
|
[[ -f $l ]] && mv "$l" .
|
2010-02-13 19:47:16 +01:00
|
|
|
done
|
2009-02-25 19:11:39 +01:00
|
|
|
else
|
2011-09-17 14:46:10 +02:00
|
|
|
# Just in case. We returned 1, make sure we fail
|
2013-03-02 05:21:12 +01:00
|
|
|
ret=1
|
2008-04-22 05:56:58 +02:00
|
|
|
fi
|
|
|
|
|
2011-09-17 14:46:10 +02:00
|
|
|
for f in "$copydir"/srcdest/*; do
|
2012-08-11 12:17:56 +02:00
|
|
|
chown "$src_owner" "$f"
|
2011-09-17 15:05:35 +02:00
|
|
|
mv "$f" "$SRCDEST"
|
2010-03-03 21:49:22 +01:00
|
|
|
done
|
|
|
|
|
2013-03-14 03:55:40 +01:00
|
|
|
if $temp_chroot; then
|
|
|
|
stat_busy "Removing temporary directoy [$copy]"
|
|
|
|
if [[ "$chroottype" == btrfs ]]; then
|
|
|
|
btrfs subvolume delete "$copydir" >/dev/null ||
|
|
|
|
die "Unable to delete subvolume $copydir"
|
|
|
|
else
|
|
|
|
# avoid change of filesystem in case of an umount failure
|
|
|
|
rm --recursive --force --one-file-system "$copydir" ||
|
|
|
|
die "Unable to delete $copydir"
|
|
|
|
fi
|
|
|
|
# remove lock file
|
|
|
|
rm --force "$copydir.lock"
|
|
|
|
stat_done
|
|
|
|
elif (( ret != 0 )); then
|
2011-11-01 15:33:08 +01:00
|
|
|
die "Build failed, check $copydir/build"
|
2013-03-14 03:55:40 +01:00
|
|
|
else
|
|
|
|
true
|
2010-02-13 19:47:16 +01:00
|
|
|
fi
|