Commit 49947d8f authored by Aaron Griffin's avatar Aaron Griffin
Browse files

rebuildpkgs: misc bug fixes and changes

parent ea73c2b0
Loading
Loading
Loading
Loading
+26 −2
Original line number Diff line number Diff line
@@ -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
        pkgfile=$(pkg_from_pkgbuild)
        if [ -e "$pkgfile" ]; then
            echo ":: $pkg Complete"
        else
            FAILED="$FAILED $pkg"
            echo ":: $pkg Failed, no package built!"
        fi
    fi
done