diff options
author | Andrew Manison <amanison@anselsystems.com> | 2010-07-11 09:47:33 +0000 |
---|---|---|
committer | Andrew Manison <amanison@anselsystems.com> | 2010-07-11 09:47:33 +0000 |
commit | 4ae2c3d81c309f93d2c41e22e71c5cf445123896 (patch) | |
tree | 6efd49da364676ab5430c3bacd38f19ad15d11cb | |
parent | a1505ba94afa5f7acf4a29172101adc52e8b0ad6 (diff) | |
download | aports-4ae2c3d81c309f93d2c41e22e71c5cf445123896.tar.bz2 aports-4ae2c3d81c309f93d2c41e22e71c5cf445123896.tar.xz |
Added command line options to control clean operation and mail notification.
-rwxr-xr-x | rebuild-alpine.sh | 35 |
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 () { done } -build () { +build () { local pkgs local maintainer local pkgno @@ -26,17 +26,25 @@ build () { pkgno=$(expr "$pkgno" + 1) echo "Building $p ($pkgno of $pktcnt in $1 - $failed failed)" cd $rootdir/$1/$p - abuild -rm > $rootdir/$1_$p.txt 2>&1 + abuild -rm > $rootdir/$1_$p.txt 2>&1 if [ "$?" = "0" ] ; then rm $rootdir/$1_$p.txt else - maintainer=$(grep Maintainer APKBUILD | cut -d " " -f 3-) - if [ -z "$maintainer" ] ; then - maintainer="default maintainer" - fi echo "Package $1/$p failed to build (output in $rootdir/$1_$p.txt)" -# 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 - failed=$(expr "$failed" + 1) + if [ -n "$mail" ] ; then + maintainer=$(grep Maintainer APKBUILD | cut -d " " -f 3-) + if [ -n "$maintainer" ] ; then + recipients="$maintainer -c dev@lists.alpinelinux.org" + else + recipients="dev@lists.alpinelinux.org" + fi + if [ -n "$mail" ] ; then + echo "Package $1/$p failed to build. Build output is attached" | \ + email -s "NOT SPAM $p build report" -a $rootdir/$1_$p.txt \ + -n AlpineBuildBot -f buildbot@alpinelinux.org $recipients + fi + fi + failed=$(expr "$failed" + 1) fi done cd $rootdir @@ -44,7 +52,16 @@ build () { touch START_OF_BUILD.txt -if [ "$1" = "clean" ] ; then +unset clean +unset mail +while getopts "cm" opt; do + case $opt in + 'c') clean="--clean";; + 'm') mail="--mail";; + esac +done + +if [ -n "$clean" ] ; then echo "Invoked with 'clean' option. This will take a while ..." tmp=$(distclean) echo "Done" |