summaryrefslogtreecommitdiff
path: root/rebuildpkgs
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-03-11 19:06:05 -0700
committerAaron Griffin <aaronmgriffin@gmail.com>2009-05-06 12:36:08 -0700
commit49947d8fb3d3ca91632457820b424bb2b412fac1 (patch)
treed3de491936022a5248d682894a35efef46fdb9c6 /rebuildpkgs
parentea73c2b08be9e040df9a7bcdd8b85cba4e2d9ddf (diff)
downloaddevtools-49947d8fb3d3ca91632457820b424bb2b412fac1.tar.xz
rebuildpkgs: misc bug fixes and changes
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'rebuildpkgs')
-rwxr-xr-xrebuildpkgs28
1 files changed, 26 insertions, 2 deletions
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