aboutsummaryrefslogtreecommitdiff
path: root/sbonewmaint
blob: 742edb522e43d3c052cd3cc5397f8a19ac419e66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

# read config fresh, rather than use the env.
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'"