Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update blead patching tools and docs

  • Loading branch information...
commit 00d4285476bc2195b0a644a8c44170986fd21f7a 1 parent f86d39f
@dagolden dagolden authored
Showing with 47 additions and 35 deletions.
  1. +13 −0 devtools/patching_blead.pod
  2. +34 −35 inc/ModuleBuildBuilder.pm
View
13 devtools/patching_blead.pod
@@ -51,6 +51,19 @@ Update any other metadata necessary, then add this file to the index.
$ vim Porting/Maintainers.pl
$ git add Porting/Maintainers.pl
+Also, you need to add a note to F<pod/perldelta.pod> in the "Updated Modules"
+section:
+
+ $ vim pod/perldelta.pod
+ $ git add pod/perldelta.pod
+
+=head2 Verifying against CPAN
+
+Now that Maintainers.pl is updated, verify that blead matches CPAN with the
+core-cpan-diff tool:
+
+ $ perl Porting/core-cpan-diff -d -r Module::Build
+
=head2 Commiting the branch
Commit the branch and use the editor to create a commit message. The
View
69 inc/ModuleBuildBuilder.pm
@@ -3,6 +3,9 @@ package ModuleBuildBuilder;
use strict;
use Module::Build;
use File::Copy qw/copy/;
+use File::Basename qw/dirname/;
+use File::Path qw/mkpath/;
+
use vars qw(@ISA);
@ISA = qw(Module::Build);
@@ -43,6 +46,21 @@ sub do_replace {
1 while unlink "$file.bak";
}
+sub _copy_to_blead {
+ my ($files, $munge, $skips) = @_;
+ for my $file (sort @$files) {
+ next unless -f $file;
+ next if $file =~ /\.svn/;
+ next if grep { $file eq $_ } @$skips;
+ my $dest = $munge->($file);
+ mkpath( dirname($dest) );
+ print "Copying $file\n";
+ copy($file, $dest)
+ or warn "!! Copy failed: $!";
+ chmod 0644 , $dest unless -w $dest;
+ }
+}
+
sub ACTION_patch_blead {
my $self = shift;
my $git_dir = $ARGV[1];
@@ -68,39 +86,20 @@ sub ACTION_patch_blead {
# copy files
(my $git_mb_dir = $git_dir) =~ s{/?$}{/cpan/Module-Build};
- my $files;
- $files = $self->rscan_dir('blib/lib');
- for my $file (@$files) {
- next unless -f $file;
- next if $file =~ /\.svn/;
- (my $dest = $file) =~ s{^blib}{$git_mb_dir};
+ # get .pm and .pod from blib to pick up autogenerated stuff
+ _copy_to_blead(
+ $self->rscan_dir('blib/lib'),
+ sub { my $f = shift; $f =~ s{^blib/}{}; "$git_mb_dir/$f" },
+ );
- copy($file, $dest);
- chmod 0644 , $dest;
- }
+ # get t, bin and Changes directly
+ _copy_to_blead(
+ [ @{$self->rscan_dir('t')}, $self->rscan_dir('bin'), 'Changes' ],
+ sub { my $f = shift; return "$git_mb_dir/$f" },
+ [ qw{ t/par.t t/signature.t } ], # skip list
+ );
- $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};
- copy($file, $dest);
- chmod 0644 , $dest;
- }
-
- my @skip = qw{ t/par.t t/signature.t };
- $files = $self->rscan_dir('t');
- for my $file (@$files) {
- next unless -f $file;
- next if $file =~ /\.svn/;
- next if grep { $file eq $_ } @skip;
- my $dest = "$git_mb_dir/$file";
- copy($file, $dest);
- chmod 0644 , $dest;
- }
-
- $self->copy_if_modified(from => 'Changes', to => "$git_mb_dir/Changes");
return 1;
}
@@ -112,7 +111,7 @@ sub ACTION_upload {
eval { require CPAN::Uploader; 1 }
or die "CPAN::Uploader must be installed for uploading to work.\n";
-
+
$self->depends_on('build');
$self->depends_on('distmeta');
$self->depends_on('distcheck');
@@ -122,7 +121,7 @@ sub ACTION_upload {
my $uploader = $self->find_command("cpan-upload");
if ( $self->y_n("Upload to CPAN?", 'y') ) {
- $self->do_system($uploader, $self->dist_dir . ".tar.gz")
+ $self->do_system($uploader, $self->dist_dir . ".tar.gz")
or die "Failed to upload.\n";
$self->depends_on('tag_git');
}
@@ -140,7 +139,7 @@ sub ACTION_checkgit {
eval { require Git::Wrapper; 1 }
or die "Git::Wrapper must be installed to check the distribution.\n";
-
+
my $git = Git::Wrapper->new('.');
my @repos = $git->remote;
if ( ! grep { /\Aorigin\z/ } @repos ) {
@@ -177,7 +176,7 @@ sub ACTION_checkgit {
$self->log_warn( "$_\n" ) for $git->show_ref($cur_branch);
exit 1;
}
-
+
}
sub ACTION_tag_git {
@@ -190,7 +189,7 @@ sub ACTION_tag_git {
eval { require Git::Wrapper; 1 }
or die "Git::Wrapper must be installed to check the distribution.\n";
-
+
my $git = Git::Wrapper->new('.');
my $tag = $self->dist_version;
$self->log_info("Tagging HEAD as $tag\n");
Please sign in to comment.
Something went wrong with that request. Please try again.