From: Zygo Blaxell Date: Sat, 15 Sep 2012 02:43:29 +0000 (-0400) Subject: Digest::SHA: deprecate Digest::SHA1, bump version to 0.20120914 and copyright year... X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;hp=5d6afd72794a9be8dcf2040fd4cad7fb1ad75cd6;p=dupemerge Digest::SHA: deprecate Digest::SHA1, bump version to 0.20120914 and copyright year to 2012 --- diff --git a/dm6 b/dm6 index ff3a9eb..a3c7b9e 100755 --- a/dm6 +++ b/dm6 @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); +use Digest::SHA qw(sha1 sha1_hex sha1_base64); use Fcntl qw(:DEFAULT :flock); use File::Compare; use File::Path; @@ -9,7 +9,7 @@ use File::Temp; use File::stat; use MIME::Base64; -# Copyright (C) 2010 Zygo Blaxell +# Copyright (C) 2010-2012 Zygo Blaxell # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ use MIME::Base64; sub digest { my ($filename) = (@_); die "'$filename' is not a plain file" if (-l $filename) || ! (-f _); - my $ctx = Digest::SHA1->new; + my $ctx = Digest::SHA->new; sysopen(FILE, $filename, O_RDONLY|O_NONBLOCK) or die "open: $filename: $!"; binmode(FILE); # FIXME: Necessary? Probably harmless... $ctx->addfile(\*FILE); @@ -41,7 +41,7 @@ sub usage { Usage: $0 link-dir Hashes a NUL-separated list of files on stdin into link-dir. -Version: 0.20101024 +Version: 0.20120914 USAGE } diff --git a/faster-dupemerge b/faster-dupemerge index 2c85685..62f4bc9 100755 --- a/faster-dupemerge +++ b/faster-dupemerge @@ -42,11 +42,11 @@ my $lost_bytes = 0; my $surprises = 0; eval ' - use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); + use Digest::SHA qw(sha1 sha1_hex sha1_base64); '; if ($@) { - warn "Digest::SHA1: $@\nUsing external md5sum program to generate hashes.\nPlease install Digest::SHA1 (libdigest-sha1-perl)"; + warn "Digest::SHA: $@\nUsing external md5sum program to generate hashes.\nPlease install Digest::SHA"; eval <<'DIGEST'; sub really_digest { @@ -72,7 +72,7 @@ DIGEST sub really_digest { my ($filename) = (@_); die "'$filename' is not a plain file" if (-l $filename) || ! (-f _); - my $ctx = Digest::SHA1->new; + my $ctx = Digest::SHA->new; sysopen(FILE, $filename, O_RDONLY|O_NONBLOCK) or die "open: $filename: $!"; binmode(FILE); # FIXME: Necessary? Probably harmless... $ctx->addfile(\*FILE); @@ -180,7 +180,7 @@ hard links). either hashed (if it is below the --skip-hash size threshold) or compared (if it is above), but never both. -Version: 0.20120103 +Version: 0.20120914 USAGE }