From 5bd41632a6596ad6a8974eee4caa38b9dc2b7dc5 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Sat, 27 May 2017 19:32:34 -0400 Subject: php-pear-r2.eclass: Fix inverted test and bad variable reference The channel test inadvertantly tested for success rather than failure Now the command is always run and the return value is checked. A reference to PEAR_PN was left over when it should be PEAR_P --- eclass/php-pear-r2.eclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'eclass/php-pear-r2.eclass') diff --git a/eclass/php-pear-r2.eclass b/eclass/php-pear-r2.eclass index 48ff30355f9d..dad075686bf3 100644 --- a/eclass/php-pear-r2.eclass +++ b/eclass/php-pear-r2.eclass @@ -97,9 +97,10 @@ php-pear-r2_src_install() { php-pear-r2_pkg_postinst() { # Add unknown channels if [[ -f "${EROOT}usr/share/php/.packagexml/${PEAR_P}-channel.xml" ]] ; then - if "${EROOT}usr/bin/peardev" channel-info "${PHP_PEAR_DOMAIN}" &> /dev/null; then + "${EROOT}usr/bin/peardev" channel-info "${PHP_PEAR_DOMAIN}" &> /dev/null + if [[ $? -ne 0 ]]; then "${EROOT}usr/bin/peardev" channel-add \ - "${EROOT}usr/share/php/.packagexml/${PEAR_PN}-channel.xml" \ + "${EROOT}usr/share/php/.packagexml/${PEAR_P}-channel.xml" \ || einfo "Ignore any errors about existing channels" fi fi -- cgit v1.2.3