[merged]
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Wed, 13 May 2015 15:00:44 +0200
changeset 125 41872269ca6f
parent 124 87081e9cf3ba (diff)
parent 122 977e53d08eac (current diff)
child 126 97c56efb9cd8
[merged]
bin/imager.save
--- a/bin/imager.compress	Wed Feb 06 00:04:29 2013 +0100
+++ b/bin/imager.compress	Wed May 13 15:00:44 2015 +0200
@@ -77,14 +77,16 @@
             }
 
             close $tmp;
-            unlink $tmp, $_;
+            map { unlink } $tmp, $_;
 
-            return;
+            return 0;
 
         },
         @ARGV
     );
 
+    exit 0;
+
 }
 
 __END__
--- a/bin/imager.save	Wed Feb 06 00:04:29 2013 +0100
+++ b/bin/imager.save	Wed May 13 15:00:44 2015 +0200
@@ -15,6 +15,7 @@
 use Getopt::Long;
 use Pod::Usage;
 use Imager 0.1;
+use if $^V >= v5.18 => (experimental => qw'lexical_topic smartmatch');
 
 use constant KiB     => 1024;
 use constant MiB     => 1024 * KiB;
--- a/lib/Imager.pm	Wed Feb 06 00:04:29 2013 +0100
+++ b/lib/Imager.pm	Wed May 13 15:00:44 2015 +0200
@@ -4,6 +4,7 @@
 use warnings;
 use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
 use autodie qw(:all);
+use if $^V >= v5.18 => (experimental => 'smartmatch');
 
 our $VERSION = "0.1";
 
--- a/t/001-save-restore.t	Wed Feb 06 00:04:29 2013 +0100
+++ b/t/001-save-restore.t	Wed May 13 15:00:44 2015 +0200
@@ -4,6 +4,7 @@
 use autodie qw(:all);
 use Test::More;
 use Sys::Hostname;
+use if $^V gt v5.18 => (experimental => 'smartmatch');
 
 use constant SIZE => 27 * 1024 * 1024;
 
@@ -37,6 +38,7 @@
 
 # now compress and check again
 system("perl -Mblib blib/script/imager.compress $dir/images 2>$err");
+is($? => 0, "compressed") or do { seek $err => 0, 0; diag <$err> };
 system("perl -Mblib blib/script/imager.restore $dir/images/idx/@{[hostname]}/source/* $dir/source.restored");
 is($? => 0, "restored") or do { seek $err => 0, 0; diag <$err> };
 seek($out, 0, 0);