In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/b5bf278af31bbe7f859e02da0ad3793feb6a55e8?hp=8cfc9af613d5c73745f210535cf8921067507306>

- Log -----------------------------------------------------------------
commit b5bf278af31bbe7f859e02da0ad3793feb6a55e8
Author: Abigail <[email protected]>
Date:   Mon Mar 19 14:40:02 2012 +0100

    Bail out if it looks scary.
    
    Porting/sync-with-cpan hasn't automated all situations yet. In particular,
    it assumes the FILE entry has just one element, and that element is a
    directory. It also does not know what to do with MAP. If we determine
    this situation, we terminate the program before making any changes.
    Although there's the --force option for the braves.

M       Porting/sync-with-cpan

commit e81fec2c92c338f9d506a01f47364f85ef3b7b75
Author: Abigail <[email protected]>
Date:   Mon Mar 19 14:26:12 2012 +0100

    Don't remove --tarball
    
    By default, the script removes the tarball of the new distributions.
    However, if the --tarball option was given (and hence, the file was not
    downloaded from CPAN), we opt to keep this file around.

M       Porting/sync-with-cpan

commit 33e80a479f628997e99534cde168f74bb9444d15
Author: Abigail <[email protected]>
Date:   Mon Mar 19 14:23:12 2012 +0100

    Use #!/usr/bin/env
    
    /usr/bin/perl on dromedary is 5.8.8; but the script requires 5.10.
    By using #!/usr/bin/env, we give the user more control over which perl
    should be used. (And this benefits not just dromedary usesr)

M       Porting/sync-with-cpan
-----------------------------------------------------------------------

Summary of changes:
 Porting/sync-with-cpan |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan
index 032eddc..aee808b 100755
--- a/Porting/sync-with-cpan
+++ b/Porting/sync-with-cpan
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 #
 # Script to help out with syncing cpan distros.
@@ -62,8 +62,6 @@ use autodie;
 
 require "Porting/Maintainers.pl";
 
-chdir "cpan";
-
 my %IGNORABLE    = map {$_ => 1} @IGNORABLE;
 
 my $package      = "02packages.details.txt";
@@ -72,7 +70,8 @@ my $package_file = "/tmp/$package";
 
 
 GetOptions ('tarball=s'  =>  \my $tarball,
-            'version=s'  =>  \my $version)
+            'version=s'  =>  \my $version,
+             force       =>  \my $force,)
         or  die "Failed to parse arguments";
 
 die "Usage: $0 module [args] [cpan package]" unless @ARGV == 1 || @ARGV == 2;
@@ -83,6 +82,20 @@ my  $cpan_mod = @ARGV ? shift : $module;
 
 my  $info         = $Modules {$module} or die "Cannot find module $module";
 my  $distribution = $$info {DISTRIBUTION};
+
+my @files         = glob $$info {FILES};
+if (@files != 1 || !-d $files [0] || $$info {MAP}) {
+    say "This looks like a setup $0 cannot handle (yet)";
+    unless ($force) {
+        say "Will not continue without a --force option";
+        exit 1;
+    }
+    say "--force is in effect, so we'll soldier on. Wish me luck!";
+}
+
+
+chdir "cpan";
+
 my  $pkg_dir      = $$info {FILES};
     $pkg_dir      =~ s!.*/!!;
 
@@ -276,7 +289,7 @@ print "About to clean up; hit return or abort (^C) "; 
<STDIN>;
 
 chdir "cpan";
 system rm => '-r', $old_dir;
-unlink $new_file;
+unlink $new_file unless $tarball;
 
 
 #

--
Perl5 Master Repository

Reply via email to