From 43955373ca7010b0f1d6694c3f82b40636292a5d Mon Sep 17 00:00:00 2001 From: Andreas Grapentin Date: Tue, 14 Apr 2020 10:47:10 +0200 Subject: librestage: add flag to limit staged architectures --- src/abslibre-tools/librestage | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index bec536c..c68b61b 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -26,12 +26,19 @@ . "$(librelib messages)" . "$(librelib conf)" +LimitArch="*" + usage() { - print "Usage: %s [REPO]" "${0##*/}" + print "Usage: %s [-A ] [REPO]" "${0##*/}" print "Stages the package(s) build by ./PKGBUILD for upload." echo prose "The package(s) are staged for the named repository, or the name of the parent directory if a repository is not named." + echo + echo "Supported options:" + echo " -h Display this help and exit" + echo " -A Stage only packages built for arches matching the given" + echo " wildcard string. Default: *" } main() { @@ -41,12 +48,16 @@ main() { fi # Parse options, set up - while getopts 'h' arg; do + while getopts 'hA:' arg; do case $arg in h) usage; return $EXIT_SUCCESS;; + A) LimitArch="$OPTARG";; *) usage >&2; return $EXIT_INVALIDARGUMENT;; esac done + local shiftlen=$(( OPTIND - 1 )) + shift $shiftlen + local repo= case $# in 0) repo="$(basename "$(dirname "$PWD")")";; @@ -79,6 +90,8 @@ main() { # Look for (libre)makepkg output local CARCH _pkgname pkgnames pkgfile for CARCH in "${arch[@]}"; do + # Skip this arch if necessary + [[ "$CARCH" == $LimitArch ]] || continue # This supports both pacman < 5.1 pkgname-debug # packages and pacman >= 5.1 pkgbase-debug packages. pkgnames=("${pkgname[@]}" "${pkgname[@]/%/-debug}") -- cgit v1.2.2