From 9672b90e9e3390406d525e77aa8615ae7f540043 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 18 Sep 2026 07:06:59 -0400 Subject: sbols: add -i (input file) option. --- admin/sbols | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'admin') diff --git a/admin/sbols b/admin/sbols index a265757..c65406e 100755 --- a/admin/sbols +++ b/admin/sbols @@ -28,6 +28,10 @@ Options: option is used, it must be the last option (this is done to avoid the need to quote maintainer names with spaces in them). -o Same as -m "orphaned - no maintainer"; lists orphans. + -i Read list of builds from (use - for stdin). + Builds are separated by whitespace (including newlines), so + they can be one per line or multiple per line. Cannot be + used with -m option. -n Show maintainer name and email. -s Show short description (from top of slack-desc). -r Show REQUIRES. @@ -49,11 +53,12 @@ if [ "$1" = "--help" -o "$1" = "" ]; then usage ; exit 0 fi -while getopts ":monsrcdla" OPT; do +while getopts ":moi:nsrcdla" OPT; do case "$OPT" in m) opt_m=1 ;; o) opt_o=1 ;; n) opt_n=1 ;; + i) opt_i="$OPTARG" ;; s) opt_s=1 ;; r) opt_r=1 ;; c) opt_c=1 ;; @@ -65,8 +70,13 @@ while getopts ":monsrcdla" OPT; do done shift $(($OPTIND - 1)) +# sbostuff.sh defines cdsb(), which we can't do without. source ~/sbostuff/sbostuff.sh || exit 1 +# we're going to cd to $SBO_GITROOT, so canonicalize the -i file +# if one was given. +[ "$opt_i" != "" -a "$opt_i" != "-" ] && opt_i="$( realpath "$opt_i" )" + # if we have this, use it, otherwise use current dir. [ "$SBO_GITROOT" != "" ] && cd "$SBO_GITROOT" @@ -83,6 +93,10 @@ if [ "$opt_m" = "1" ]; then builds="$( git grep -l "$*" '*/*/*.info' | cut -d/ -f1,2 )" [ "$builds" = "" ] && die "maintainer '$*' not found" set $builds +elif [ "$opt_i" != "" ]; then + builds="$( cat "$opt_i" )" + [ "$builds" = "" ] && die "can't read any build names from $opt_i" + set $builds fi [ "$*" = "" ] && usage && exit 1 -- cgit v1.2.3