This description uses the real data for: jakarta-ant-1.5.1-bin.tar.gz Currently the MD5 signature file is 2be27d9e09011bf1cc3d1967ee34f7d1 Why not change it to the md5sum output of: 2be27d9e09011bf1cc3d1967ee34f7d1 *jakarta-ant-1.5.1-bin.tar.gz This way one can easily check the file using $ md5sum -c jakarta-ant-1.5.1- bin.tar.gz.md5 Cheers, Ryan
Created attachment 12406 [details] Patch File containg diffs for checkstyle modification
I've added a partially tested patch for checksum to have file formats added. I've not build the ant source yet so its untested, please feel free to try it out and add any comments.
I'd probably turn the format attribute into an EnumeratedAttribute and defer writing/parsing of the format to a strategy or something similar. Skipping to the first equals sign when we find MD5 at the start of the line doesn't look scalable if anybody wants to implement yet another format ;-)
Hmm, thinking about it once again, we probably should have an attribute that takes a format string like "{0} *{1}" where the task would replace {0] with the checksum and [1} with the filename. On top of that we could have a different attribute that selects one of the well known formats by name, i.e. MD5SUM for "{0} *{1}" and SVF for "MD5 ({1}) = {0]". I'm not entirely sure how the formats deal with relative paths, do you have any quick pointers to the format specification? I do have a manual page for md5sum on my Linux box, but it doesn't talk about relative file names.
On BSD, it is relative to the point you are executing md5 so here is an example mdiggory@minotaur:/home/mdiggory> md5 jakarta-commons/math/project.xml MD5 (jakarta-commons/math/project.xml) = c0e775c3e5900ab006acf0f86fae0c37 On Linux its the same: [root@lorien mdiggory]# md5sum workspace/jakarta-commons/math/project.xml f82313b7772b9c6a9ef9e247021a26ef workspace/jakarta-commons/math/project.xml I like the parameterization idea, but do not think it currently neccessary to implement the existing formats. If its easy to do, then great, we should. -Mark
MessageFormat does most of the heavy lifting, it turned out to be not that difficult at all. OK, code is in CVS HEAD, docs are missing.
docs commited