[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: hash-type in sum utils

From: Ondrej Oprala
Subject: Re: RFE: hash-type in sum utils
Date: Thu, 26 Jul 2012 07:59:58 -0400 (EDT)

Ok, here is my patch proposition. I hope it's satisfactory.

----- Original Message -----
From: "Pádraig Brady" <address@hidden>
To: "Ondrej Oprala" <address@hidden>
Cc: address@hidden, "D Yu Bolkhovityanov" <address@hidden>
Sent: Wednesday, July 25, 2012 11:24:59 PM
Subject: Re: RFE: hash-type in sum utils

On 07/25/2012 02:23 PM, Ondrej Oprala wrote:
> How should the '--tag' switch treat binary files? Should it create something 
> like this:
> MD5 (*filename) = ........   ?

Good question.
I wouldn't tag the filenamem because to be unambiguous you'd
have to have a space before the filename in text (default) mode,
and that would impact the current support for BSD format checksums.

I'd be inclined to tag just before the checksum like:

MD5 (filename) = binary_checksum (default for files on dos)
 MD5 (filename) = text_checksum  (default for files elsewhere)

I.E. in binary mode just use BSD format,
and add the extra space when generating text format.
This has the advantage of being mostly backwards compatible.
I.E. the existing GNU *sum utils accept a space before "MD5",
and so newer GNU `*sum --tag` output would be --check able on older
and other checksum utils.  The only backwards compat edge case
is with `*sum --tag --text` on dos, which would only be
compat with the newer versions of the GNU *sum tools.
But that's fine IMHO.

Another thing to consider if generating BSD format output,
is file name escaping.
Perhaps we want to follow BSDs rules here too,
which seems to use just use \ and ^ within the (filename brackets).
Doing that would allow use to be fully compat with their checksums and
also avoid the awkward backslash at start of line mode GNU currently uses,
which is not compatible with BSD format processing.


Attachment: sum-utils_prefix_patch.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]