Issue 90372 - Tail command causes versioncheck to fail in setup (shell)
Summary: Tail command causes versioncheck to fail in setup (shell)
Status: CONFIRMED
Alias: None
Product: Installation
Classification: Application
Component: code (show other issues)
Version: OOo 2.4.0
Hardware: PC Solaris
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-04 16:45 UTC by jaapbril
Modified: 2013-08-07 15:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jaapbril 2008-06-04 16:45:38 UTC
Line 393 of the 'setup' script as found in the Opensolaris download states;
javaoutput=`$java_runtime -version 2>&1 | tail ${tail_args} -1`
This causes the (first & second) lines of 'java -version' output to be
discarded. These lines hold the 'java_versions_supported' string (in my case
1.4) that is tested for. Removal of tails' (-1) argument solves the issue (in my
case). 

Why the tail is necessary, I don't know, the code would seem to be able to
handle 10+ lines of 'java -version' output.

Jaap
Comment 1 Olaf Felka 2008-06-05 07:23:35 UTC
@ is: Please have a look.
Comment 2 ingo.schmidt-rosbiegal 2008-06-16 15:42:45 UTC
Trying to look for it in OOo 3.0 timeframe (cws native161)
Comment 3 ingo.schmidt-rosbiegal 2008-06-30 16:36:39 UTC
is -> jaapbril: which java do you use? what is the output of "java -version"?
Setting target 3.x.
Comment 4 jaapbril 2008-07-01 10:59:47 UTC
US$ java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
!!! NB I upgraded java (it used to be 1.4)!!!

<SETUP>
java_versions_supported="1.4 1.5 1.6"
sunjavahotspot="HotSpot"

check_jre_version()
{
    # check version of an installed JRE
    javaoutput=`$java_runtime -version 2>&1 | tail ${tail_args} -1`
    hotspot=`echo $javaoutput | grep $sunjavahotspot`
    if [ ! -z "$hotspot" ]; then
        for i in $java_versions_supported; do
            versionmatch=`echo $javaoutput | grep $i`
            if [ ! -z "$versionmatch" ]; then
                java_runtime_sufficient="yes"
                break
            fi
        done
    fi
}
Comment 5 ingo.schmidt-rosbiegal 2008-07-03 10:14:36 UTC
It seems, you have a pretty old version of the setup script. Today we have a new
version of check_jre_version() . Can you please check this?

check_jre_version()
{
    # check version of an installed JRE
    javaoutput=`$java_runtime -version 2>&1 | tail ${tail_args} -1`
    hotspot=`echo $javaoutput | grep $sunjavahotspot`
    if [ ! -z "$hotspot" ]; then
        for i in $java_versions_supported; do
            versionmatch=`echo $javaoutput | grep $i`
            if [ ! -z "$versionmatch" ]; then
                java_runtime_sufficient="yes"
                break
            fi
        done

        # check new version format, where version number is not part of line 3 (1.6)
        if [ ! "$java_runtime_sufficient" = "yes" ]; then
            javaoutput=`$java_runtime -version 2>&1 | head ${tail_args} -3`
            for i in $java_versions_supported; do
                versionmatch=`echo $javaoutput | grep $i`
                if [ ! -z "$versionmatch" ]; then
                    java_runtime_sufficient="yes"
                    break
                fi
            done
        fi
    fi
}
Comment 6 Rob Weir 2013-07-30 02:39:39 UTC
Reset assignee on issues not touched by assignee in more than 1000 days.