GNU bug report logs - #26002
[patch] md5sum --digest-only

Previous Next

Package: coreutils;

Reported by: Michael Vogt <mvo <at> ubuntu.com>

Date: Mon, 6 Mar 2017 16:20:02 UTC

Severity: wishlist

Tags: patch, wontfix

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26002 in the body.
You can then email your comments to 26002 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#26002; Package coreutils. (Mon, 06 Mar 2017 16:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Vogt <mvo <at> ubuntu.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 06 Mar 2017 16:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Vogt <mvo <at> ubuntu.com>
To: bug-coreutils <at> gnu.org
Subject: [patch] md5sum --digest-only
Date: Mon, 6 Mar 2017 08:55:59 +0100
[Message part 1 (text/plain, inline)]
Hi,

this is a bit of a RFC (anlong with a patch). I would like to have an
option in md5sum (and friends) that displays only the digest without
the filename. The use-case is mostly package maintainer scripts. They
often need the md5sum to e.g. check if a conffile has changed and use
patterns like:

  `md5sum /etc/papersize 2> /dev/null | awk '{print $1}'`
  `md5sum /etc/lsb-release | cut -d" " -f1`
  $(md5sum /etc/networks | sed -e 's/ .*//')

Having a --digest-only option in md5sum would make this a bit more
uniform.

Attached is a small patch, if the suggestion gets accepted I'm happy
to flesh it out more and write the man-page entry and tests.

Cheers,
 Michael
[coreutils-md5sum-digest-only.diff (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#26002; Package coreutils. (Tue, 07 Mar 2017 04:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 26002 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Michael Vogt <mvo <at> ubuntu.com>, 26002 <at> debbugs.gnu.org
Subject: Re: bug#26002: [patch] md5sum --digest-only
Date: Mon, 6 Mar 2017 20:26:07 -0800
On 05/03/17 23:55, Michael Vogt wrote:
> Hi,
> 
> this is a bit of a RFC (anlong with a patch). I would like to have an
> option in md5sum (and friends) that displays only the digest without
> the filename. The use-case is mostly package maintainer scripts. They
> often need the md5sum to e.g. check if a conffile has changed and use
> patterns like:
> 
>   `md5sum /etc/papersize 2> /dev/null | awk '{print $1}'`
>   `md5sum /etc/lsb-release | cut -d" " -f1`
>   $(md5sum /etc/networks | sed -e 's/ .*//')
> 
> Having a --digest-only option in md5sum would make this a bit more
> uniform.
> 
> Attached is a small patch, if the suggestion gets accepted I'm happy
> to flesh it out more and write the man-page entry and tests.

This is one of those marginal ones, previously discussed as indicated at:
https://www.gnu.org/software/coreutils/rejected_requests.html#checksum

Note your forms above don't handle the case where a leading '\'
is added for certain edge case filenames.
The most general solution would be something like:

  md5sum < the_file | cut -f1 -d' '

I suppose you could avoid the new option and behave like wc.
I.E. don't print the extraneous '-' at all.
That would also be backwards compat with all the processing forms above.
Though not forwards compat, in that new scripts running against
older versions of md5sum would now not work.

Given the minimal/obvious processing involved,
I'm still slightly in favor for leaving as is.

thanks,
Pádraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#26002; Package coreutils. (Tue, 07 Mar 2017 08:05:03 GMT) Full text and rfc822 format available.

Message #11 received at 26002 <at> debbugs.gnu.org (full text, mbox):

From: Michael Vogt <mvo <at> ubuntu.com>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 26002 <at> debbugs.gnu.org
Subject: Re: bug#26002: [patch] md5sum --digest-only
Date: Tue, 7 Mar 2017 09:04:02 +0100
On Mon, Mar 06, 2017 at 08:26:07PM -0800, Pádraig Brady wrote:
> On 05/03/17 23:55, Michael Vogt wrote:
[..]
> >   `md5sum /etc/papersize 2> /dev/null | awk '{print $1}'`
> >   `md5sum /etc/lsb-release | cut -d" " -f1`
> >   $(md5sum /etc/networks | sed -e 's/ .*//')
> > 
> > Having a --digest-only option in md5sum would make this a bit more
> > uniform.
> > 
> > Attached is a small patch, if the suggestion gets accepted I'm happy
> > to flesh it out more and write the man-page entry and tests.
> 
> This is one of those marginal ones, previously discussed as indicated at:
> https://www.gnu.org/software/coreutils/rejected_requests.html#checksum
[..]

Aha, thanks! I found the discussion about it now and see this was
already discussed. Sorry that I have not found in earlier.

> Note your forms above don't handle the case where a leading '\'
> is added for certain edge case filenames.
> The most general solution would be something like:
> 
>   md5sum < the_file | cut -f1 -d' '

Thanks for this. I was mostly working on this because I saw a bunch of
different ways to solve this problem. Here is another example:
    hash=$(set -- $(md5sum some-file) && echo "$1")
(and there are more).

Given that it is a common use-case I was hoping that *sum could
provide a single obvious way to do it. But I do understand that each
extra option adds maintenance burden of coreutils.

> I suppose you could avoid the new option and behave like wc.
> I.E. don't print the extraneous '-' at all.
> That would also be backwards compat with all the processing forms above.
> Though not forwards compat, in that new scripts running against
> older versions of md5sum would now not work.
> Given the minimal/obvious processing involved,
> I'm still slightly in favor for leaving as is.

For my use-case it would be a nice step forward. The scripts I deal
with usually run in the context of a given distro release. 

Cheers,
 Michael




Information forwarded to bug-coreutils <at> gnu.org:
bug#26002; Package coreutils. (Wed, 24 Oct 2018 20:38:01 GMT) Full text and rfc822 format available.

Message #14 received at 26002 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 26002 <at> debbugs.gnu.org
Subject: Re: bug#26002: [patch] md5sum --digest-only
Date: Wed, 24 Oct 2018 14:36:52 -0600
severity 26002 wishlist
tags 26002 wontfix
close 26002
stop

(triaging old bugs)

On 07/03/17 01:04 AM, Michael Vogt wrote:
> On Mon, Mar 06, 2017 at 08:26:07PM -0800, Pádraig Brady wrote:
>> On 05/03/17 23:55, Michael Vogt wrote:
> [..]
>>>    `md5sum /etc/papersize 2> /dev/null | awk '{print $1}'`
>>>    `md5sum /etc/lsb-release | cut -d" " -f1`
>>>    $(md5sum /etc/networks | sed -e 's/ .*//')
>>>
>>> Having a --digest-only option in md5sum would make this a bit more
>>> uniform.
>>>
>> This is one of those marginal ones, previously discussed as indicated at:
>> https://www.gnu.org/software/coreutils/rejected_requests.html#checksum
> [..]
> Aha, thanks! I found the discussion about it now and see this was
> already discussed. Sorry that I have not found in earlier.

With no further comments in a year and a half,
I'm closing this as "wont fix".

Discussion can continue by replying to this thread.
 - assaf




Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 20:38:02 GMT) Full text and rfc822 format available.

Added tag(s) wontfix. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 20:38:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 26002 <at> debbugs.gnu.org and Michael Vogt <mvo <at> ubuntu.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 20:38:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 22 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.