set -e
-[ -s pear.ls ] || poldek -q --skip-installed --cmd 'ls php-pear-* | desc' > pear.ls
+# test that php is working
+php -r 'echo "PHP is working OK\n";'
+
+# test that pear is working
+pear info PEAR >/dev/null
+
+# needed pkgs for upgrade test
+rpm -q php-packagexml2cl
+
+[ -s pear.ls ] || { poldek --upa; poldek -q -Q --skip-installed --cmd 'ls php-pear-*' > pear.ls; }
+[ -s pear.desc ] || {
+ for pkg in $(cat pear.ls); do
+ poldek -q --skip-installed --cmd "desc $pkg"
+ done
+} > pear.desc
[ -s pear.pkgs ] || {
- awk '/^Source.package:/{print $3}' < pear.ls | sort -u | sed -re 's,-[^-]+-[^-]+.src.rpm$,,' > pear.pkgs
+ awk '/^Source.package:/{print $3}' < pear.desc | sed -re 's,-[^-]+-[^-]+.src.rpm$,,' | sort -u > pear.pkgs
# filter out tests, see https://bugs.launchpad.net/poldek/+bug/620362
sed -i -e '/-tests/d' pear.pkgs
sed -i -e '/^php-pear$/d' pear.pkgs
}
-[ -f pear.installed ] || { sudo poldek --update --upa; sed -e 's,^,install ,' pear.pkgs | sudo poldek; touch pear.installed; }
+[ -f pear.installed ] || {
+ sudo poldek --update --upa
+ sed -e 's,^,install ,' pear.pkgs | sudo poldek
+ touch pear.installed
+}
[ -s pear.upgrades ] || pear list-upgrades > pear.upgrades
-# test that php is working
-php -r 'echo "PHP is working OK\n";'
-
for pkg in $(cat pear.pkgs); do
# check if there's update in channel
pearpkg=${pkg#php-pear-}