summaryrefslogtreecommitdiff
path: root/archbuild.in
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-04-24 11:03:38 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-04-24 11:03:38 -0400
commit7eadec0ab1c0c09c4d940b20d6f88f81a4ab149e (patch)
tree6e1d88dcf869bf567f852c3ea169ff79a8b31ed5 /archbuild.in
parent7358ca574bf6fd133a5d883f2da6e359335ac830 (diff)
parent280d5501b00945fdf4e8de13724ec22b87a41576 (diff)
downloaddevtools32-7eadec0ab1c0c09c4d940b20d6f88f81a4ab149e.tar.xz
Merge commit '280d55' into complete
Diffstat (limited to 'archbuild.in')
-rw-r--r--archbuild.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/archbuild.in b/archbuild.in
index a41d490..a343bec 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -3,6 +3,7 @@
m4_include(lib/common.sh)
base_packages=(base base-devel sudo)
+makechrootpkg_args=(-c -n)
cmd="${0##*/}"
if [[ "${cmd%%-*}" == 'multilib' ]]; then
@@ -18,13 +19,17 @@ chroots='/var/lib/archbuild'
clean_first=false
usage() {
- echo "Usage: $cmd"
+ echo "Usage: $cmd [options] -- [makechrootpkg args]"
+ echo ' -h This help'
echo ' -c Recreate the chroot before building'
echo ' -r <dir> Create chroots in this directory'
+ echo ''
+ echo "Default makechrootpkg args: ${makechrootpkg_args[*]}"
+ echo ''
exit 1
}
-while getopts 'cr:' arg; do
+while getopts 'hcr:' arg; do
case "${arg}" in
c) clean_first=true ;;
r) chroots="$OPTARG" ;;
@@ -32,7 +37,10 @@ while getopts 'cr:' arg; do
esac
done
-if [[ "$EUID" != '0' ]]; then
+# Pass all arguments after -- right to makepkg
+makechrootpkg_args+=("${@:$OPTIND}")
+
+if (( EUID )); then
die 'This script must be run as root.'
fi
@@ -66,4 +74,4 @@ else
fi
msg "Building in chroot for [${repo}] (${arch})..."
-exec setarch "${arch}" makechrootpkg -c -n -r "${chroots}/${repo}-${arch}"
+exec setarch "${arch}" makechrootpkg "${makechrootpkg_args[@]}" -r "${chroots}/${repo}-${arch}"