aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-09-18 07:06:59 -0400
committerB. Watson <urchlay@slackware.uk>2026-09-18 07:06:59 -0400
commit9672b90e9e3390406d525e77aa8615ae7f540043 (patch)
tree2d3ebd85e0f8c3d505312dcda508bc74dd21a882
parent5ad3c89e8165abd23497762d00577991366d2138 (diff)
downloadsbostuff-9672b90e9e3390406d525e77aa8615ae7f540043.tar.gz
sbols: add -i (input file) option.
-rwxr-xr-xadmin/sbols16
1 files changed, 15 insertions, 1 deletions
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 <file> Read list of builds from <file> (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 <maintainer> 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