Skip to content
This repository was archived by the owner on Jul 18, 2018. It is now read-only.

Commit 4d78603

Browse files
committed
* Add a directory to hold development tools
1 parent 2011b36 commit 4d78603

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

devel/merge_to_cpanpm

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!perl
2+
3+
use 5.010;
4+
5+
use File::Copy qw( copy );
6+
use File::Spec::Functions;
7+
8+
my $cpanpm_base = $ARGV[0] || '../cpanpm';
9+
die "Couldn't find cpanpm repository at $cpanpm_base\n";
10+
11+
{
12+
my $cwd = Cwd();
13+
chdir $cpanpm_base or die "Couldn't chdir to $cpanpm_base";
14+
15+
my $branch = grep { /^\*\s*(.*)/ } `git branch`;
16+
die "Branch is not 'update_cpan'\n" unless $branch eq 'update_cpan';
17+
18+
my $uptodate = ( `git pull` =~ /Already/ );
19+
die "Repo is not up to date! Stopping!\n" unless $uptodate;
20+
21+
chdir $cwd or die "Couldn't chdir back to $cwd";
22+
}
23+
24+
my @file_to_copy = (
25+
[ qw( lib/Cpan.pm lib/App/Cpan.pm ) ],
26+
[ qw( script/cpan scripts/cpan ) ],
27+
);
28+
29+
foreach my $pair ( @files_to_copy ) {
30+
my( $original, $copy_rel, $mode ) = @$pair;
31+
32+
warn "Could not find $original\n" unless -e $original;
33+
my $destination = catfile( $cpanpm_base, $copy_rel );
34+
copy( $original, $destination ) or warn "Copy failed: $!";
35+
}

0 commit comments

Comments
 (0)