Permalink
Browse files

fix problems in blead patching

  • Loading branch information...
1 parent b061048 commit 1559e1a35f1e329c99b3c60c247a196745abbc0d @xdg xdg committed Jan 25, 2011
Showing with 14 additions and 5 deletions.
  1. +14 −5 inc/ModuleBuildBuilder.pm
View
@@ -2,6 +2,7 @@ package ModuleBuildBuilder;
use strict;
use Module::Build;
+use File::Copy qw/copy/;
use vars qw(@ISA);
@ISA = qw(Module::Build);
@@ -48,7 +49,7 @@ sub ACTION_patch_blead {
die "Usage: Build patch_blead <perl-git-directory>\n"
unless $git_dir && -d "$git_dir/.git" && -f "$git_dir/perl.h";
- $self->depends_on('build');
+ $self->depends_on('distdir');
$self->log_info( "Updating $git_dir\n" );
$self->{properties}{verbose} = 1;
@@ -60,6 +61,11 @@ sub ACTION_patch_blead {
or die "Couldn't create git branch" . $self->dist_dir . "\n";
chdir $cwd;
+ # Prep distdir since we need autogenerated docs
+ chdir "$cwd/" . $self->dist_dir or die "Couldn't chdir";
+ system("$^X Build.PL") and die;
+ system("$^X Build") and die;
+
# copy files
(my $git_mb_dir = $git_dir) =~ s{/?$}{/cpan/Module-Build};
my $files;
@@ -69,16 +75,18 @@ sub ACTION_patch_blead {
next unless -f $file;
next if $file =~ /\.svn/;
(my $dest = $file) =~ s{^blib}{$git_mb_dir};
- $self->copy_if_modified(from => $file, to => $dest);
+
+ copy($file, $dest);
+ chmod 0644 , $dest;
}
$files = $self->rscan_dir('blib/script');
for my $file (@$files) {
next unless -f $file;
next if $file =~ /\.svn/;
(my $dest = $file) =~ s{^blib/script}{$git_mb_dir/scripts};
- $self->copy_if_modified(from => $file, to => $dest);
- chmod 0644, $dest;
+ copy($file, $dest);
+ chmod 0644 , $dest;
}
my @skip = qw{ t/par.t t/signature.t };
@@ -88,7 +96,8 @@ sub ACTION_patch_blead {
next if $file =~ /\.svn/;
next if grep { $file eq $_ } @skip;
my $dest = "$git_mb_dir/$file";
- $self->copy_if_modified(from => $file, to => $dest);
+ copy($file, $dest);
+ chmod 0644 , $dest;
}
$self->copy_if_modified(from => 'Changes', to => "$git_mb_dir/Changes");

0 comments on commit 1559e1a

Please sign in to comment.