php-pear-r2.eclass: Fix inverted test and bad variable reference
authorBrian Evans <grknight@gentoo.org>
Sat, 27 May 2017 23:32:34 +0000 (19:32 -0400)
committerBrian Evans <grknight@gentoo.org>
Sat, 27 May 2017 23:32:34 +0000 (19:32 -0400)
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

index 48ff30355f9deefc0ae60a36831fb49b2c082783..dad075686bf3bb78af3eff4d89ce6ba7561982cf 100644 (file)
@@ -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