From: Elan Ruusamäe Date: Tue, 31 Jul 2012 20:32:23 +0000 (+0300) Subject: make it work with git dirs X-Git-Tag: auto/ac/rpm-build-tools-4.5-6~15^2~2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm-build-tools.git;a=commitdiff_plain;h=1714e627425ac25359d45f9072838a381ccb4188 make it work with git dirs --- diff --git a/pear-autoup.sh b/pear-autoup.sh index 2811026..3c6a089 100755 --- a/pear-autoup.sh +++ b/pear-autoup.sh @@ -2,11 +2,13 @@ # Try to update pear packages from current distro repos to latest in # pear.php.net. # -# $Id$ +# Created Date: 2010-08-19 # Author: Elan Ruusamäe set -e +builder=builder + # test that php is working php -r 'echo "PHP is working OK\n";' @@ -49,6 +51,7 @@ subst="s/^php-(${subst%\|})-//" do_upgrade=1 #do_upgrade= +topdir=$(rpm -E %_topdir) for pkg in $(cat pear.pkgs); do # check if there's update in channel pearpkg=$(echo "$pkg" | sed -re "$subst") @@ -60,7 +63,7 @@ for pkg in $(cat pear.pkgs); do # try upgrading with specified version # pldnotify.awk uses "pear remote-info" which does not respect preferred package states - ./builder -bb $pkg ${do_upgrade:+-u --upgrade-version $ver} --define "_unpackaged_files_terminate_build 1" || { + $builder -bb $pkg ${do_upgrade:+-u --upgrade-version $ver} --define "_unpackaged_files_terminate_build 1" || { cat >&2 <<-EOF $pkg failed @@ -70,7 +73,7 @@ for pkg in $(cat pear.pkgs); do } # check for bad versions (which needs macros - ver=$(awk '/^Version:/{print $2; exit}' $pkg/$pkg.spec) + ver=$(awk '/^Version:/{print $2; exit}' $topdir/$pkg/$pkg.spec) case "$ver" in *RC* | *a* | *b* | *alpha* | *beta* | *dev*) cat >&2 <<-EOF