summaryrefslogtreecommitdiffstats
path: root/rebuild-alpine.sh
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-07-19 16:15:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-07-19 16:15:40 +0000
commitbf04f16d7e5ed54e3af1425ef6a7b7dd5c34fc0c (patch)
tree8a945a6b93bc247d3d131c48e33ba9a8db4a4be5 /rebuild-alpine.sh
parentcb6a79e43338a70e2962b8b38b59a9000fd9c0d2 (diff)
parent6b686a9c7df44a3fa088b139e9852424de23869f (diff)
downloadaports-bf04f16d7e5ed54e3af1425ef6a7b7dd5c34fc0c.tar.bz2
aports-bf04f16d7e5ed54e3af1425ef6a7b7dd5c34fc0c.tar.xz
Merge remote branch 'amanison/master'
Diffstat (limited to 'rebuild-alpine.sh')
-rwxr-xr-xrebuild-alpine.sh85
1 files changed, 85 insertions, 0 deletions
diff --git a/rebuild-alpine.sh b/rebuild-alpine.sh
new file mode 100755
index 000000000..20756bd9a
--- /dev/null
+++ b/rebuild-alpine.sh
@@ -0,0 +1,85 @@
+rootdir=$(pwd -P)
+
+distclean () {
+ echo "Removing traces of previous builds from $rootdir"
+ local allpkgs=$(find $rootdir -maxdepth 3 -name APKBUILD -print | sed -e 's/\/APKBUILD//g' | sort)
+ for p in $allpkgs ; do
+ cd $p
+ pwd
+ abuild clean 2>&1
+ abuild cleanoldpkg 2>&1
+ abuild cleanpkg 2>&1
+ abuild cleancache 2>&1
+ done
+}
+
+build () {
+ local pkgs
+ local maintainer
+ local pkgno
+ local failed
+ pkgs=$($rootdir/aport.lua deplist $rootdir $1)
+ pktcnt=$(echo $pkgs | wc -w)
+ pkgno=0
+ failed=0
+ for p in $pkgs ; do
+ 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
+ if [ "$?" = "0" ] ; then
+ rm $rootdir/$1_$p.txt
+ else
+ echo "Package $1/$p failed to build (output in $rootdir/$1_$p.txt)"
+ 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
+}
+
+touch START_OF_BUILD.txt
+
+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"
+fi
+
+echo "Refresh aports tree"
+git pull
+
+#cd main/build-base
+#abuild -Ru
+#cd $rootdir
+
+for s in main testing unstable ; do
+ echo "Building packages in $s"
+ build $s
+done
+
+touch END_OF_BUILD.txt
+
+echo "Done"
+