aboutsummaryrefslogtreecommitdiff
path: root/admin/offerbuild
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-08-29 20:06:44 -0400
committerB. Watson <urchlay@slackware.uk>2026-08-29 20:06:44 -0400
commit55504fefce3078ac683b85508fa8af9e4d1b2059 (patch)
treee5590710b084f84520cfcce5f421403ea5a54132 /admin/offerbuild
parent8a78cfe513eb112585a5c5660fcbeb7cb3c58719 (diff)
downloadsbostuff-55504fefce3078ac683b85508fa8af9e4d1b2059.tar.gz
admin/*: added.
Diffstat (limited to 'admin/offerbuild')
-rwxr-xr-xadmin/offerbuild90
1 files changed, 90 insertions, 0 deletions
diff --git a/admin/offerbuild b/admin/offerbuild
new file mode 100755
index 0000000..d067888
--- /dev/null
+++ b/admin/offerbuild
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+source ~/sbostuff/sbostuff.sh
+
+FROM_NAME="B. Watson"
+FROM_EMAIL="urchlay@slackware.uk"
+
+SELF="$( basename $0 )"
+
+die() {
+ echo "$SELF: $@" 2>&1
+ exit 1
+}
+
+get_dependees() {
+ local build="$1"
+ local i
+
+ i="$( git grep -l "^REQUIRES=.*\<$build\>" | cut -d/ -f1,2 )"
+ echo $i
+}
+
+make_offer() {
+ local i
+ local j
+ local mailto
+ local build="$1"
+ local dependees="$( get_dependees "$1" )"
+
+ if [ "$dependees" = "" ]; then
+ echo "No dependees for $build"
+ return
+ fi
+ echo "$build dependees: $dependees"
+ if [ "$dependees" = "" ]; then
+ echo "=> no dependees for $build, nobody offer to!"
+ return
+ fi
+
+ for i in $dependees; do
+ cdsb $i
+ mailto="$( git grep '^EMAIL=' *.info | cut -d\" -f2 )"
+
+ [ "$mailto" = "NOEMAIL" ] && continue
+
+ echo "=> Enter email address for offer [$mailto]:"
+ read j
+ [ "$j" = "" ] && j="$mailto"
+ mailto="$j"
+
+ tmpfile="$( mktemp $SELF.XXXXXXXXXX )"
+ rm -f $tmpfile
+
+ echo "To: $mailto"
+ cat <<EOF >$tmpfile
+From: $FROM_NAME <$FROM_EMAIL>
+Subject: $( basename $i ) and $build on SBo
+
+$build needs a new maintainer. Your build $( basename $i ) lists it as
+a dependency, so you're the logical choice to take it over.
+
+If you want, I can update the .info file with your contact
+information, so you don't even have to submit an update.
+EOF
+ cat $tmpfile
+
+ echo
+ echo -n "=> Send this email[y]? "
+ read j
+
+ if [ "$j" = "y" -o "$j" = "Y" -o "$j" = "" ]; then
+ j="y"
+ echo "==> Sending email to $mailto"
+ cat $tmpfile | msmtp "$mailto"
+ fi
+
+ rm -f $tmpfile
+ [ "$j" = "y" ] && return
+ done
+}
+
+### main()
+hoorex --version > /dev/null || die "hoorex not installed"
+
+cd $SBO_GITROOT || die "edit sbostuff.sh and set SBO_GITROOT"
+
+for build in "$@"; do
+ echo "checking $build"
+ make_offer "$build"
+done