aboutsummaryrefslogtreecommitdiff
path: root/sbonewmaint
diff options
context:
space:
mode:
Diffstat (limited to 'sbonewmaint')
-rwxr-xr-xsbonewmaint38
1 files changed, 38 insertions, 0 deletions
diff --git a/sbonewmaint b/sbonewmaint
new file mode 100755
index 0000000..189bc23
--- /dev/null
+++ b/sbonewmaint
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+if [ -e ~/.sbostuff.cfg ]; then
+ source ~/.sbostuff.cfg
+else
+ echo "$( basename $0 ): warning: can't find ~/.sbostuff.cfg"
+fi
+
+NAME="$1"
+EMAIL="$2"
+
+if [ "$NAME" = "me" -a "$EMAIL" = "" ]; then
+ NAME="$SBO_NAME"
+ EMAIL="$SBO_EMAIL"
+elif [ "$NAME" = "nobody" -o "$NAME" = "orphaned" ]; then
+ NAME="orphaned - no maintainer"
+ EMAIL="nobody@nowhere.com"
+fi
+
+if [ "$NAME" = "" -o "$NAME" = "--help" -o "$EMAIL" = "" ]; then
+ echo "Usage: $( basename $0 ) 'Full Name' email@domain.com" 1>&2
+ echo " $( basename $0 ) me" 1>&2
+ echo " $( basename $0 ) nobody" 1>&2
+ exit 1
+fi
+
+INFO="$( echo *.info )"
+if [ ! -e "$INFO" ]; then
+ echo "No (or multiple) .info file in current dir" 1>&2
+ exit 1
+fi
+
+sed -i "/^MAINTAINER=/s,\"[^\"]*\",\"$NAME\"," "$INFO"
+sed -i "/^EMAIL=/s,\"[^\"]*\",\"$EMAIL\"," "$INFO"
+
+PAGER=cat git diff .
+
+echo "git commit -a -m'New maintainer'"