Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119137 - require_php_cgi in depend.php.eclass broken
Summary: require_php_cgi in depend.php.eclass broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-15 16:23 UTC by Ginsu
Modified: 2006-01-21 01:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ginsu 2006-01-15 16:23:57 UTC
The function require_php_cgi() doesn't work correctly.  It checks if you have php version 4 installed, and then sets PHP_VERSION if it is compiled with the cgi use flag.  But if you have both php4 and php5 installed and php4 doesn't have the cgi use flag.  It'll go in the first if block, see it doesnt have the use flag, and then stop and the function will die because it never checks php5.
Comment 1 Sebastian Bergmann (RETIRED) gentoo-dev 2006-01-20 23:54:49 UTC
Can you test the patch below, please:

Index: depend.php.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v
retrieving revision 1.8
diff -u -B -r1.8 depend.php.eclass
--- depend.php.eclass   1 Jan 2006 01:14:59 -0000       1.8
+++ depend.php.eclass   21 Jan 2006 07:53:01 -0000
@@ -381,16 +381,22 @@

        # detect which PHP version installed
        if has_version '=dev-lang/php-4*' ; then
+               PHP_PACKAGE_FOUND=1
                pkg="`best_version '=dev-lang/php-4*'`"
                if built_with_use =${pkg} cgi ; then
                        PHP_VERSION=4
                fi
-       elif has_version '=dev-lang/php-5*' ; then
+       fi
+
+       if has_version '=dev-lang/php-5*' ; then
+               PHP_PACKAGE_FOUND=1
                pkg="`best_version '=dev-lang/php-5*'`"
                if built_with_use =${pkg} cgi ; then
                        PHP_VERSION=5
                fi
-       else
+       fi
+
+       if [[ -z ${PHP_PACKAGE_FOUND} ]]; then
                die "Unable to find an installed dev-lang/php package"
        fi
Comment 2 Sebastian Bergmann (RETIRED) gentoo-dev 2006-01-21 01:03:14 UTC
Patch has been reviewed by Jakub Moc <jakub@gentoo.org> and committed to CVS.