Changeset 27484

Show
Ignore:
Timestamp:
27.05.2013 17:31:13 (6 years ago)
Author:
ak19
Message:

1. Target to set perl shebangs for files in GS3's cgi. 2. Now GS3 also checks out checksum.pl.

Location:
main/trunk/greenstone3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.xml

    r27380 r27484  
    636636            </exec> 
    637637 
    638             <exec executable="${gs2build.home}/bin/windows/which" os="${os.windows}" spawn="false" outputproperty="full.perl.path"> 
     638        <exec executable="${gs2build.home}/bin/windows/which" os="${os.windows}" spawn="false" outputproperty="full.perl.path"> 
    639639              <arg value="perl" /> 
    640640            </exec> 
     
    643643                <replace regex="\/[^\/]*$" replacement="/" /> 
    644644            </stringutil> 
    645             <stringutil string="${partial.perl.path}" property="perl.path"> 
     645        <stringutil string="${partial.perl.path}" property="perl.path"> 
    646646                <replace regex="\\[^\\]*$" replacement="\\" /> 
    647647            </stringutil> 
    648648            <if><bool><istrue value="${current.os.isunix}"/></bool> 
    649  
    650649              <if><bool><not><equals arg1="${full.perl.path}" arg2="/usr/bin/perl"/></not></bool> 
    651650                <echo> 
    652651    Non-standard location of Perl found: ${full.perl.path} 
    653652    Set the environment variable PERLPATH or the perl.path property in 
    654       build.properties to explicitly control the version of Perl used. 
     653    build.properties to explicitly control the version of Perl used. 
    655654                </echo> 
    656655              </if> 
     
    673672      </else> 
    674673    </if> 
     674    <stringutil string="${perl.path}" property="escaped.perl.path"> 
     675      <replace regex="\\" replacement="\\\\" /> 
     676    </stringutil> 
    675677  </target> 
    676678 
     
    964966  </target> 
    965967 
     968  <target name="set-perl-shebangs" depends="perl-for-building"> 
     969    <if> 
     970      <bool> 
     971        <and><isset property="perl.path"/> 
     972          <not><equals arg1="${perl.path}" arg2=""/></not> 
     973        </and> 
     974      </bool> 
     975 
     976      <if><bool><istrue value="${current.os.iswindows}"/></bool> 
     977    <property name="perl.exec" value="${escaped.perl.path}perl.exe"/> 
     978    <else> 
     979      <property name="perl.exec" value="${escaped.perl.path}perl"/>    
     980    </else> 
     981      </if> 
     982 
     983      <!--<echo>**** PERLPATH: ${perl.path}</echo>--> 
     984      <echo>**** Setting perl shebangs to Perl Exec: ${perl.exec}</echo> 
     985 
     986      <!-- set the shebangs in the cgi files to point to the correct perlpath --> 
     987      <rsr file="${web.home}/WEB-INF/cgi/gliserver.pl" pattern="^#!.*" replacement="#!${perl.exec} -w" lines="1"/> 
     988      <rsr file="${web.home}/WEB-INF/cgi/metadata-server.pl" pattern="^#!.*" replacement="#!${perl.exec} -w" lines="1"/>  
     989      <rsr file="${web.home}/WEB-INF/cgi/checksum.pl" pattern="^#!.*" replacement="#!${perl.exec} -w" lines="1"/>    
     990      <else> 
     991    <echo>WARNING: perl.path is empty. Unable to set the shebangs in the perl files in ${web.home}/WEB-INF/cgi</echo> 
     992      </else> 
     993    </if> 
     994  </target> 
     995 
    966996  <target name="configure-web" depends="init,perl-for-building" 
    967997    description="Configure only the web app config files"> 
     
    9701000      <path path="${web.home}"/> 
    9711001    </pathconvert> 
    972     <stringutil string="${perl.path}" property="escaped.perl.path"> 
    973                 <replace regex="\\" replacement="\\\\" /> 
    974     </stringutil> 
     1002 
     1003    <antcall target="set-perl-shebangs" inheritAll="true" /> 
    9751004     
    9761005    <filter token="gsdlhome" value="${gs2build.home}"/> 
     
    9811010    <filter token="tomcat.port" value="${tomcat.port}"/> 
    9821011    <filter token="perlpath" value="${escaped.perl.path}"/> 
    983     <filter token="disable.collection.building" value="${disable.collection.building}"/> 
    984     <copy file="${basedir}/web/WEB-INF/cgi/gsdl3site.cfg.in" tofile="${basedir}/web/WEB-INF/cgi/gsdl3site.cfg" filtering="true" overwrite="true"/> 
     1012    <filter token="disable.collection.building" value="${disable.collection.building}"/> 
     1013    <copy file="${web.home}/WEB-INF/cgi/gsdl3site.cfg.in" tofile="${web.home}/WEB-INF/cgi/gsdl3site.cfg" filtering="true" overwrite="true"/> 
    9851014    <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/> 
    9861015    <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/> 
     
    21622191  <!-- ============== gli targets ================================= --> 
    21632192   
    2164   <!-- gliserver.pl, gsdlCGI.pm and metadata-server.pl updated are updated alongside  
     2193  <!-- gliserver.pl, gsdlCGI.pm, metadata-server.pl and checksum.pl are updated alongside  
    21652194       this in target svnupdate-collection-building --> 
    21662195  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode"> 
     
    21742203  </target> 
    21752204 
    2176   <!-- gliserver.pl, gsdlCGI.pm and metadata-server.pl updated are updated  
     2205  <!-- gliserver.pl, gsdlCGI.pm, metadata-server.pl and checksum.pl are updated  
    21772206       alongside this prepare-gli target in target prepare-collection-building --> 
    21782207  <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present"> 
     
    21892218  </target> 
    21902219 
    2191   <!-- svn checkout gliserver.pl, gsdlCGI.pm for gli applet, 
    2192        as well as gsdlCGI.pm-dependent metadata-server.pl  
    2193        (checksum.pl used only by GS2 for depositdspace.dm) --> 
     2220  <!-- svn checkout gliserver.pl, gsdlCGI.pm for gli applet, as well as gsdlCGI.pm-dependent metadata-server.pl  
     2221       (checksum.pl is used by GS2 for depositdspace.dm and may eventually be used by GS3 too) --> 
    21942222  <target name="svnupdate-cgi"> 
    21952223 
     
    22082236      <arg value="-r"/><arg value="${branch.revision}"/> 
    22092237      <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/metadata-server.pl"/> 
     2238    </exec> 
     2239    <exec executable="svn" dir="web/WEB-INF/cgi"> 
     2240      <arg value="export"/> 
     2241      <arg value="-r"/><arg value="${branch.revision}"/> 
     2242      <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/checksum.pl"/> 
    22102243    </exec> 
    22112244  </target>