From 28ad985db23c849db7692580963eee85545fbf60 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 20 Feb 2020 15:43:05 +0100 Subject: bin/seed-build-list: -s|--skip-arch new --- bin/seed-build-list | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/seed-build-list b/bin/seed-build-list index 1d01545..219e45a 100755 --- a/bin/seed-build-list +++ b/bin/seed-build-list @@ -54,6 +54,8 @@ usage() { >&2 echo ' -p|--package $pkg_regex:' >&2 echo ' Reschedule packages with matching pkgname or pkgbase.' >&2 echo ' Note, that these packages must be known to the database.' + >&2 echo ' -s|--skip-arch $arch:' + >&2 echo ' Ignore packages, that are outdated on $arch only (-m).' >&2 echo ' -w|--wait:' >&2 echo ' Wait for lock if necessary.' [ -z "$1" ] && exit 1 || exit "$1" @@ -64,7 +66,7 @@ tmp_dir=$(mktemp -d 'tmp.seed-build-list.XXXXXXXXXX' --tmpdir) trap "rm -rf --one-file-system '${tmp_dir:?}'" EXIT eval set -- "$( - getopt -o afhi:jm:np:w \ + getopt -o afhi:jm:np:s:w \ --long auto \ --long force \ --long help \ @@ -73,6 +75,7 @@ eval set -- "$( --long mirror: \ --long no-action \ --long package: \ + --long skip-arch: \ --long wait \ -n "$(basename "$0")" -- "$@" || \ echo usage @@ -122,6 +125,11 @@ do printf '%s\n' "$1" >> \ "${tmp_dir}/package-regexes" ;; + -s|--skip-arch) + shift + printf '%s\n' "$1" >> \ + "${tmp_dir}/skip-archs" + ;; -w|--wait) wait_for_lock='' ;; @@ -151,6 +159,13 @@ if [ ! -s "${tmp_dir}/mirrors" ] && \ exit 0 fi +if [ -s "${tmp_dir}/skip-archs" ] && \ + [ ! -s "${tmp_dir}/mirrors" ]; then + >&2 echo 'Invalid combination of options: -s|--skip-archs requires -m|--mirror.' + usage 2 + exit 2 +fi + # get locks if ${update}; then exec 9> "${sanity_check_lock_file}" @@ -209,6 +224,7 @@ done # harvest pkgnames from mirror delta if [ -s "${tmp_dir}/mirrors" ]; then + echo 'any' >> "${tmp_dir}/skip-archs" { # theirs while read -r mirror; do @@ -223,7 +239,20 @@ if [ -s "${tmp_dir}/mirrors" ]; then N s/^.*\n// /^lib32-/d - s/^\(.*-\)x86_64\.pkg\.tar\.\(xz\|zst\)$/\1i486\n\1i686\n\1pentium4/ + s/^\(.*-\)x86_64\.pkg\.tar\.\(xz\|zst\)$/'"$( + # shellcheck disable=SC2086,SC2154 + printf '%s\n' ${architectures} \ + | grep -vxFf "${tmp_dir}/skip-archs" \ + | sed ' + s/^.*$/\\1\0/ + ' \ + | sed ' + :a + $! N + $! ba + s/\n/\\n/g + ' + )"'/ s/^\(.*-any\)\.pkg\.tar\.\(xz\|zst\)$/\1/ ' | \ sed ' -- cgit v1.2.3-70-g09d2