diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2017-09-22 11:05:46 +0100 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2017-09-22 11:05:46 +0100 |
commit | f4f12f2f3d60c9f8be71b8dd5dc680df5081e6fb (patch) | |
tree | 7b50d8c700ea52fc64de6c2a77d3021865267bdb /cpan/Digest-SHA | |
parent | 79656330a0811b95642a8239e923166ada7fb0a0 (diff) | |
download | perl-f4f12f2f3d60c9f8be71b8dd5dc680df5081e6fb.tar.gz |
Update Digest-SHA to CPAN version 5.97
[DELTA]
5.97 Wed Sep 6 02:23:02 MST 2017
- added 'quiet' option to shasum
-- thanks to Chris David for suggestion and initial patch
-- ref. rt.cpan.org #122750
- expanded shasum --help message
-- to explain use of escaped FILE names
Diffstat (limited to 'cpan/Digest-SHA')
-rw-r--r-- | cpan/Digest-SHA/lib/Digest/SHA.pm | 5 | ||||
-rw-r--r-- | cpan/Digest-SHA/shasum | 30 | ||||
-rw-r--r-- | cpan/Digest-SHA/src/sha.c | 6 | ||||
-rw-r--r-- | cpan/Digest-SHA/src/sha.h | 6 | ||||
-rw-r--r-- | cpan/Digest-SHA/src/sha64bit.c | 6 | ||||
-rw-r--r-- | cpan/Digest-SHA/src/sha64bit.h | 6 |
6 files changed, 34 insertions, 25 deletions
diff --git a/cpan/Digest-SHA/lib/Digest/SHA.pm b/cpan/Digest-SHA/lib/Digest/SHA.pm index e2c58f66e1..e8500367ac 100644 --- a/cpan/Digest-SHA/lib/Digest/SHA.pm +++ b/cpan/Digest-SHA/lib/Digest/SHA.pm @@ -8,7 +8,7 @@ use vars qw($VERSION @ISA @EXPORT_OK); use Fcntl qw(O_RDONLY); use integer; -$VERSION = '5.96'; +$VERSION = '5.97'; require Exporter; require DynaLoader; @@ -790,6 +790,7 @@ The author is particularly grateful to Sean Burke Chris Carey Alexandr Ciornii + Chris David Jim Doble Thomas Drugeon Julius Duque @@ -813,7 +814,7 @@ darkness and moored it in so perfect a calm and in so brilliant a light" =head1 COPYRIGHT AND LICENSE -Copyright (C) 2003-2016 Mark Shelor +Copyright (C) 2003-2017 Mark Shelor This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Digest-SHA/shasum b/cpan/Digest-SHA/shasum index 2721117151..59c3839b2e 100644 --- a/cpan/Digest-SHA/shasum +++ b/cpan/Digest-SHA/shasum @@ -2,10 +2,10 @@ ## shasum: filter for computing SHA digests (ref. sha1sum/md5sum) ## - ## Copyright (C) 2003-2016 Mark Shelor, All Rights Reserved + ## Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved ## - ## Version: 5.96 - ## Wed Jul 27 20:04:34 MST 2016 + ## Version: 5.97 + ## Wed Sep 6 02:23:02 MST 2017 ## shasum SYNOPSIS adapted from GNU Coreutils sha1sum. Add ## "-a" option for algorithm selection, @@ -44,8 +44,9 @@ shasum - Print or Check SHA Checksums all other characters ignored -p, --portable read in portable mode (to be deprecated) - The following two options are useful only when verifying checksums: + The following three options are useful only when verifying checksums: -s, --status don't output anything, status code shows success + -q, --quiet don't print OK for each successfully verified file -w, --warn warn about improperly formatted checksum lines -h, --help display this help and exit @@ -60,7 +61,10 @@ shasum - Print or Check SHA Checksums the input should be a former output of this program. The default mode is to print a line with checksum, a character indicating type (`*' for binary, ` ' for text, `U' for UNIVERSAL, `^' for BITS, `?' - for portable), and name for each FILE. + for portable), and name for each FILE. The line starts with a `\' + character if the FILE name contains either newlines or backslashes, + which are then replaced by the two-character sequences `\n' and `\\' + respectively. Report shasum bugs to mshelor@cpan.org @@ -92,7 +96,7 @@ the 7-bit message I<0001100>: =head1 AUTHOR -Copyright (c) 2003-2016 Mark Shelor <mshelor@cpan.org>. +Copyright (c) 2003-2017 Mark Shelor <mshelor@cpan.org>. =head1 SEE ALSO @@ -103,7 +107,7 @@ L<Digest::SHA::PurePerl>. END_OF_POD -my $VERSION = "5.96"; +my $VERSION = "5.97"; sub usage { my($err, $msg) = @_; @@ -130,7 +134,7 @@ select((select(STDERR), $| = 1)[0]); ## Collect options from command line -my ($alg, $binary, $check, $text, $status, $warn, $help, $version); +my ($alg, $binary, $check, $text, $status, $quiet, $warn, $help, $version); my ($portable, $BITS, $reverse, $UNIVERSAL, $versions); eval { Getopt::Long::Configure ("bundling") }; @@ -138,6 +142,7 @@ GetOptions( 'b|binary' => \$binary, 'c|check' => \$check, 't|text' => \$text, 'a|algorithm=i' => \$alg, 's|status' => \$status, 'w|warn' => \$warn, + 'q|quiet' => \$quiet, 'h|help' => \$help, 'v|version' => \$version, 'p|portable' => \$portable, '0|01' => \$BITS, @@ -158,6 +163,8 @@ usage(1, "shasum: --warn option used only when verifying checksums\n") if $warn && !$check; usage(1, "shasum: --status option used only when verifying checksums\n") if $status && !$check; +usage(1, "shasum: --quiet option used only when verifying checksums\n") + if $quiet && !$check; ## Try to use Digest::SHA. If not installed, use the slower @@ -258,7 +265,7 @@ sub verify { my $checkfile = shift; my ($err, $fmt_errs, $read_errs, $match_errs) = (0, 0, 0, 0); my ($num_lines, $num_files) = (0, 0); - my ($bslash, $sum, $fname, $rsp, $digest); + my ($bslash, $sum, $fname, $rsp, $digest, $isOK); local *FH; $checkfile eq '-' and open(FH, '< -') @@ -283,15 +290,16 @@ sub verify { $rsp = "$fname: "; $num_files++; ($binary, $text, $UNIVERSAL, $BITS, $portable) = map { $_ eq $modesym } ('*', ' ', 'U', '^', 'p'); + $isOK = 0; unless ($digest = sumfile($fname)) { $rsp .= "FAILED open or read\n"; $err = 1; $read_errs++; } else { - if (lc($sum) eq $digest) { $rsp .= "OK\n" } + if (lc($sum) eq $digest) { $rsp .= "OK\n"; $isOK = 1 } else { $rsp .= "FAILED\n"; $err = 1; $match_errs++ } } - print $rsp unless $status; + print $rsp unless ($status || ($quiet && $isOK)); } close(FH); unless ($num_files) { diff --git a/cpan/Digest-SHA/src/sha.c b/cpan/Digest-SHA/src/sha.c index fae9bb4f6e..51f472cd1d 100644 --- a/cpan/Digest-SHA/src/sha.c +++ b/cpan/Digest-SHA/src/sha.c @@ -3,10 +3,10 @@ * * Ref: NIST FIPS PUB 180-4 Secure Hash Standard * - * Copyright (C) 2003-2016 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved * - * Version: 5.96 - * Wed Jul 27 20:04:34 MST 2016 + * Version: 5.97 + * Wed Sep 6 02:23:02 MST 2017 * */ diff --git a/cpan/Digest-SHA/src/sha.h b/cpan/Digest-SHA/src/sha.h index ca34741342..9fd6feb9e5 100644 --- a/cpan/Digest-SHA/src/sha.h +++ b/cpan/Digest-SHA/src/sha.h @@ -3,10 +3,10 @@ * * Ref: NIST FIPS PUB 180-4 Secure Hash Standard * - * Copyright (C) 2003-2016 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved * - * Version: 5.96 - * Wed Jul 27 20:04:34 MST 2016 + * Version: 5.97 + * Wed Sep 6 02:23:02 MST 2017 * */ diff --git a/cpan/Digest-SHA/src/sha64bit.c b/cpan/Digest-SHA/src/sha64bit.c index 860b52c0ef..be02564eb5 100644 --- a/cpan/Digest-SHA/src/sha64bit.c +++ b/cpan/Digest-SHA/src/sha64bit.c @@ -3,10 +3,10 @@ * * Ref: NIST FIPS PUB 180-4 Secure Hash Standard * - * Copyright (C) 2003-2016 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved * - * Version: 5.96 - * Wed Jul 27 20:04:34 MST 2016 + * Version: 5.97 + * Wed Sep 6 02:23:02 MST 2017 * */ diff --git a/cpan/Digest-SHA/src/sha64bit.h b/cpan/Digest-SHA/src/sha64bit.h index aef4426efe..4e1d7990e7 100644 --- a/cpan/Digest-SHA/src/sha64bit.h +++ b/cpan/Digest-SHA/src/sha64bit.h @@ -3,10 +3,10 @@ * * Ref: NIST FIPS PUB 180-4 Secure Hash Standard * - * Copyright (C) 2003-2016 Mark Shelor, All Rights Reserved + * Copyright (C) 2003-2017 Mark Shelor, All Rights Reserved * - * Version: 5.96 - * Wed Jul 27 20:04:34 MST 2016 + * Version: 5.97 + * Wed Sep 6 02:23:02 MST 2017 * * The following macros supply placeholder values that enable the * sha.c module to successfully compile when 64-bit integer types |