From c1cf745342c99db61d230e66dc0c0dc7fafd18f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 24 Jan 2013 19:13:02 +0200 Subject: [PATCH] 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 -- 2.44.0