Skip to content

Commit

Permalink
Item10168: only perltidy first
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@10337 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
IngoKappler authored and IngoKappler committed Dec 16, 2010
1 parent 6336423 commit 3d5a373
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/tools/rewriteshebang.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

BEGIN {
eval {
require Foswiki::Configure::Util;
1;
} or die "Please run this script as follows:\n\n perl -I /path/to/foswiki/lib rewriteshebang.pl\n e.g. perl -I ../lib rewriteshebang.pl\n\n $@\n";
require Foswiki::Configure::Util;
1;
}
or die
"Please run this script as follows:\n\n perl -I /path/to/foswiki/lib rewriteshebang.pl\n e.g. perl -I ../lib rewriteshebang.pl\n\n $@\n";
}


my $new_path = '';
my @default_dir = ( '../tools', '../bin', );
my $expect_perlv = 5.008008;
Expand Down Expand Up @@ -107,7 +108,8 @@ BEGIN
$ENV{"PATH"} = ""; # untainted environment for system call
# Unix and Windows path matching without spaces to untain
if ( $new_path =~
/(^(\.)?(\/[^\/]+)+(\.exe)?$|^[[:alpha:]]:(\\[^\\]+)+(\.exe)?$|^perl$)/i )
/(^(\.)?(\/[^\/]+)+(\.exe)?$|^[[:alpha:]]:(\\[^\\]+)+(\.exe)?$|^perl$)/i
)
{
$new_path = "$1"; # untainted variable
@args = ( "$new_path", "-Mstrict", "-w", '-e "print $];"' );
Expand Down Expand Up @@ -230,14 +232,12 @@ sub change_files {
foreach my $file (@files) {
$scanned++;

my $rewriteErr = Foswiki::Configure::Util::rewriteShebang(
$file,
$new_path
);
my $rewriteErr =
Foswiki::Configure::Util::rewriteShebang( $file, $new_path );

if ($rewriteErr) {
print "$cwd/$file - $rewriteErr \n";
}
}
else {
print "$cwd/$file\n";
$changed++;
Expand Down

0 comments on commit 3d5a373

Please sign in to comment.