commit:     5bd41632a6596ad6a8974eee4caa38b9dc2b7dc5
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Sat May 27 23:32:34 2017 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Sat May 27 23:32:34 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bd41632

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(-)

diff --git a/eclass/php-pear-r2.eclass b/eclass/php-pear-r2.eclass
index 48ff30355f9..dad075686bf 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

Reply via email to