Skip to content

Commit b0c242d

Browse files
committed
zip_dirs: normalise paths
Otherwise we get the full original path in the archive. Updates #107
1 parent 63b69fb commit b0c242d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Build.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ my $builder = $class->new(
3030
'Module::Build' => '0.38',
3131
},
3232
requires => {
33-
'perl' => '5.012',
33+
'perl' => '5.014',
3434
'Module::Build' => '0.38',
3535
},
3636
build_requires => {

lib/Perl/Dist/Strawberry.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package Perl::Dist::Strawberry;
22

3-
use 5.012;
3+
use 5.014;
44
use warnings;
55

66
use Data::Dump qw(pp);
@@ -489,7 +489,8 @@ sub zip_dir {
489489
$level //= 1;
490490
$self->message(3, "started: zip_dir('$dir', '$zip_filename', $level)\n");
491491
die "ERROR: non-existing dir '$dir'" unless -d $dir;
492-
my @items = File::Find::Rule->in($dir);
492+
$dir =~ s{\\}{/}g; # normalise paths
493+
my @items = map {s{\\}{/}gr} File::Find::Rule->in($dir);
493494
my $zip = Archive::Zip->new();
494495
for my $fs_name (@items) {
495496
(my $archive_name = $fs_name) =~ s|^\Q$dir\E[/\\]*||i;

0 commit comments

Comments
 (0)