aboutsummaryrefslogtreecommitdiff
path: root/admin/orphanize
blob: 17db7d250c8efa310af93bc26a0dbf1b07ad0fc3 (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
#!/bin/sh

source ~/sbostuff/sbostuff.sh
export SBOLINT=no

usage() {
  cat <<EOF
Usage:
orphanize <build> [<build> ...]
orphanize -m <maintainer>
EOF
}

orphanize_builds() {
  local b
  for b in "$@"; do
    cdsb "$b" && sbonewmaint nobody && git commit -a -m'Orphaned (unmaintained).'
  done
}

orphanize_maint() {
  local i
  cdsb
  for i in $( git grep "^MAINTAINER=\"$@\"" '*/*/*.info' | cut -d/ -f1,2 ); do
    orphanize_builds "$i"
  done
}

case "$1" in
  "-m") shift; orphanize_maint "$@" ;;
  ""|-*) usage ;;
  *) orphanize_builds "$@" ;;
esac