diff options
Diffstat (limited to 'src/abslibre-tools/librestage')
-rwxr-xr-x | src/abslibre-tools/librestage | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index bec536c..7098aac 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -5,6 +5,7 @@ # Copyright (C) 2010-2012 Nicolás Reynolds <fauno@parabola.nu> # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> # Copyright (C) 2013-2014, 2017-2018 Luke Shumaker <lukeshu@parabola.nu> +# Copyright (C) 2020 Andreas Grapentin <andreas@grapentin.org> # # License: GNU GPLv3+ # @@ -26,12 +27,19 @@ . "$(librelib messages)" . "$(librelib conf)" +LimitArch="*" + usage() { - print "Usage: %s [REPO]" "${0##*/}" + print "Usage: %s [-A <arch>] [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 <arch> Stage only packages built for arches matching the given" + echo " wildcard string. Default: *" } main() { @@ -41,12 +49,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 +91,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}") |