Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib/Module/Build/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4032,9 +4032,17 @@ sub ACTION_distdir {

my $dist_files = $self->_read_manifest('MANIFEST')
or die "Can't create distdir without a MANIFEST file - run 'manifest' action first.\n";

delete $dist_files->{SIGNATURE}; # Don't copy, create a fresh one

# Double check that we skip MYMETA.*
foreach my $file (keys %$dist_files) {
delete $dist_files->{$file} if $file =~ m{^MYMETA\.};
}

die "No files found in MANIFEST - try running 'manifest' action?\n"
unless ($dist_files and keys %$dist_files);

my $metafile = $self->metafile;
$self->log_warn("*** Did you forget to add $metafile to the MANIFEST?\n")
unless exists $dist_files->{$metafile};
Expand All @@ -4044,10 +4052,8 @@ sub ACTION_distdir {
$self->log_info("Creating $dist_dir\n");
$self->add_to_cleanup($dist_dir);

foreach my $file (keys %$dist_files) {
next if $file =~ m{^MYMETA\.}; # Double check that we skip MYMETA.*
my $new = $self->copy_if_modified(from => $file, to_dir => $dist_dir, verbose => 0);
}
local $ExtUtils::Manifest::Quiet = 1;
ExtUtils::Manifest::manicopy($dist_files, $dist_dir);

$self->do_create_bundle_inc if @{$self->bundle_inc};

Expand Down
12 changes: 10 additions & 2 deletions t/runthrough.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

use strict;
use lib 't/lib';
use MBTest tests => 29;
use MBTest tests => 32;

my $BuildPL_MTime = 1410291386;

blib_load('Module::Build');
blib_load('Module::Build::ConfigData');
Expand Down Expand Up @@ -37,7 +39,6 @@ print FH "Contents: $filename\n";
close FH;
---
$dist->regen;

$dist->chdir_in;


Expand All @@ -54,6 +55,10 @@ eval {$mb->create_build_script};
is $@, '';
ok -e $mb->build_script;

# Set the mtime on Build.PL for use in testing later.
ok utime $BuildPL_MTime, $BuildPL_MTime, "Build.PL", "set time on Build.PL";
is [stat("Build.PL")]->[9], $BuildPL_MTime;

my $dist_dir = 'Simple-0.01';

# VMS in traditional mode needs the $dist_dir name to not have a '.' in it
Expand Down Expand Up @@ -117,6 +122,9 @@ ok grep {$_ eq 'save_out' } $mb->cleanup;
stdout_stderr_of ( sub { eval {$mb->dispatch('distdir')} } );
is $@, '';

is [stat(File::Spec->catfile("Simple-0.01", "Build.PL"))]->[9],
[stat("Build.PL")]->[9], "mtimes preserved by distdir";

# The 'distdir' should contain a lib/ directory
ok -e File::Spec->catdir('Simple-0.01', 'lib');

Expand Down