Commit cc61bb84 authored by Seblu's avatar Seblu

archbuild: Build without updating the root chroot

Useful when you need to build with an outdated package version or repackage
parent 8c22a991
......@@ -17,11 +17,13 @@ else
fi
chroots='/var/lib/archbuild'
clean_first=false
update=true
usage() {
echo "Usage: $cmd [options] -- [makechrootpkg args]"
echo ' -h This help'
echo ' -c Recreate the chroot before building'
echo ' -U Do not update chroots before building'
echo ' -r <dir> Create chroots in this directory'
echo ''
echo "Default makechrootpkg args: ${makechrootpkg_args[*]}"
......@@ -31,9 +33,11 @@ usage() {
orig_argv=("$@")
while getopts 'hcr:' arg; do
while getopts 'hcr:U' arg; do
case "${arg}" in
c) clean_first=true ;;
U) update=false
makechrootpkg_args=(-n) ;;
r) chroots="$OPTARG" ;;
*) usage ;;
esac
......@@ -67,7 +71,9 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
-M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" || abort
else
elif $update; then
msg "Updating chroot for [${repo}] (${arch})..."
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
arch-nspawn \
-C "@pkgdatadir@/pacman-${repo}.conf" \
......
......@@ -4,6 +4,7 @@ m4_include(lib/valid-tags.sh)
_archbuild_args=(
'-c[Recreate the chroot before building]'
'-U[Do not update chroots before building]'
'-r[Create chroots in this directory]:base_dir:_files -/'
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment