X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=pear-autoup.sh;h=075e40e25b82170dc427e013de7e8b75b8a61927;hb=ceda6f3c64c2d2b90fd26ea310b8f3c88c4057ae;hp=96503f5481245072ed038699ab7121da54eabe58;hpb=208fcd545b6ff48f5907d7f020fda51dd3b2953b;p=packages%2Frpm-build-tools.git diff --git a/pear-autoup.sh b/pear-autoup.sh index 96503f5..075e40e 100755 --- a/pear-autoup.sh +++ b/pear-autoup.sh @@ -10,7 +10,7 @@ set -e builder=builder if [ "$1" = "clean" ]; then - rm -rf php-pear-* php-phpunit-* php-symfony-* php-firephp-* php-horde-* php-phpdocs-* pear.* BUILD/* RPMS/* + rm -rf php-pear-* php-phpunit-* php-symfony-* php-symfony2-* php-firephp-* php-horde-* php-phpdocs-* pear.* BUILD/* RPMS/* exit 0 fi @@ -49,8 +49,10 @@ rpm -q php-packagexml2cl php-pear-PEAR_Command_Packaging } [ -s pear.upgrades ] || pear list-upgrades > pear.upgrades -subst=$(pear list-channels | awk -vORS="|" '/^[a-z]/{print $2}') -subst="s/^php-(${subst%\|})-//" +# process urls to aliases +[ -s pear.rpms ] || pear list-channels | sed -ne '4,$p' | while read url alias desc; do + awk -vurl="$url" -valias="$alias" '$1 == url {printf("php-%s-%s %s\n", alias, $2, $5)}' pear.upgrades +done > pear.rpms # clear it if you do not want to upgrade pkgs. i.e bring ac to sync do_upgrade=1 @@ -59,8 +61,7 @@ do_upgrade=1 topdir=$(rpm -E %_topdir) for pkg in $(cat pear.pkgs); do # check if there's update in channel - pearpkg=$(echo "$pkg" | sed -re "$subst") - ver=$(awk -vpkg=$pearpkg '$2 == pkg {print $5}' pear.upgrades) + ver=$(awk -vpkg=$pkg '$1 == pkg {print $2}' pear.rpms) [ "$ver" ] || continue # skip already processed packages