Digest::SHA: deprecate Digest::SHA1, bump version to 0.20120914 and copyright year... master staging/master
authorZygo Blaxell <zblaxell@faye.furryterror.org>
Sat, 15 Sep 2012 02:43:29 +0000 (22:43 -0400)
committerZygo Blaxell <zblaxell@faye.furryterror.org>
Sat, 15 Sep 2012 02:43:29 +0000 (22:43 -0400)
dm6
faster-dupemerge

diff --git a/dm6 b/dm6
index ff3a9eb2b57244eed3ac9c8d071ebf58c5afcbf9..a3c7b9ea1541662ef0f5825b21a8f599b2d5bb58 100755 (executable)
--- a/dm6
+++ b/dm6
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
 #!/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;
 use Fcntl qw(:DEFAULT :flock);
 use File::Compare;
 use File::Path;
@@ -9,7 +9,7 @@ use File::Temp;
 use File::stat;
 use MIME::Base64;
 
 use File::stat;
 use MIME::Base64;
 
-# Copyright (C) 2010 Zygo Blaxell <dupemerge@mailtoo.hungrycats.org>
+# Copyright (C) 2010-2012 Zygo Blaxell <dupemerge@mailtoo.hungrycats.org>
 
 # 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
 
 # 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 _);
 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);
        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.
 
 Usage: $0 link-dir
 Hashes a NUL-separated list of files on stdin into link-dir.
 
-Version: 0.20101024
+Version: 0.20120914
 USAGE
 }
 
 USAGE
 }
 
index 2c85685b7056ba3c55abb05df99d84faf7aa34bb..62f4bc99c47b401bff653a252366eb9ef11e28e2 100755 (executable)
@@ -42,11 +42,11 @@ my $lost_bytes = 0;
 my $surprises = 0;
 
 eval '
 my $surprises = 0;
 
 eval '
-       use Digest::SHA1 qw(sha1 sha1_hex sha1_base64);
+       use Digest::SHA qw(sha1 sha1_hex sha1_base64);
 ';
 
 if ($@) {
 ';
 
 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 {
 
        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 _);
                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);
                        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.
 
 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
 }
 
 USAGE
 }