Skip to content

Commit

Permalink
fix problems in blead patching
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jan 25, 2011
1 parent b061048 commit 1559e1a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions inc/ModuleBuildBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ModuleBuildBuilder;

use strict;
use Module::Build;
use File::Copy qw/copy/;
use vars qw(@ISA);
@ISA = qw(Module::Build);

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 };
Expand All @@ -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");
Expand Down

0 comments on commit 1559e1a

Please sign in to comment.