Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/schedule-for-rebuild
diff options
context:
space:
mode:
Diffstat (limited to 'bin/schedule-for-rebuild')
-rwxr-xr-xbin/schedule-for-rebuild23
1 files changed, 19 insertions, 4 deletions
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