ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Ficker <m.fic...@googlemail.com>
Subject Re: checksum task: how can you use hash in a separate directory
Date Tue, 12 Feb 2008 22:01:53 GMT
You could backup the directory with the checksums and later use a
fileset with different selector  to select those
hash file that have changed.
Example:

<project name="test" default="test">
   
    <target name="hash">     
        <checksum todir="checksums">
            <fileset dir="src" includes ="**/*"/>
        </checksum>          
    </target>
      
    <target name = "verify">
        <checksum  todir="newchecksums">
            <fileset dir="src" includes ="**/*"/>       
        </checksum>
       
        <fileset id="result" dir="checksums">
           
            <different targetdir="newchecksums" ignoreFileTimes="true"/>
        </fileset>
        <echo>Changed Files: ${toString:result}</echo>       
    </target>       
</project>

Best regards

Martin

Bill Milbratz schrieb:
> Hi,
>
> Can anyone comment on the best way to solve this problem with the checksum
> task:
>
> I'm looking for a means to do the following:
> a) take hash-snapshots of shipped files in a directory (e.g. src/jsp)
> b) later, check the files against the hashes
> c) ant indicates which files do not match the hash.
>
>
> I've looked at the checksum documentation and the source code, but don't see
> a way I can see which specific files have changed.
>
> Yet, I may be missing something.
>
> thanks,
>
> bill
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message