On 24.09.2009 15:35, Niklas Edmundsson wrote:
> On Thu, 24 Sep 2009, Graham Leggett wrote:
> 
>>> The huge benefit of this format is that the binaries can then be checked
>>> with same tools (option -c).
>>
>> With the downside that what you propose only works on Linux.
> 
> Rather, it only works on platforms where md5sum/sha1sum is installed.
> Don't confuse the OS platform with installed software (we see enough of
> that in the configure scripts of the world already ;).
> 
> The solutions I see are:
> - Require md5sum/sha1sum (best IMHO, it can't be THAT hard do install
>   on macosx).
> - Fallback on openssl but mangle the files to be md5sum/sha1sum style
>   (I'm blatantly assuming that the checksums are the same here).

Aaah:

openssl md5 somefile | \
   sed -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2  \1#' > \
   somefile.md5

openssl sha1 somefile | \
   sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2  \1#' > \
   somefile.sha1

gpg --print-md md5 somefile |\
   sed -e 's#\(.*\): \(.*\)#\2::\1#' \
       -e 's# ##g' -e 'y/ABCDEF/abcdef/' \
       -e 's#::#  #' > somefile.md5

gpg --print-md sha1 somefile |\
   sed -e 's#\(.*\): \(.*\)#\2::\1#' \
       -e 's# ##g' -e 'y/ABCDEF/abcdef/' \
       -e 's#::#  #' > somefile.sha1

Regards,

Rainer

Reply via email to