Changeset c655d23 for build.xml


Ignore:
Timestamp:
Jun 15, 2011 1:30:24 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
facbb8c9
Parents:
89191f4
Message:
  • Updates:
    • Add the router version to the zip file comment in the updater
    • Add a class to extract the zip file comment
    • Require the sud version header to match the zip file comment to prevent spoofing of the version number, since the version number in the header is not covered by the sud signature.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r89191f4 rc655d23  
    317317        <ant dir="apps/desktopgui" target="poupdate" />
    318318    </target>
    319     <target name="javadoc">
     319
     320    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
    320321        <ant dir="apps/jetty" target="ensureJettylib" />
    321322        <mkdir dir="./build" />
    322323        <mkdir dir="./build/javadoc" />
    323         <!-- get release and build version numbers -->
    324         <exec executable="grep" outputproperty="versionLine" >
    325             <arg value="public final static String VERSION" />
    326             <arg value="core/java/src/net/i2p/CoreVersion.java" />
    327         </exec>
    328         <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" >
    329             <arg value="-f2" />
    330             <arg value="-d&quot;" />
    331         </exec>
    332         <exec executable="grep" outputproperty="buildLine" >
    333             <arg value="public final static long BUILD" />
    334             <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
    335         </exec>
    336         <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" >
    337             <arg value="-f2" />
    338             <arg value="-d=" />
    339         </exec>
    340         <exec executable="cut" inputstring="${build.temp}" outputproperty="build.number" >
    341             <arg value="-f1" />
    342             <arg value="-d;" />
    343         </exec>
    344324        <javadoc access="package"
    345325            destdir="./build/javadoc"
     
    396376    </target>
    397377
     378    <target name="getReleaseNumber" >
     379        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
     380            <arg value="public final static String VERSION" />
     381            <arg value="core/java/src/net/i2p/CoreVersion.java" />
     382        </exec>
     383        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
     384            <arg value="-f2" />
     385            <arg value="-d&quot;" />
     386        </exec>
     387        <echo message="Release number is ${release.number}" />
     388    </target>
     389
     390    <target name="getBuildNumber" >
     391        <exec executable="grep" outputproperty="buildLine" >
     392            <arg value="public final static long BUILD" />
     393            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
     394        </exec>
     395        <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" failonerror="true" >
     396            <arg value="-f2" />
     397            <arg value="-d=" />
     398        </exec>
     399        <exec executable="cut" inputstring="${build.temp}" outputproperty="build.number" failonerror="true" >
     400            <arg value="-f1" />
     401            <arg value="-d;" />
     402        </exec>
     403        <echo message="Build number is ${build.number}" />
     404    </target>
     405
    398406    <target name="clean" depends="pkgclean" >
    399407        <delete dir="./build" />
     
    705713    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
    706714    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
    707     <target name="zipit">
    708         <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" />
     715
     716    <target name="zipit" depends="getReleaseNumber" >
     717        <!--
     718             As of release 0.8.8, the router will enforce a zipfile comment equal to the
     719             version number in the sud/su2 header, since the version in the header is NOT
     720             covered by the signature.
     721         -->
     722        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
    709723       <!-- just a test, makes almost no difference
    710724        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
     
    712726       -->
    713727    </target>
    714     <target name="zipit200">
    715         <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" />
     728
     729    <target name="zipit200" depends="getReleaseNumber" >
     730        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
    716731    </target>
    717732
     
    980995         since preppkg puts too much stuff in pkg-temp -->
    981996<!--
    982     <target name="release" depends="distclean, updater, updater200, preppkg, installer" >
     997    <target name="release" depends="distclean, updater, updater200, preppkg, installer, getReleaseNumber" >
    983998-->
    984     <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer" >
     999    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
    9851000        <echo message="================================================================" />
    9861001        <echo message="Did you update these files?" />
     
    9981013        </exec>
    9991014        <echo message="If there are any modified files above, stop now!" />
    1000         <!-- get release version number -->
    1001         <exec executable="grep" outputproperty="versionLine" failonerror="true" >
    1002             <arg value="public final static String VERSION" />
    1003             <arg value="core/java/src/net/i2p/CoreVersion.java" />
    1004         </exec>
    1005         <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
    1006             <arg value="-f2" />
    1007             <arg value="-d&quot;" />
    1008         </exec>
     1015
    10091016        <echo message="New version number is ${release.number}" />
    10101017        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
     
    10411048                <pathelement location="build/i2p.jar" />
    10421049            </classpath>
     1050            <arg value="verifyversion" />
     1051            <arg value="i2pupdate.sud" />
     1052        </java>
     1053        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
     1054            <classpath>
     1055                <pathelement location="build/i2p.jar" />
     1056            </classpath>
    10431057            <arg value="showversion" />
    10441058            <arg value="i2pupdate.sud" />
     
    10611075            </classpath>
    10621076            <arg value="verifysig" />
     1077            <arg value="i2pupdate.su2" />
     1078        </java>
     1079        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
     1080            <classpath>
     1081                <pathelement location="build/i2p.jar" />
     1082            </classpath>
     1083            <arg value="verifyversion" />
    10631084            <arg value="i2pupdate.su2" />
    10641085        </java>
Note: See TracChangeset for help on using the changeset viewer.