diff --git a/archbuild b/archbuild
index 5518996..8c6f7c0 100755
--- a/archbuild
+++ b/archbuild
@@ -14,18 +14,21 @@ else
fi
chroots='/var/tmp/archbuild'
clean_first=false
+install_pkgs=()
usage() {
echo "usage $cmd"
echo ' -c Recreate the chroot before building'
echo ' -r
Create chroots in this directory'
+ echo ' -I Install into the clean chroot, supports multiple packages'
exit 1
}
-while getopts 'cr:' arg; do
+while getopts 'cr:I:' arg; do
case "${arg}" in
c) clean_first=true ;;
r) chroots="$OPTARG" ;;
+ I) install_pkgs+=("$OPTARG") ;;
*) usage ;;
esac
done
@@ -65,4 +68,12 @@ else
fi
echo "Building in chroot for [${repo}] (${arch})..."
-setarch "${arch}" makechrootpkg -c -r "${chroots}/${repo}-${arch}"
+if (( ${#install_pkgs[@]} )); then
+ setarch "${arch}" makechrootpkg -c -r "${chroots}/${repo}-${arch}" -I "${install_pkgs[0]}"
+ for install_pkg in "${install_pkgs[@]:1}"; do
+ setarch "${arch}" makechrootpkg -r "${chroots}/${repo}-${arch}" -I "${install_pkg}"
+ done
+ setarch "${arch}" makechrootpkg -r "${chroots}/${repo}-${arch}"
+else
+ setarch "${arch}" makechrootpkg -c -r "${chroots}/${repo}-${arch}"
+fi