summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2020-04-14 10:47:10 +0200
committerAndreas Grapentin <andreas@grapentin.org>2022-01-28 15:36:53 +0100
commitd6fdc555b38f90eda09a66aed37d8d9f03268966 (patch)
tree7250e905a1fa17c4f8e0e7a263121985567e8359
parent844040e92e7cd678ab49398e5088a09cc7ce7159 (diff)
librestage: add flag to limit staged architectures
-rwxr-xr-xsrc/abslibre-tools/librestage17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage
index b940cb8..93538b1 100755
--- a/src/abslibre-tools/librestage
+++ b/src/abslibre-tools/librestage
@@ -28,12 +28,19 @@ source "$(librelib conf)"
source "$(librelib messages)"
+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() {
@@ -43,12 +50,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")")";;
@@ -81,6 +92,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}")