From cc61bb84025ee9f7f240a64e781a5b71943e4295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Sun, 19 Jul 2015 01:09:19 +0200 Subject: [PATCH] archbuild: Build without updating the root chroot Useful when you need to build with an outdated package version or repackage --- archbuild.in | 10 ++++++++-- zsh_completion.in | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/archbuild.in b/archbuild.in index 9c5d706..cdfca59 100644 --- a/archbuild.in +++ b/archbuild.in @@ -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 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" \ diff --git a/zsh_completion.in b/zsh_completion.in index 4c6dd99..f9687d6 100644 --- a/zsh_completion.in +++ b/zsh_completion.in @@ -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 -/' ) -- GitLab