add mrconfig for sqitch
[pkg-perl/meta.git] / pkg-perl-post-receive
1 #!/bin/sh
2
3 BASE=/home/groups/pkg-perl
4
5 KGB=/home/groups/kgb/trunk
6 CONF=$BASE/kgb-client.conf
7 DIR=`basename $(readlink -f $GIT_DIR)`
8 PKG=${DIR%.git}
9
10 cat > hooks/reflog
11
12 if [ -e $BASE/KGB-notifications-disabled ]; then
13     echo "KGB notifications disabled"
14 else
15     cat hooks/reflog | \
16     PERL5LIB=$KGB/lib $KGB/script/kgb-client --conf $CONF \
17             --repository git --git-reflog - --module $PKG
18 fi
19
20 feed_git_tag_pending() {
21     local olds='' news=''
22     local unchanged="`git branch | sed 's/^*/ /'`"
23     while read old new ref; do
24         if ! echo $old | egrep -q '^0+$' ; then
25             olds="$olds ^$old"
26         fi
27         if ! echo $new | egrep -q '^0+$' ; then
28             news="$news $new"
29         fi
30
31         ref=${ref#refs/heads/}
32         new_unchanged=
33         for br in $unchanged; do
34             if [ "$br" != "$ref" ]; then
35                 new_unchanged="$new_unchanged $br"
36             fi
37         done
38         unchanged=$new_unchanged
39     done
40
41     new_unchanged=
42     for br in $unchanged; do
43         new_unchanged="$new_unchanged ^$br"
44     done
45     unchanged=$new_unchanged
46     #echo "starting: git rev-list $olds $news $unchanged"
47     for r in `git rev-list $olds $news $unchanged`; do
48         $BASE/scripts/git-tag-pending-bugs $GIT_DIR $r;
49     done
50 }
51
52 cat hooks/reflog | grep ' refs/heads/' | feed_git_tag_pending
53
54 /home/groups/pet/PET2/pkg-perl/pet-git-helper.pkg-perl-packages update $DIR
55
56 # send announce to the mailing list
57 cat hooks/reflog | grep -v refs/heads/upstream | /usr/local/bin/git-commit-notice