[Bps-public-commit] brackup branch, master, updated. 502dec147ab44397ff131c6cf87f4170a465060f

Alex Vandiver alexmv at bestpractical.com
Thu Jan 15 17:02:11 EST 2015


The branch, master has been updated
       via  502dec147ab44397ff131c6cf87f4170a465060f (commit)
       via  2c0cf8334578c95551f2410fb52c578bcac9c3c4 (commit)
      from  7da6e5c5a44a6dcbc108e24664eab5e7826ff654 (commit)

Summary of changes:
 Makefile.PL                   | 2 +-
 brackup-verify-chunks         | 2 +-
 lib/Brackup/CompositeChunk.pm | 4 ++--
 lib/Brackup/Config.pm         | 2 +-
 lib/Brackup/File.pm           | 4 ++--
 lib/Brackup/Restore.pm        | 4 ++--
 lib/Brackup/Test.pm           | 2 +-
 lib/Brackup/Util.pm           | 4 ++--
 8 files changed, 12 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit 2c0cf8334578c95551f2410fb52c578bcac9c3c4
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jan 15 16:59:33 2015 -0500

    Ensure a stable key ordering during inheritance traversal

diff --git a/lib/Brackup/Config.pm b/lib/Brackup/Config.pm
index 3e05967..06a5ead 100644
--- a/lib/Brackup/Config.pm
+++ b/lib/Brackup/Config.pm
@@ -67,7 +67,7 @@ sub load {
     # Config section inheritance
     my $loop_count = 0;
     while (keys %inherit) {
-      for my $child_sec (keys %inherit) {
+      for my $child_sec (sort keys %inherit) {
         # If this parent_sec itself inherits from something else, defer this time around
         next if exists $inherit{ $inherit{$child_sec} };
 

commit 502dec147ab44397ff131c6cf87f4170a465060f
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jan 15 17:02:06 2015 -0500

    Switch to Digest::SHA, as Digest::SHA1 is gone from Debian/Ubuntu

diff --git a/Makefile.PL b/Makefile.PL
index 31071f3..94c232a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -12,7 +12,7 @@ WriteMakefile( NAME            => 'Brackup',
                PREREQ_PM       => {
                    'ExtUtils::Manifest' => 1.52,    # For spaces in files in MANIFEST
                    'DBD::SQLite'        => 0,
-                   'Digest::SHA1'       => 0,
+                   'Digest::SHA'        => 0,
                    'DBI'                => 0,
                    'File::Temp'         => 0.19,    # require a seekable File::Temp + EXLOCK support
                    'IO::InnerFile'      => 0,
diff --git a/brackup-verify-chunks b/brackup-verify-chunks
index 938a560..aceec71 100755
--- a/brackup-verify-chunks
+++ b/brackup-verify-chunks
@@ -64,7 +64,7 @@ use warnings;
 use Cwd;
 use Getopt::Long;
 use File::Find::Rule;
-use Digest::SHA1 qw(sha1_hex);
+use Digest::SHA qw(sha1_hex);
 
 $|=1;
 
diff --git a/lib/Brackup/CompositeChunk.pm b/lib/Brackup/CompositeChunk.pm
index ebc8aeb..6a82639 100644
--- a/lib/Brackup/CompositeChunk.pm
+++ b/lib/Brackup/CompositeChunk.pm
@@ -13,7 +13,7 @@ use fields (
             'digest',  # memoized
             'finalized', # if we've written ourselves to the target yet
             'subchunks', # the chunks this composite chunk is made of
-            'sha1',         # Digest::SHA1 object
+            'sha1',         # Digest::SHA object
             '_chunk_fh',  # tempfile file containing the whole composite chunk
             );
 
@@ -25,7 +25,7 @@ sub new {
     $self->{max_size}  = $root->max_composite_size;
     $self->{target}    = $target;
     $self->{subchunks} = [];
-    $self->{sha1}      = Digest::SHA1->new;
+    $self->{sha1}      = Digest::SHA->new(1);
     $self->{_chunk_fh} = tempfile_obj();
     return $self;
 }
diff --git a/lib/Brackup/File.pm b/lib/Brackup/File.pm
index 4b3e0e3..93ce14b 100644
--- a/lib/Brackup/File.pm
+++ b/lib/Brackup/File.pm
@@ -7,7 +7,7 @@ use warnings;
 use Carp qw(croak);
 use File::stat ();
 use Fcntl qw(S_ISREG S_ISDIR S_ISLNK S_ISFIFO O_RDONLY);
-use Digest::SHA1;
+use Digest::SHA;
 use String::Escape qw(printable);
 use Brackup::PositionedChunk;
 use Brackup::Chunker::Default;
@@ -152,7 +152,7 @@ sub _calc_full_digest {
     }
 
     unless ($dig) {
-        my $sha1 = Digest::SHA1->new;
+        my $sha1 = Digest::SHA->new(1);
         my $path = $self->fullpath;
         sysopen(my $fh, $path, O_RDONLY) or die "Failed to open $path: $!";
         binmode($fh);
diff --git a/lib/Brackup/Restore.pm b/lib/Brackup/Restore.pm
index 421c95a..d316657 100644
--- a/lib/Brackup/Restore.pm
+++ b/lib/Brackup/Restore.pm
@@ -2,7 +2,7 @@ package Brackup::Restore;
 use strict;
 use warnings;
 use Carp qw(croak);
-use Digest::SHA1;
+use Digest::SHA;
 use POSIX qw(mkfifo);
 use Fcntl qw(O_RDONLY O_CREAT O_WRONLY O_TRUNC);
 use String::Escape qw(unprintable);
@@ -337,7 +337,7 @@ sub _digest_matches {
     $good_dig = $1;
     sysopen(my $readfh, $path, O_RDONLY) or die "Failed to open '$path' for verification: $!";
     binmode($readfh);
-    my $sha1 = Digest::SHA1->new;
+    my $sha1 = Digest::SHA->new(1);
     $sha1->addfile($readfh);
     my $actual_dig = $sha1->hexdigest;
     return $actual_dig eq $good_dig;
diff --git a/lib/Brackup/Test.pm b/lib/Brackup/Test.pm
index 67a1046..0df8c3f 100644
--- a/lib/Brackup/Test.pm
+++ b/lib/Brackup/Test.pm
@@ -13,7 +13,7 @@ use File::Find;
 use File::stat ();
 use Cwd;
 use Brackup::DecryptedFile;
-use Digest::SHA1 qw/sha1_hex/;
+use Digest::SHA qw/sha1_hex/;
 
 use Brackup;
 
diff --git a/lib/Brackup/Util.pm b/lib/Brackup/Util.pm
index b84855d..eb2c188 100644
--- a/lib/Brackup/Util.pm
+++ b/lib/Brackup/Util.pm
@@ -10,7 +10,7 @@ use vars qw(@ISA @EXPORT_OK);
 use File::Path qw();
 use Carp;
 use Fcntl qw(O_RDONLY);
-use Digest::SHA1;
+use Digest::SHA;
 
 my $mainpid = $$;
 my $_temp_directory;
@@ -103,7 +103,7 @@ sub io_print_to_fh {
 sub io_sha1 {
     my ($io_handle) = @_;
     
-    my $sha1 = Digest::SHA1->new;
+    my $sha1 = Digest::SHA->new(1);
     my $buf;
     
     while($io_handle->read($buf, 4096)) {

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list