Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 54006

Summary: php-sapi.eclass incoreclty check java version
Product: Gentoo Linux Reporter: R.a E <raer>
Component: [OLD] DevelopmentAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: raer
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description R.a E 2004-06-15 11:09:29 UTC
When try to emerge php got error:

--8<--
[root@knur:~]
>emerge php
Calculating dependencies ...done!
>>> emerge (1 of 1) dev-php/php-4.3.6-r1 to /
>>> md5 src_uri ;-) php-4.3.6.tar.bz2
>>> md5 src_uri ;-) php-4.3.6-includepath.diff
>>> md5 src_uri ;-) php-4.3.6-pcrealloc.patch
>>> Unpacking source...
>>> Unpacking php-4.3.6.tar.bz2 to /var/tmp/portage/php-4.3.6-r1/work
 * Applying php-4.3.6-pcrealloc.patch...                                                                               [ ok ]
>>> Source unpacked.
java
!alpha
 * Active JDK version: WARNING: Default charset KOI8-U not supported, using ISO-8859-1 instead
 * A Java 1.4 JDK is required for Java support in PHP.

!!! ERROR: dev-php/php-4.3.6-r1 failed.
!!! Function php-sapi_check_java_config, Line 225, Exitcode 0
!!! (no error message)

[root@knur:~]
--8<--

Reproducible: Always
Steps to Reproduce:
There isn't any special step.


Expected Results:  
Php installed ;)

[root@knur:~]
>emerge info
Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.3-gentoo-r1)
=================================================================
System uname: 2.6.3-gentoo-r1 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon-xp -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /opt/resin/conf /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=athlon-xp -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://mirror.switch.ch/mirror/gentoo/
ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo
http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm arts avi berkdb crypt cups directfb dvd encode
fbcon foomaticdb gdbm gif gpm gtk2 imap imlib java jpeg ldap libg++ libwww mad
mikmod mozcalendar mozilla moznoirc mpeg mysql ncurses nls oggvorbis opengl
operanom2 oss pam pdflib perl png postgres python qt quicktime readline sdl
spell ssl svga tcltk tcpd tiff truetype usb vim-with-x x86 xinerama xml2 xmms xv
zlib"

[root@knur:~]
Comment 1 R.a E 2004-06-15 11:09:57 UTC
This problem is related to following lines from the "/usr/portage/eclass/php-sapi.eclass"

--8<--
    JDKVER="$(java-config --java-version 2>&1 | head -n1 | cut -d\" -f2)"
--8<--

And to following warning message produced by java

     SUN JDK
--8<--
>/opt/sun-jdk-1.4.2.04/bin/java -version
WARNING: Default charset KOI8-U not supported, using ISO-8859-1 instead
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
[root@knur:~]
--8<--

    BLACKDOWN ORG JDK
--8<--
>/opt/blackdown-jdk-1.4.1/bin/java -version
WARNING: Default charset KOI8-U not supported, using ISO-8859-1 instead
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.1-01)
Java HotSpot(TM) Client VM (build Blackdown-1.4.1-01, mixed mode)
[root@knur:~]
--8<--

The code from  /usr/portage/eclass/php-sapi.eclass take first line of java output and succesfully fail to recognize any version... :(

This situation can be fixed by changing code in the   /usr/portage/eclass/php-sapi.eclass

--8<--
>diff -u /usr/portage/eclass/php-sapi.eclass /usr/portage/eclass/php-sapi.eclass.WORK 
--- /usr/portage/eclass/php-sapi.eclass 2004-06-15 20:56:44.242691952 +0300
+++ /usr/portage/eclass/php-sapi.eclass.WORK    2004-06-15 20:40:08.635047320 +0300
@@ -217,7 +217,7 @@
                die
        fi
 
-       JDKVER="$(java-config --java-version 2>&1 | head -n1 | cut -d\" -f2)"
+       JDKVER="$(java-config --java-version 2>&1 | grep "java version" | head -n1 | cut -d\" -f2)"
        einfo "Active JDK version: ${JDKVER}"
        case ${JDKVER} in
                1.4.*) ;;
[root@knur:~]
--8<--
Comment 2 Sven Wegener gentoo-dev 2004-06-15 11:13:35 UTC

*** This bug has been marked as a duplicate of 54003 ***