Changeset 20290


Ignore:
Timestamp:
2009-08-17T10:02:26+12:00 (15 years ago)
Author:
oranfry
Message:

simplified the check for tomcat6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/build.xml

    r20242 r20290  
    488488
    489489    <!--
    490       the next block checks if tomcat is present in the 'packages' directory, and if so, figures
    491       out its major version number (5, 6, etc.)
    492       then it checks if your java is new enough to run that tomcat and if not fails with an explanation
     490    the next block checks if the bundled tomcat is present in the 'packages' directory,
     491    and checks for the lethal combination of tomcat 6 and java 1.4. Test for
     492    tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
     493    download, as there is no other surefire way to check tomcat version under java 1.4
    493494    -->
    494495    <condition property="packages.tomcat.ispresent" value="true" else="false">
    495496      <available file="packages/tomcat"/>
    496497    </condition>
    497 
    498     <if><bool><istrue value="${packages.tomcat.ispresent}"/></bool>
    499       <exec os="${os.unix}" outputproperty="packages.tomcat.detected.version" errorproperty="packages.tomcat.detection.errors" dir="packages/tomcat/bin" executable="sh">
    500         <arg value="-c"/>
    501         <arg value="./catalina.sh version | grep '^Server version: ' | sed 's@[^0-9]*\([0-9]\).*@\1@g'"/>
    502       </exec>
    503       <!--
    504       totally untested, so commented out for now
    505       <exec os="${os.windows}" outputproperty="packages.tomcat.detected.version" dir="packages/tomcat/bin" executable="cmd.exe">
    506         <arg value="/c"/>
    507         <arg value="catalina.bat version | grep '^Server version: ' | sed 's@[^0-9]*\([0-9]\).*@\1@g'"/>
    508       </exec>
    509       -->
    510       <property name="packages.tomcat.detected.version" value="unknown"/>
    511     </if>
    512 
    513     <echo>packages.tomcat.ispresent: ${packages.tomcat.ispresent}</echo>
    514     <echo>packages.tomcat.detected.version: ${packages.tomcat.detected.version}</echo>
    515     <echo>packages.tomcat.detection.error: ${packages.tomcat.detection.errors}</echo>
    516 
    517 
     498    <condition property="packages.tomcat.istomcat6" value="true" else="false">
     499      <available file="packages/tomcat/tomcat6.txt"/>
     500    </condition>
    518501    <if>
    519502      <bool>
    520         <or>
    521           <and>
    522             <istrue value="${packages.tomcat.ispresent}"/>
    523             <equals arg1="${packages.tomcat.detected.version}" arg2="6"/>
    524             <equals arg1="1.4" arg2="${ant.java.version}"/>
    525           </and>
    526           <and>
    527             <isset property="packages.tomcat.detection.errors"/>
    528             <not><equals arg1="${packages.tomcat.detection.errors}" arg2=""/></not>
    529          </and>
    530         </or>
     503        <and>
     504          <istrue value="${packages.tomcat.ispresent}"/>
     505          <istrue value="${packages.tomcat.istomcat6}"/>
     506          <equals arg1="1.4" arg2="${ant.java.version}"/>
     507        </and>
    531508      </bool>
    532       <fail>Your java version (1.4) is too old to work with the bundled version of Apache Tomcat. Please upgrade your java to version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
     509      <fail>Your Java (version 1.4) is too old to work with the bundled Apache Tomcat (version 6). Please upgrade to Java version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
    533510    </if>
    534511
Note: See TracChangeset for help on using the changeset viewer.