aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Manison <amanison@anselsystems.com>2010-07-11 09:47:33 +0000
committerAndrew Manison <amanison@anselsystems.com>2010-07-11 09:47:33 +0000
commit4ae2c3d81c309f93d2c41e22e71c5cf445123896 (patch)
tree6efd49da364676ab5430c3bacd38f19ad15d11cb
parenta1505ba94afa5f7acf4a29172101adc52e8b0ad6 (diff)
downloadalpine_aports-4ae2c3d81c309f93d2c41e22e71c5cf445123896.tar.bz2
alpine_aports-4ae2c3d81c309f93d2c41e22e71c5cf445123896.tar.xz
alpine_aports-4ae2c3d81c309f93d2c41e22e71c5cf445123896.zip
Added command line options to control clean operation and mail notification.
-rwxr-xr-xrebuild-alpine.sh35
1 files changed, 26 insertions, 9 deletions
diff --git a/rebuild-alpine.sh b/rebuild-alpine.sh
index 5f975dd159..20756bd9a5 100755
--- a/rebuild-alpine.sh
+++ b/rebuild-alpine.sh
@@ -13,7 +13,7 @@ distclean () {
13 done 13 done
14} 14}
15 15
16build () { 16build () {
17 local pkgs 17 local pkgs
18 local maintainer 18 local maintainer
19 local pkgno 19 local pkgno
@@ -26,17 +26,25 @@ build () {
26 pkgno=$(expr "$pkgno" + 1) 26 pkgno=$(expr "$pkgno" + 1)
27 echo "Building $p ($pkgno of $pktcnt in $1 - $failed failed)" 27 echo "Building $p ($pkgno of $pktcnt in $1 - $failed failed)"
28 cd $rootdir/$1/$p 28 cd $rootdir/$1/$p
29 abuild -rm > $rootdir/$1_$p.txt 2>&1 29 abuild -rm > $rootdir/$1_$p.txt 2>&1
30 if [ "$?" = "0" ] ; then 30 if [ "$?" = "0" ] ; then
31 rm $rootdir/$1_$p.txt 31 rm $rootdir/$1_$p.txt
32 else 32 else
33 maintainer=$(grep Maintainer APKBUILD | cut -d " " -f 3-)
34 if [ -z "$maintainer" ] ; then
35 maintainer="default maintainer"
36 fi
37 echo "Package $1/$p failed to build (output in $rootdir/$1_$p.txt)" 33 echo "Package $1/$p failed to build (output in $rootdir/$1_$p.txt)"
38# echo "Package $1/$p failed to build. Notify $maintainer. Output is attached" | email -s "NOT SPAM $p build report" -a $rootdir/$1_$p.txt -n AlpineBuildBot -f build@alpinelinux.org amanison@anselsystems.com 34 if [ -n "$mail" ] ; then
39 failed=$(expr "$failed" + 1) 35 maintainer=$(grep Maintainer APKBUILD | cut -d " " -f 3-)
36 if [ -n "$maintainer" ] ; then
37 recipients="$maintainer -c dev@lists.alpinelinux.org"
38 else
39 recipients="dev@lists.alpinelinux.org"
40 fi
41 if [ -n "$mail" ] ; then
42 echo "Package $1/$p failed to build. Build output is attached" | \
43 email -s "NOT SPAM $p build report" -a $rootdir/$1_$p.txt \
44 -n AlpineBuildBot -f buildbot@alpinelinux.org $recipients
45 fi
46 fi
47 failed=$(expr "$failed" + 1)
40 fi 48 fi
41 done 49 done
42 cd $rootdir 50 cd $rootdir
@@ -44,7 +52,16 @@ build () {
44 52
45touch START_OF_BUILD.txt 53touch START_OF_BUILD.txt
46 54
47if [ "$1" = "clean" ] ; then 55unset clean
56unset mail
57while getopts "cm" opt; do
58 case $opt in
59 'c') clean="--clean";;
60 'm') mail="--mail";;
61 esac
62done
63
64if [ -n "$clean" ] ; then
48 echo "Invoked with 'clean' option. This will take a while ..." 65 echo "Invoked with 'clean' option. This will take a while ..."
49 tmp=$(distclean) 66 tmp=$(distclean)
50 echo "Done" 67 echo "Done"