=head1 NAME
-Porting/sync-with-cpan
+Porting/sync-with-cpan - Synchronize with CPAN distributions
=head1 SYNOPSIS
use strict;
use warnings;
use Getopt::Long;
+use Archive::Tar;
$| = 1;
my $package_url = "http://www.cpan.org/modules/$package";
my $package_file = "/tmp/$package";
+my @problematic = (
+ 'podlators', # weird CUSTOMIZED section due to .PL files
+);
+
GetOptions ('tarball=s' => \my $tarball,
'version=s' => \my $version,
my $distribution = $$info {DISTRIBUTION};
my @files = glob $$info {FILES};
-if (!-d $files [0]) {
+if (!-d $files [0] || grep { $_ eq $module } @problematic) {
say "This looks like a setup $0 cannot handle (yet)";
unless ($force) {
say "Will not continue without a --force option";
system git => 'clean', '-dfxq', $pkg_dir;
say "Unpacking $new_file";
+Archive::Tar->extract_archive( $new_file );
-system tar => 'xfz', $new_file;
(my $new_dir = $new_file) =~ s/\.tar\.gz//;
# ensure 'make' will update all files
system('find', $new_dir, '-exec', 'touch', '{}', ';');
last if $file =~ s/^$key/$val/;
}
}
+ else {
+ $file = $files[0] . '/' . $file;
+ }
if ( $file =~ m{^cpan/} ) {
$file =~ s{^cpan/}{};
#
# Must clean up, or else t/porting/FindExt.t will fail.
-# Note that we can always retrieve the orginal directory with a git checkout.
+# Note that we can always retrieve the original directory with a git checkout.
#
print "About to clean up; hit return or abort (^C) "; <STDIN>;
if (!$found) {
if ($in_mod_section) {
if (/DISTRIBUTION/) {
- if (s/\Q$old_version/$version/) {
+ if (s/\Q$old_version/$new_version/) {
$found = 1;
}
}