[packages/rpm-build-tools] handle package channels properly

glen glen at pld-linux.org
Thu Jan 24 18:13:56 CET 2013


commit c1cf745342c99db61d230e66dc0c0dc7fafd18f7
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Jan 24 19:13:02 2013 +0200

    handle package channels properly
    
    without messing up channels (php-pear-Config vs php-symfony2-Config)

 pear-autoup.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/pear-autoup.sh b/pear-autoup.sh
index 53a48c2..075e40e 100755
--- a/pear-autoup.sh
+++ b/pear-autoup.sh
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/c1cf745342c99db61d230e66dc0c0dc7fafd18f7



More information about the pld-cvs-commit mailing list