diff options
author | Robin Barker <RMBarker@cpan.org> | 2008-03-19 10:55:59 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-03-30 15:48:08 +0000 |
commit | 95aa056551f52c584698ab9faf16c6e993f2d2a5 (patch) | |
tree | 5d447cb5cd7e3355c17416d4c2329ef91a91f9ef /regen_lib.pl | |
parent | 08593cf4c9cb1d67bbda4d67054ff396110647f9 (diff) | |
download | perl-95aa056551f52c584698ab9faf16c6e993f2d2a5.tar.gz |
add -v to regen.pl and friends
From: "Robin Barker" <Robin.Barker@npl.co.uk>
Message-ID: <46A0F33545E63740BC7563DE59CA9C6D093AA6@exchsvr2.npl.ad.local>
p4raw-id: //depot/perl@33608
Diffstat (limited to 'regen_lib.pl')
-rw-r--r-- | regen_lib.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/regen_lib.pl b/regen_lib.pl index 7605271ec8..89ac3f9009 100644 --- a/regen_lib.pl +++ b/regen_lib.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w use strict; -use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write); +use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write $Verbose); use Config; # Remember, this is running using an existing perl use File::Compare; use Symbol; @@ -17,6 +17,8 @@ if ($Is_NetWare) { $Needs_Write = $Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare; +@ARGV = grep { not($_ eq '-v' and $Verbose = 1) } @ARGV; + sub safer_unlink { my @names = @_; my $cnt = 0; @@ -44,7 +46,7 @@ sub rename_if_different { my ($from, $to) = @_; if (compare($from, $to) == 0) { - warn "no changes between '$from' & '$to'\n"; + warn "no changes between '$from' & '$to'\n" if $Verbose; safer_unlink($from); return; } |