index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | rebuildpkgs | 28 |
diff --git a/rebuildpkgs b/rebuildpkgs index 70bf448..5541eed 100755 --- a/rebuildpkgs +++ b/rebuildpkgs @@ -15,6 +15,14 @@ if [ $# -le 1 ]; then exit 1 fi +# Source makepkg.conf; fail if it is not found +if [ -r "/etc/makepkg.conf" ]; then + source "/etc/makepkg.conf" +else + echo "/etc/makepkg.conf not found!" + exit 1 +fi + die () { echo $@ >&2 exit 1 @@ -34,6 +42,12 @@ bump_pkgrel () { sed -i "s/pkgrel=$oldrel/pkgrel=$newrel/" PKGBUILD } +pkg_from_pkgbuild () { + # we want the sourcing to be done in a subshell so we don't pollute our current namespace + export CARCH PKGEXT + (. PKGBUILD; echo "$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT") +} + chrootdir="$1"; shift pkgs="$@" @@ -53,6 +67,11 @@ for pkg in $pkgs; do echo ":: Building '$pkg'" /usr/bin/svn update "$pkg" + if [ ! -d "$pkg/trunk" ]; then + FAILED="$FAILED $pkg" + echo ":: $pkg does not exist in SVN" + continue + fi cd "$pkg/trunk/" bump_pkgrel @@ -60,9 +79,14 @@ for pkg in $pkgs; do if ! sudo makechrootpkg -u -d -r "$chrootdir" -- --noconfirm; then FAILED="$FAILED $pkg" echo ":: $pkg Failed!" - continue else - echo ":: $pkg Complete" + pkgfile=$(pkg_from_pkgbuild) + if [ -e "$pkgfile" ]; then + echo ":: $pkg Complete" + else + FAILED="$FAILED $pkg" + echo ":: $pkg Failed, no package built!" + fi fi done |