diff options
author | Andreas Grapentin <andreas@grapentin.org> | 2020-04-14 10:47:10 +0200 |
---|---|---|
committer | Andreas Grapentin <andreas@grapentin.org> | 2021-07-16 20:52:02 +0200 |
commit | 43955373ca7010b0f1d6694c3f82b40636292a5d (patch) | |
tree | 34ba0675dea0ab5901150cbae285dc4723690902 /src | |
parent | a94838e1792a85f74a540daafb6715a5b3ae2908 (diff) |
librestage: add flag to limit staged architectures
Diffstat (limited to 'src')
-rwxr-xr-x | src/abslibre-tools/librestage | 17 |
1 files changed, 15 insertions, 2 deletions
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 <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 +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}") |