https://issues.apache.org/bugzilla/show_bug.cgi?id=44662


Stefan Bodewig <bode...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX
   Target Milestone|---                         |1.8.0


--- Comment #1 from Stefan Bodewig <bode...@apache.org> 2009-08-26 03:05:21 PDT 
---
something like 

  <macrodef name="get-and-checksum">
    <attribute name="url"/>
    <attribute name="dest"/>
    <sequential>
      <get src="@{url}" dest="@{dest}"/>
      <get src="@{url}.sha1" dest="@{dest}.sha"/>
      <local name="checksum.matches"/>
      <local name="checksum.matches.fail"/>
      <checksum file="@{dest}" algorithm="sha" fileext=".sha"
                verifyproperty="checksum.matches"/>
      <condition property="checksum.matches.fail">
        <equals arg1="${checksum.matches}" arg2="false"/>
      </condition>
      <fail if="checksum.matches.fail">Checksum error</fail>
    </sequential>
  </macrodef>

or its Ant 1.7.1 compatible variant

  <macrodef name="get-and-checksum">
    <attribute name="url"/>
    <attribute name="dest"/>
    <sequential>
      <get src="@{url}" dest="@{dest}"/>
      <get src="@{url}.sha1" dest="@{dest}.sha"/>
      <checksum file="@{dest}" algorithm="sha" fileext=".sha"
                verifyproperty="checksum.match...@{dest}"/>
      <condition property="checksum.matches.fa...@{dest}">
        <equals arg1="${checksum.match...@{dest}}" arg2="false"/>
      </condition>
      <fail if="checksum.matches.fa...@{dest}">Checksum error</fail>
    </sequential>
  </macrodef>

will do, no need to augment <get>.

svn revision 807950 contains the first incarnation in the <get> manual page.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to