comparison package @ 199:d1ef12ab18b6

check for uncommitted changes, and for pending push changesets
author Carl Byington <carl@five-ten-sg.com>
date Sat, 02 Feb 2008 12:09:12 -0800
parents fbcf2733fe79
children
comparison
equal deleted inserted replaced
198:fbcf2733fe79 199:d1ef12ab18b6
1 #!/bin/bash 1 #!/bin/bash
2 2
3 find . -name '*~' | while read a; do rm -f "$a"; done 3 find . -name '*~' | while read a; do rm -f "$a"; done
4 4
5 # check for uncommitted changes
6 a=$(hg status)
7 if [ -n "$a" ]; then
8 hg status
9 echo "fix those first with 'hg commit'"
10 exit 0
11 fi
12
13 # check for changesets pending push to global repository
14 hg outgoing /usr/hg*/dnsbl | grep 'no changes found' >/dev/null
15 if [ $? -ne 0 ]; then
16 hg outgoing /usr/hg*/dnsbl
17 echo "fix those first with 'hg push /usr/hg*/dnsbl'"
18 exit 0
19 fi
5 20
6 # get a new clean copy from source control 21 # get a new clean copy from source control
7 orig=$(pwd) 22 orig=$(pwd)
8 pack=$orig/../dnsbl-package 23 pack=$orig/../dnsbl-package
9 [ -d "$pack" ] && rm -rf "$pack" 24 [ -d "$pack" ] && rm -rf "$pack"
10 mkdir "$pack" 25 mkdir "$pack"
11 cd "$pack" 26 cd "$pack"
12 hg clone /usr/hg-repository/dnsbl 27 hg clone /usr/hg-repository/dnsbl
13 cd dnsbl 28 cd dnsbl
14
15 29
16 # build the dnsbl package 30 # build the dnsbl package
17 T=`grep AC_INIT configure.in | cut -d'(' -f2` 31 T=`grep AC_INIT configure.in | cut -d'(' -f2`
18 NAME=`echo $T | cut -d, -f1` 32 NAME=`echo $T | cut -d, -f1`
19 VER=`echo $T | cut -d, -f2` 33 VER=`echo $T | cut -d, -f2`
77 else 91 else
78 tail -10 $distlog 92 tail -10 $distlog
79 fi 93 fi
80 chown --recursive carl:carl * 94 chown --recursive carl:carl *
81 95
82
83 # throw away the packaging directory 96 # throw away the packaging directory
84 cd "$pack/.." 97 cd "$pack/.."
85 rm -rf dnsbl-package 98 rm -rf dnsbl-package
86 cd "$orig" 99 cd "$orig"