]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - pear-autoup.sh
on -j define __jobs instead of _smp_mflags
[packages/rpm-build-tools.git] / pear-autoup.sh
index 96503f5481245072ed038699ab7121da54eabe58..af1c41ca881482992a0bbda2fa713b5a9e445777 100755 (executable)
@@ -10,10 +10,14 @@ 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
 
+if [ $# -gt 0 ]; then
+       echo "$*" | tr ' ' '\n' > pear.channels
+fi
+
 # test that php is working
 php -r 'echo "PHP is working OK\n";'
 
@@ -38,19 +42,18 @@ rpm -q php-packagexml2cl php-pear-PEAR_Command_Packaging
 
 [ -f pear.installed ] || {
        sudo poldek  --update --upa
-       # as sudo & poldek don't allow us to capture (no pipe or redirection work),
-       # we create markers which we could grab when invoked via "script"
-       echo "BEGIN INSTALL PACKAGES"
        sed -e 's,^,install ,' pear.pkgs | sudo poldek
-       echo "END INSTALL PACKAGES"
-       # rm -f pear.installed && script -c ./pear-autoup.sh pear.install.log
-       # sed -ne '/BEGIN INSTALL PACKAGES/,/END INSTALL PACKAGES/p' pear.install.log | grep -vE 'poldek:/.*install|: ambiguous name|equal version installed, skipped|Nothing to do' | less
        touch pear.installed
 }
 [ -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 ] || {
+       [ -s pear.channels ] || pear list-channels | sed -ne '4,$p' > pear.channels
+       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.channels > pear.rpms
+}
 
 # clear it if you do not want to upgrade pkgs. i.e bring ac to sync
 do_upgrade=1
@@ -59,8 +62,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
This page took 0.034709 seconds and 4 git commands to generate.