[Bps-public-commit] Shipwright branch, master, updated. 70883d3e68cacd2fc9aea86a23b6f939b2626c18

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Sep 10 23:30:50 EDT 2009


The branch, master has been updated
       via  70883d3e68cacd2fc9aea86a23b6f939b2626c18 (commit)
      from  031f6797fabba973d61efd9280458613caf4dddf (commit)

Summary of changes:
 Makefile.PL                     |    1 -
 lib/Shipwright/Script/Import.pm |   19 +++++--------------
 lib/Shipwright/Script/Update.pm |    3 ---
 3 files changed, 5 insertions(+), 18 deletions(-)

- Log -----------------------------------------------------------------
commit 70883d3e68cacd2fc9aea86a23b6f939b2626c18
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Sep 11 11:30:44 2009 +0800

    remove Hash::Merge dep

diff --git a/Makefile.PL b/Makefile.PL
index 56f37a9..ed8dac3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -19,7 +19,6 @@ requires 'File::Copy' => 0;
 requires 'File::Copy::Recursive' => 0;
 requires 'File::Spec' => 0;
 requires 'File::Slurp' => 0;
-requires 'Hash::Merge' => 0;
 requires 'IPC::Run3' => 0;
 requires 'List::MoreUtils' => 0;
 requires 'Log::Log4perl' => 0;
diff --git a/lib/Shipwright/Script/Import.pm b/lib/Shipwright/Script/Import.pm
index 301f173..1a6cd40 100644
--- a/lib/Shipwright/Script/Import.pm
+++ b/lib/Shipwright/Script/Import.pm
@@ -17,11 +17,8 @@ use Shipwright::Util;
 use File::Copy qw/copy move/;
 use File::Temp qw/tempdir/;
 use Config;
-use Hash::Merge;
 use List::MoreUtils qw/firstidx/;
 
-Hash::Merge::set_behavior('RIGHT_PRECEDENT');
-
 sub options {
     (
         'm|comment=s'         => 'comment',
@@ -138,9 +135,7 @@ sub run {
 
                 # skip already imported dists
                 $shipwright->source->skip(
-                    Hash::Merge::merge(
-                        $self->skip, $shipwright->backend->map || {}
-                    )
+                    { %{ $self->skip }, %{ $shipwright->backend->map || {} } }
                 );
             }
 
@@ -232,8 +227,7 @@ sub run {
               Shipwright::Util::LoadFile( $shipwright->source->map_path )
               || {};
             $shipwright->backend->map(
-                Hash::Merge::merge( $shipwright->backend->map || {}, $new_map )
-            );
+                { %{ $shipwright->backend->map || {} }, %$new_map } );
 
             my $new_url =
               Shipwright::Util::LoadFile( $shipwright->source->url_path )
@@ -241,12 +235,9 @@ sub run {
             my $source_url = delete $new_url->{$name};
 
             if ( $name !~ /^cpan-/ ) {
-                $shipwright->backend->source(
-                    Hash::Merge::merge(
-                        $shipwright->backend->source || {},
-                        { $name => { $self->as || 'vendor' => $source_url } },
-                    )
-                );
+                my $source = $shipwright->backend->source || {};
+                $source->{$name}{$self->as||'vendor'} = $source_url;
+                $shipwright->backend->source( $source );
             }
         }
 
diff --git a/lib/Shipwright/Script/Update.pm b/lib/Shipwright/Script/Update.pm
index 57e1d66..dcf31da 100644
--- a/lib/Shipwright/Script/Update.pm
+++ b/lib/Shipwright/Script/Update.pm
@@ -15,9 +15,6 @@ use Shipwright::Util;
 use File::Copy qw/copy move/;
 use File::Temp qw/tempdir/;
 use Config;
-use Hash::Merge;
-
-Hash::Merge::set_behavior('RIGHT_PRECEDENT');
 
 sub options {
     (

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



More information about the Bps-public-commit mailing list