You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/03/23 14:12:42 UTC
DO NOT REPLY [Bug 44662] New: Task 'get' should handle the checksum
autmatically.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44662
Summary: Task 'get' should handle the checksum autmatically.
Product: Ant
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Core tasks
AssignedTo: notifications@ant.apache.org
ReportedBy: gustav_weber75@yahoo.com
Task 'get' should handle the checking of the downloaded file (using available
checksum files from the download server) automatically and transparent for the
user.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44662] Task 'get' should handle the checksum
autmatically.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44662
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
Target Milestone|--- |1.8.0
--- Comment #1 from Stefan Bodewig <bo...@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.matches.@{dest}"/>
<condition property="checksum.matches.fail.@{dest}">
<equals arg1="${checksum.matches.@{dest}}" arg2="false"/>
</condition>
<fail if="checksum.matches.fail.@{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.