index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Tasos Sahanidis <tasos@tasossah.com> | 2024-02-07 10:33:44 +0200 |
---|---|---|
committer | Tasos Sahanidis <tasos@tasossah.com> | 2024-02-07 10:33:44 +0200 |
commit | fbf85d32f9efd43df8032de71c295b1648e98300 (patch) | |
tree | 1289b1f130f33a156329b9ba421ff96d2fafab22 | |
parent | 4231d5d4f5fd903a20021eece669996d814babd5 (diff) |
-rwxr-xr-x | bin/schedule-for-rebuild | 23 |
diff --git a/bin/schedule-for-rebuild b/bin/schedule-for-rebuild index de2d733..d8dae5c 100755 --- a/bin/schedule-for-rebuild +++ b/bin/schedule-for-rebuild @@ -49,6 +49,8 @@ usage() { >&2 echo ' Schedule packages with matching pkgname or pkgbase.' >&2 echo ' -s|--skip-arch $arch:' >&2 echo ' Ignore packages, that are outdated on $arch only (-a).' + >&2 echo ' -t|--interactive' + >&2 echo ' Ask which of the matching packages to schedule for rebuild.' >&2 echo ' -w|--wait:' >&2 echo ' Wait for lock if necessary.' [ -z "$1" ] && exit 1 || exit "$1" @@ -59,7 +61,7 @@ tmp_dir=$(mktemp -d 'tmp.schedule-for-rebuild.XXXXXXXXXX' --tmpdir) trap "rm -rf --one-file-system '${tmp_dir:?}'" EXIT eval set -- "$( - getopt -o afhi:jnp:s:w \ + getopt -o afhi:jnp:s:tw \ --long auto \ --long force \ --long help \ @@ -68,6 +70,7 @@ eval set -- "$( --long no-action \ --long package: \ --long skip-arch: \ + --long interactive \ --long wait \ -n "$(basename "$0")" -- "$@" || \ echo usage @@ -77,6 +80,7 @@ auto=false ignore_mysql_generate_package_metadata_errors=false jostle=false update=true +interactive=false wait_for_lock='-n' while true @@ -117,6 +121,9 @@ do printf '%s\n' "$1" >> \ "${tmp_dir}/skip-archs" ;; + -t|--interactive) + interactive=true + ;; -w|--wait) wait_for_lock='' ;; @@ -470,11 +477,20 @@ fi sort -u "${tmp_dir}/pkgbases" \ | sponge "${tmp_dir}/pkgbases" -# get the current HEADs +if ${interactive}; then + echo "Which packages to rebuild? (Comma separated; Empty means all)" + nl "${tmp_dir}/pkgbases" + read -p "Choice: " pkg_rebuild_choice + + if [ -n "$pkg_rebuild_choice" ]; then + readarray -td, pkg_rebuild_choice_array < <( printf '%s' "$pkg_rebuild_choice" | sed 's/\s//g;s/,\{2,\}/,/g' ) + sed -i -n "$(printf "%sp;" "${pkg_rebuild_choice_array[@]}")" "${tmp_dir}/pkgbases" + fi +fi +# get the current HEADs if ${update}; then cut -d' ' -f 2,3,4,5 "${tmp_dir}/pkgbases" \ - | sort -u \ | while read -r pkgbase git_rev git_mod_rev repo; do success=false # shellcheck disable=SC2154 @@ -487,7 +503,6 @@ if ${update}; then done cut -d' ' -f2 "${tmp_dir}/pkgbases" \ - | sort -u \ | sponge "${tmp_dir}/pkgbases" # shellcheck disable=SC2016 |