From: Elan Ruusamäe Date: Thu, 19 Aug 2010 14:22:53 +0000 (+0000) Subject: - tool to help updating pear packages X-Git-Tag: auto/th/rpm-build-tools-4.5-5~7^2~58 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=53e0bad95a4153cb38eab8c1b91c8c0c83efa106;p=packages%2Frpm-build-tools.git - tool to help updating pear packages Changed files: pear-autoup.sh -> 1.1 --- diff --git a/pear-autoup.sh b/pear-autoup.sh new file mode 100644 index 0000000..3d2b9f9 --- /dev/null +++ b/pear-autoup.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Try to update pear packages from current distro repos to latest in +# pear.php.net. +# +# $Id$ +# Author: Elan Ruusamäe + +set -e + +[ -f pear.ls ] || poldek -q --skip-installed --cmd 'ls php-pear-* | desc' +[ -f pear.pkgs ] || awk '/^Source.package:/{print $3}' < pear.ls | sort -u | sed -re 's,-[^-]+-[^-]+.src.rpm$,,' > pear.pkgs + +# filter out tests, see https://bugs.launchpad.net/poldek/+bug/620362 +sed -i -e '/-tests/d' pear.pkgs +# more packages affected +sed -i -e '/php-pear-Auth_Container_ADOdb/d' pear.pkgs +sed -i -e '/php-pear-DB_DataObject-cli/d' pear.pkgs + +for pkg in $(cat pear.pkgs); do + [ -d $pkg ] && continue + ./builder -bb -u $pkg || { + cat >&2 <<-EOF + + $pkg failed + + EOF + exit 1 + } + + # check for bad versions (which needs macros + ver=$(awk '/^Version:/{print $2; exit}' $pkg/$pkg.spec); + case "$ver" in + *RC* | *a* | *b* | *alpha* | *beta*) + cat >&2 <<-EOF + + Package $pkg contains bad version: $ver + Update it to use %subver macro instead. + + EOF + exit 1 + ;; + esac + +done