Update CPANPLUS::Dist::Build to CPAN version 0.35_03
[p5sagit/p5-mst-13.2.git] / Porting / add-package.pl
index ded907d..6a07d7e 100644 (file)
@@ -12,7 +12,7 @@ getopts( 'r:p:e:vudn', $Opts );
 
 my $Cwd         = cwd(); 
 my $Verbose     = 1;
-my $ExcludeRe   = $Opts->{e} ? qr/$Opts->{e}/ : undef;
+my $ExcludeRe   = $Opts->{e} ? qr/$Opts->{e}/i : undef;
 my $Debug       = $Opts->{v} || 0;
 my $RunDiff     = $Opts->{d} || 0;
 my $PkgDir      = $Opts->{p} || cwd();
@@ -55,7 +55,7 @@ else {
     unless ( $status =~ /nothing to commit/ims ) {
       die "\nWorking directory not clean. Stopping.\n";
     }
-    system( "git co -b $BranchName blead" )
+    system( "git checkout -b $BranchName blead" )
             and die "Could not create branch '$BranchName': $?";
 
     print "done\n" if $Verbose;
@@ -75,12 +75,12 @@ my @LibFiles;
     @LibFiles =    map { chomp; $_ }
                     ### should we get rid of this file?
                     grep { $ExcludeRe && $_ =~ $ExcludeRe
-                        ? do {  warn "Removing $_\n";
-                                system("rm $_") and die "rm '$_' failed: $?";
+                        ? do {  warn "Removing $Repo/$_\n";
+                                system("rm $Repo/$_") and die "rm '$Repo/$_' failed: $?";
                                 undef
                             }
                         : 1
-                     } `find lib -type f`
+                     } `find $Repo/lib -type f`
         or die "Could not detect library files\n";
       
     print "done\n" if $Verbose;
@@ -137,7 +137,7 @@ my @TestFiles;
        ? system( "cp -fR $CPV t $TopDir" ) && die "Copy of t/ failed: $?"
        : warn "No t/ directory found\n";
 
-    @TestFiles =    map { chomp; s|^$TopDirRe||; $_ }
+    @TestFiles =    map { chomp; s|^$TopDirRe||; s|//|/|g; $_ }
                     ### should we get rid of this file?
                     grep { $ExcludeRe && $_ =~ $ExcludeRe
                         ? do {  warn "Removing $_\n";
@@ -169,7 +169,7 @@ BIN: {
 
     system($CopyCmd) && die "Copy of $BinDir failed: $?";
 
-    @BinFiles = map { chomp; s|^$TopDirRe||; $_ }
+    @BinFiles = map { chomp; s|^$TopDirRe||; s|//|/|g; $_ }
                 ### should we get rid of this file?
                 grep { $ExcludeRe && $_ =~ $ExcludeRe
                     ? do {  warn "Removing $_\n";
@@ -439,7 +439,7 @@ my @ChangedFiles;
 
     push @manifest, values %pkg_files;
 
-    {   chmod 0755, $file;
+    {   chmod 0644, $file;
         open my $fh, ">$file" or die "Could not open $file for writing: $!";
         #print $fh sort { lc $a cmp lc $b } @manifest;
         ### XXX stolen from pod/buildtoc:sub do_manifest