In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/f5957b2f8fe72d02f44bba1d1da1eb1dc6c5c6ae?hp=47a9c2580a689eb6252f710c8ff39c9c9fb2c7cb>
- Log ----------------------------------------------------------------- commit f5957b2f8fe72d02f44bba1d1da1eb1dc6c5c6ae Author: Aaron Crane <[email protected]> Date: Tue Mar 18 18:51:54 2014 +0000 Fix minor inaccuracy in the release manager's guide M Porting/release_managers_guide.pod commit 626ec6d78ccfe68db9586606c40e6bad60f064cb Author: Aaron Crane <[email protected]> Date: Tue Mar 18 18:50:38 2014 +0000 Upgrade Digest-SHA from 5.87 to 5.88 [DELTA] - added OUTPUT clause in SHA.xs to silence compiler warning -- ref. shaclose() - changed text file test (-T) to act on filehandles -- ref. addfile portable mode -- improves consistency when reading from STDIN -- still acts on filenames for early Perls (< 5.6) - added -M and -V options to shasum -- undocumented: for development and testing use only M Porting/Maintainers.pl M cpan/Digest-SHA/SHA.xs M cpan/Digest-SHA/lib/Digest/SHA.pm M cpan/Digest-SHA/shasum M cpan/Digest-SHA/src/sha.c M cpan/Digest-SHA/src/sha.h M cpan/Digest-SHA/src/sha64bit.c M cpan/Digest-SHA/src/sha64bit.h ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 2 +- Porting/release_managers_guide.pod | 2 +- cpan/Digest-SHA/SHA.xs | 2 ++ cpan/Digest-SHA/lib/Digest/SHA.pm | 38 +++++++++++--------- cpan/Digest-SHA/shasum | 72 ++++++++++++++++++++++++-------------- cpan/Digest-SHA/src/sha.c | 8 ++--- cpan/Digest-SHA/src/sha.h | 6 ++-- cpan/Digest-SHA/src/sha64bit.c | 12 +++++++ cpan/Digest-SHA/src/sha64bit.h | 14 ++++++-- 9 files changed, 101 insertions(+), 55 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 906ac90..b9b6732 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -382,7 +382,7 @@ use File::Glob qw(:case); }, 'Digest::SHA' => { - 'DISTRIBUTION' => 'MSHELOR/Digest-SHA-5.87.tar.gz', + 'DISTRIBUTION' => 'MSHELOR/Digest-SHA-5.88.tar.gz', 'FILES' => q[cpan/Digest-SHA], 'EXCLUDED' => [ qw( t/pod.t diff --git a/Porting/release_managers_guide.pod b/Porting/release_managers_guide.pod index c1eeff1..4504b4e 100644 --- a/Porting/release_managers_guide.pod +++ b/Porting/release_managers_guide.pod @@ -251,7 +251,7 @@ C<git checkout .gitignore> in the F<cpan/Distro> directory. =item * Remove files we do not need. That is, remove any files that match the -entries in C<@IGNORE> in F<Porting/Maintainer.pl>, and anything that +entries in C<@IGNORABLE> in F<Porting/Maintainer.pl>, and anything that matches the C<EXCLUDED> section of the distro's entry in the C<%Modules> hash. diff --git a/cpan/Digest-SHA/SHA.xs b/cpan/Digest-SHA/SHA.xs index 743337f..c38fcc4 100644 --- a/cpan/Digest-SHA/SHA.xs +++ b/cpan/Digest-SHA/SHA.xs @@ -34,6 +34,8 @@ shaclose(s) CODE: RETVAL = shaclose(s); sv_setiv(SvRV(ST(0)), 0); +OUTPUT: + RETVAL SHA * shadup(s) diff --git a/cpan/Digest-SHA/lib/Digest/SHA.pm b/cpan/Digest-SHA/lib/Digest/SHA.pm index c13e30d..57f0bd6 100644 --- a/cpan/Digest-SHA/lib/Digest/SHA.pm +++ b/cpan/Digest-SHA/lib/Digest/SHA.pm @@ -7,7 +7,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Fcntl; use integer; -$VERSION = '5.87'; +$VERSION = '5.88'; require Exporter; require DynaLoader; @@ -108,6 +108,20 @@ sub _addfile { # this is "addfile" from Digest::base 1.00 $self; } +my $_can_T_filehandle; + +sub _istext { + local *FH = shift; + my $file = shift; + + if (! defined $_can_T_filehandle) { + local $^W = 0; + eval { -T FH }; + $_can_T_filehandle = $@ ? 0 : 1; + } + return $_can_T_filehandle ? -T FH : -T $file; +} + sub Addfile { my ($self, $file, $mode) = @_; @@ -135,27 +149,17 @@ sub Addfile { } binmode(FH) if $binary || $portable; - unless ($portable && -T $file) { + unless ($portable && _istext(*FH, $file)) { $self->_addfile(*FH); close(FH); return($self); } - my ($n1, $n2); - my ($buf1, $buf2) = ("", ""); - - while (($n1 = read(FH, $buf1, 4096))) { - while (substr($buf1, -1) eq "\015") { - $n2 = read(FH, $buf2, 4096); - _bail("Read failed") unless defined $n2; - last unless $n2; - $buf1 .= $buf2; - } - $buf1 =~ s/\015?\015\012/\012/g; # DOS/Windows - $buf1 =~ s/\015/\012/g; # early MacOS - $self->add($buf1); + while (<FH>) { + s/\015?\015\012/\012/g; # DOS/Windows + s/\015/\012/g; # early MacOS + $self->add($_); } - _bail("Read failed") unless defined $n1; close(FH); $self; @@ -257,7 +261,7 @@ sub load { my $file = shift; $file = "-" if (!defined($file) || $file eq ""); - + local *FH; open(FH, "< $file") or return; my $str = join('', <FH>); diff --git a/cpan/Digest-SHA/shasum b/cpan/Digest-SHA/shasum index 606393e..32b7173 100644 --- a/cpan/Digest-SHA/shasum +++ b/cpan/Digest-SHA/shasum @@ -4,8 +4,8 @@ ## ## Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved ## - ## Version: 5.87 - ## Mon Feb 17 16:42:02 MST 2014 + ## Version: 5.88 + ## Mon Mar 17 08:46:10 MST 2014 ## shasum SYNOPSIS adapted from GNU Coreutils sha1sum. ## Add an "-a" option for algorithm selection, a "-p" @@ -47,10 +47,11 @@ shasum - Print or Check SHA Checksums shasum -a 512224 -c checksumfile - The sums are computed as described in FIPS-180-4. When checking, 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, `?' for portable, `^' for BITS), and name for each FILE. + The sums are computed as described in FIPS PUB 180-4. When checking, + 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, `?' for portable, `^' for BITS), + and name for each FILE. Report shasum bugs to [email protected] @@ -97,23 +98,7 @@ use strict; use Fcntl; use Getopt::Long; -my $VERSION = "5.87"; - - - ## Try to use Digest::SHA. If not installed, use the slower - ## but functionally equivalent Digest::SHA::PurePerl instead. - -my $MOD_PREFER = "Digest::SHA"; -my $MOD_SECOND = "Digest::SHA::PurePerl"; - -my $module = $MOD_PREFER; -eval "require $module"; -if ($@) { - $module = $MOD_SECOND; - eval "require $module"; - die "Unable to find $MOD_PREFER or $MOD_SECOND\n" if $@; -} - +my $VERSION = "5.88"; sub usage { my($err, $msg) = @_; @@ -123,9 +108,11 @@ sub usage { warn($msg . "Type shasum -h for help\n"); exit($err); } - my($USAGE) = $POD =~ /SYNOPSIS\n\n(.+)\n=head1 DESCRIPTION\n/sm; + my($USAGE) = $POD =~ /SYNOPSIS(.+?)^=/sm; + $USAGE =~ s/^\s*//; + $USAGE =~ s/\s*$//; $USAGE =~ s/^ //gm; - print $USAGE; + print $USAGE, "\n"; exit($err); } @@ -139,7 +126,7 @@ select((select(STDERR), $| = 1)[0]); ## Collect options from command line my ($alg, $binary, $check, $text, $status, $warn, $help, $version); -my ($portable, $BITS); +my ($portable, $BITS, $modules, $versions); eval { Getopt::Long::Configure ("bundling") }; GetOptions( @@ -148,7 +135,9 @@ GetOptions( 's|status' => \$status, 'w|warn' => \$warn, 'h|help' => \$help, 'v|version' => \$version, 'p|portable' => \$portable, - '0|01' => \$BITS + '0|01' => \$BITS, + 'M|MODULES=s' => \$modules, + 'V|VERSIONS' => \$versions, ) or usage(1, ""); @@ -164,6 +153,28 @@ usage(1, "shasum: --status option used only when verifying checksums\n") if $status && !$check; + ## Try to use Digest::SHA. If not installed, use the slower + ## but functionally equivalent Digest::SHA::PurePerl instead. + + ## If option -M "Mod::Num1 Mod::Num2 ..." is invoked, try + ## those modules instead, in the order indicated. + +my @MODS = defined $modules + ? split(" ", $modules) + : qw(Digest::SHA Digest::SHA::PurePerl); + +my $module; +for (@MODS) { + my $mod = $_; + if (eval "require $mod") { + $module = $mod; + last; + } +} +die "shasum: Unable to find " . join(" or ", @MODS) . "\n" + unless defined $module; + + ## Default to SHA-1 unless overridden by command line option $alg = 1 unless defined $alg; @@ -178,6 +189,13 @@ if ($version) { exit(0); } +if ($versions) { + print "shasum $VERSION\n"; + print "$module ", eval "\$${module}::VERSION", "\n"; + print "perl ", defined $^V ? sprintf("%vd", $^V) : $], "\n"; + exit(0); +} + ## Try to figure out if the OS is DOS-like. If it is, ## default to binary mode when reading files, unless diff --git a/cpan/Digest-SHA/src/sha.c b/cpan/Digest-SHA/src/sha.c index a848072..70ee233 100644 --- a/cpan/Digest-SHA/src/sha.c +++ b/cpan/Digest-SHA/src/sha.c @@ -1,12 +1,12 @@ /* * sha.c: routines to compute SHA-1/224/256/384/512 digests * - * Ref: NIST FIPS PUB 180-2 Secure Hash Standard + * Ref: NIST FIPS PUB 180-4 Secure Hash Standard * * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved * - * Version: 5.87 - * Mon Feb 17 16:42:02 MST 2014 + * Version: 5.88 + * Mon Mar 17 08:46:10 MST 2014 * */ @@ -93,7 +93,7 @@ static void sha1(SHA *s, UCHR *block) /* SHA-1 transform */ SHA32_SCHED(W, block); /* - * Use SHA-1 alternate method from FIPS PUB 180-2 (ref. 6.1.3) + * Use SHA-1 alternate method from FIPS PUB 180-4 (ref. 6.1.3) * * To improve performance, unroll the loop and consolidate assignments * by changing the roles of variables "a" through "e" at each step. diff --git a/cpan/Digest-SHA/src/sha.h b/cpan/Digest-SHA/src/sha.h index f79deb0..b9f1e70 100644 --- a/cpan/Digest-SHA/src/sha.h +++ b/cpan/Digest-SHA/src/sha.h @@ -1,12 +1,12 @@ /* * sha.h: header file for SHA-1/224/256/384/512 routines * - * Ref: NIST FIPS PUB 180-2 Secure Hash Standard + * Ref: NIST FIPS PUB 180-4 Secure Hash Standard * * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved * - * Version: 5.87 - * Mon Feb 17 16:42:02 MST 2014 + * Version: 5.88 + * Mon Mar 17 08:46:10 MST 2014 * */ diff --git a/cpan/Digest-SHA/src/sha64bit.c b/cpan/Digest-SHA/src/sha64bit.c index 6c90966..71f9978 100644 --- a/cpan/Digest-SHA/src/sha64bit.c +++ b/cpan/Digest-SHA/src/sha64bit.c @@ -1,3 +1,15 @@ +/* + * sha64bit.c: routines to compute SHA-384/512 digests + * + * Ref: NIST FIPS PUB 180-4 Secure Hash Standard + * + * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved + * + * Version: 5.88 + * Mon Mar 17 08:46:10 MST 2014 + * + */ + #ifdef SHA_384_512 #undef sha_384_512 diff --git a/cpan/Digest-SHA/src/sha64bit.h b/cpan/Digest-SHA/src/sha64bit.h index c4fe766..bdd7b1c 100644 --- a/cpan/Digest-SHA/src/sha64bit.h +++ b/cpan/Digest-SHA/src/sha64bit.h @@ -1,10 +1,20 @@ /* + * sha64bit.h: placeholder values for 64-bit data and routines + * + * Ref: NIST FIPS PUB 180-4 Secure Hash Standard + * + * Copyright (C) 2003-2014 Mark Shelor, All Rights Reserved + * + * Version: 5.88 + * Mon Mar 17 08:46:10 MST 2014 + * * The following macros supply placeholder values that enable the - * `sha.c' module to successfully compile when 64-bit integer types + * sha.c module to successfully compile when 64-bit integer types * aren't present. * - * They are appropriately redefined in `sha64bit.c` if the compiler + * They are appropriately redefined in sha64bit.c if the compiler * provides a 64-bit type (i.e. when SHA_384_512 is defined). + * */ #define sha_384_512 0 -- Perl5 Master Repository
