pf-tools commit: r883 [parmelan-guest] - in /branches/next-gen: filters/ lib/PFTools/ lib/PFTools/Compat/ lib/PFTools/Conf/ lib/PFTools/Update/ sbin/ tools/

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Tue Sep 7 09:30:31 UTC 2010


Author: parmelan-guest
Date: Tue Sep  7 09:30:29 2010
New Revision: 883

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=883
Log:
use English qw( -no_match_vars );    # Avoids regex performance penalty

Modified:
    branches/next-gen/filters/filter_distrib   (contents, props changed)
    branches/next-gen/filters/filter_privateresolve   (contents, props changed)
    branches/next-gen/filters/filter_vlan2if   (contents, props changed)
    branches/next-gen/lib/PFTools/Bridge.pm
    branches/next-gen/lib/PFTools/Compat/Parser.pm
    branches/next-gen/lib/PFTools/Compat/Translation.pm
    branches/next-gen/lib/PFTools/Conf.pm
    branches/next-gen/lib/PFTools/Conf/Host.pm
    branches/next-gen/lib/PFTools/Conf/Network.pm
    branches/next-gen/lib/PFTools/Conf/Syntax.pm
    branches/next-gen/lib/PFTools/Disk.pm
    branches/next-gen/lib/PFTools/Logger.pm
    branches/next-gen/lib/PFTools/Net.pm
    branches/next-gen/lib/PFTools/Packages.pm
    branches/next-gen/lib/PFTools/Parser.pm
    branches/next-gen/lib/PFTools/Structqueries.pm
    branches/next-gen/lib/PFTools/Update.pm
    branches/next-gen/lib/PFTools/Update/Addfile.pm
    branches/next-gen/lib/PFTools/Update/Addlink.pm
    branches/next-gen/lib/PFTools/Update/Addmount.pm
    branches/next-gen/lib/PFTools/Update/Common.pm
    branches/next-gen/lib/PFTools/Update/Createfile.pm
    branches/next-gen/lib/PFTools/Update/Installpkg.pm
    branches/next-gen/lib/PFTools/Update/Mkdir.pm
    branches/next-gen/lib/PFTools/Update/Purgepkg.pm
    branches/next-gen/lib/PFTools/Update/Removedir.pm
    branches/next-gen/lib/PFTools/Update/Removefile.pm
    branches/next-gen/lib/PFTools/Utils.pm
    branches/next-gen/lib/PFTools/VCS.pm
    branches/next-gen/sbin/fix_hosts   (contents, props changed)
    branches/next-gen/sbin/mk_dhcp   (contents, props changed)
    branches/next-gen/sbin/mk_grubopt   (contents, props changed)
    branches/next-gen/sbin/mk_interfaces   (contents, props changed)
    branches/next-gen/sbin/mk_pxelinuxcfg   (contents, props changed)
    branches/next-gen/sbin/mk_resolvconf   (contents, props changed)
    branches/next-gen/sbin/mk_sitezone
    branches/next-gen/sbin/mk_sourceslist   (contents, props changed)
    branches/next-gen/sbin/update-config   (contents, props changed)
    branches/next-gen/tools/Display_IP_config
    branches/next-gen/tools/Translate_old_config   (contents, props changed)
    branches/next-gen/tools/dumpiplist.pl   (contents, props changed)
    branches/next-gen/tools/kvmlaunch   (contents, props changed)
    branches/next-gen/tools/pflaunch   (contents, props changed)
    branches/next-gen/tools/umlaunch   (contents, props changed)
    branches/next-gen/tools/xenlaunch   (contents, props changed)

Modified: branches/next-gen/filters/filter_distrib
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/filters/filter_distrib?rev=883&op=diff
==============================================================================
--- branches/next-gen/filters/filter_distrib (original)
+++ branches/next-gen/filters/filter_distrib Tue Sep  7 09:30:29 2010
@@ -26,6 +26,7 @@
 use PFTools::Logger;
 use PFTools::Structqueries;
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Sys::Hostname;
 
 #################################
@@ -52,7 +53,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-h --host	: hostname for which we want to filter input
 	-s --site	: site on which hostname is defined (optional)
@@ -122,7 +123,7 @@
 
 unless ( open( OUTPUT, ">" . $OUTPUT_FILE ) ) {
     Abort( $CODE->{'OPEN'},
-        "Unable to open destination file " . $OUTPUT_FILE . " : $!" );
+        "Unable to open destination file " . $OUTPUT_FILE . " : $OS_ERROR" );
 }
 
 print OUTPUT join( "", @{$filtered_src} );

Modified: branches/next-gen/filters/filter_privateresolve
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/filters/filter_privateresolve?rev=883&op=diff
==============================================================================
--- branches/next-gen/filters/filter_privateresolve (original)
+++ branches/next-gen/filters/filter_privateresolve Tue Sep  7 09:30:29 2010
@@ -28,7 +28,7 @@
 use PFTools::Structqueries;
 use PFTools::Logger;
 use Getopt::Long qw( :config ignore_case_always bundling );
-
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Sys::Hostname;
 
 #################################
@@ -58,7 +58,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-h --host	: hostname for which we want to filter input
 	-s --site	: site on which hostname is defined (optional)
@@ -136,7 +136,7 @@
 
 unless ( open( OUTPUT, ">" . $OUTPUT_FILE ) ) {
     Abort( $CODE->{'OPEN'},
-        "Unable to open destination file " . $OUTPUT_FILE . " : $!" );
+        "Unable to open destination file " . $OUTPUT_FILE . " : $OS_ERROR" );
 }
 
 print OUTPUT join( "", @{$filtered_src} );

Modified: branches/next-gen/filters/filter_vlan2if
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/filters/filter_vlan2if?rev=883&op=diff
==============================================================================
--- branches/next-gen/filters/filter_vlan2if (original)
+++ branches/next-gen/filters/filter_vlan2if Tue Sep  7 09:30:29 2010
@@ -31,6 +31,7 @@
 use PFTools::Logger;
 use PFTools::Structqueries;
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Sys::Hostname;
 
 #################################
@@ -57,7 +58,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-h --host	: hostname for which we want to filter input
 	-s --site	: site on which hostname is defined (optional)
@@ -127,7 +128,7 @@
 
 unless ( open( OUTPUT, ">" . $OUTPUT_FILE ) ) {
     Abort( $CODE->{'OPEN'},
-        "Unable to open destination file " . $OUTPUT_FILE . " : $!" );
+        "Unable to open destination file " . $OUTPUT_FILE . " : $OS_ERROR" );
 }
 
 print OUTPUT join( "", @{$filtered_src} );

Modified: branches/next-gen/lib/PFTools/Bridge.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Bridge.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Bridge.pm (original)
+++ branches/next-gen/lib/PFTools/Bridge.pm Tue Sep  7 09:30:29 2010
@@ -21,7 +21,9 @@
 
 use strict;
 use warnings;
+
 use Data::Dumper;
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 
 BEGIN {
     if (   `which vconfig 2>/dev/null` eq ""
@@ -72,18 +74,19 @@
 
     print "DEBUG --> Executing command " . $cmd . "\n";
     system($cmd ) if ( !$DEBUG );
-    if ($?) {
-        if ( $? == -1 ) {
-            warn "failed to execute: $!\n";
-            return 0;
-        }
-        elsif ( $? & 127 ) {
+    if ($CHILD_ERROR) {
+        if ( $CHILD_ERROR == -1 ) {
+            warn "failed to execute: $OS_ERROR\n";
+            return 0;
+        }
+        elsif ( $CHILD_ERROR & 127 ) {
             printf STDERR "child died with signal %d, %s coredump\n",
-                ( $? & 127 ), ( $? & 128 ) ? 'with' : 'without';
+                ( $CHILD_ERROR & 127 ),
+                ( $CHILD_ERROR & 128 ) ? 'with' : 'without';
             return 0;
         }
         else {
-            printf STDERR "child exited with value %d\n", $? >> 8;
+            printf STDERR "child exited with value %d\n", $CHILD_ERROR >> 8;
             return 0;
         }
     }

Modified: branches/next-gen/lib/PFTools/Compat/Parser.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Compat/Parser.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Compat/Parser.pm (original)
+++ branches/next-gen/lib/PFTools/Compat/Parser.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Compat/Translation.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Compat/Translation.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Compat/Translation.pm (original)
+++ branches/next-gen/lib/PFTools/Compat/Translation.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Conf.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Conf.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Conf.pm (original)
+++ branches/next-gen/lib/PFTools/Conf.pm Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 use PFTools::Net;
 use PFTools::Parser;

Modified: branches/next-gen/lib/PFTools/Conf/Host.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Conf/Host.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Conf/Host.pm (original)
+++ branches/next-gen/lib/PFTools/Conf/Host.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Conf/Network.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Conf/Network.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Conf/Network.pm (original)
+++ branches/next-gen/lib/PFTools/Conf/Network.pm Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Conf/Syntax.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Conf/Syntax.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Conf/Syntax.pm (original)
+++ branches/next-gen/lib/PFTools/Conf/Syntax.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Disk.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Disk.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Disk.pm (original)
+++ branches/next-gen/lib/PFTools/Disk.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');
@@ -161,7 +162,7 @@
     }
     else {
         system($cmd );
-        if ($?) {
+        if ($CHILD_ERROR) {
             if ( !defined($msg) ) {
                 $msg
                     = "Problem when executing command " 
@@ -169,16 +170,18 @@
                     . " with the following error(s)\n";
             }
             warn $msg if ($VERBOSE);
-            if ( $? == -1 ) {
-                warn "failed to execute: $!\n" if ($VERBOSE);
-            }
-            elsif ( $? & 127 ) {
+            if ( $CHILD_ERROR == -1 ) {
+                warn "failed to execute: $OS_ERROR\n" if ($VERBOSE);
+            }
+            elsif ( $CHILD_ERROR & 127 ) {
                 printf STDERR "child died with signal %d, %s coredump\n",
-                    ( $? & 127 ), ( $? & 128 ) ? 'with' : 'without'
+                    ( $CHILD_ERROR & 127 ),
+                    ( $CHILD_ERROR & 128 ) ? 'with' : 'without'
                     if ($VERBOSE);
             }
             else {
-                printf STDERR "child exited with value %d\n", $? >> 8
+                printf STDERR "child exited with value %d\n",
+                    $CHILD_ERROR >> 8
                     if ($VERBOSE);
             }
             return 0;

Modified: branches/next-gen/lib/PFTools/Logger.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Logger.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Logger.pm (original)
+++ branches/next-gen/lib/PFTools/Logger.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');
@@ -123,14 +124,16 @@
     if ( defined( $sortie->{'_stdout'} ) ) {
         local *REAL_STDOUT;
         *REAL_STDOUT = $sortie->{'_stdout'};
-        open( STDOUT, ">&REAL_STDOUT" ) or warn "Can't restore STDOUT: $!
+        open( STDOUT, ">&REAL_STDOUT" )
+            or warn "Can't restore STDOUT: $OS_ERROR
 		+";
         undef( $sortie->{'_stdout'} );
     }
     if ( defined( $sortie->{'_stderr'} ) ) {
         local *REAL_STDERR;
         *REAL_STDERR = $sortie->{'_stderr'};
-        open( STDERR, ">&REAL_STDERR" ) or warn "Can't restore STDERR: $!
+        open( STDERR, ">&REAL_STDERR" )
+            or warn "Can't restore STDERR: $OS_ERROR
 		+";
         undef( $sortie->{'_stderr'} );
     }
@@ -149,7 +152,7 @@
     DeferOutput() if ( $deferredlog || $DEFERREDLOG );
 
     unless ( open DEFERREDLOGPIPE, '-|', $pipe_cmd ) {
-        Warn( $CODE->{'OPEN'}, "Unable to open pipe $pipe_cmd : $!" );
+        Warn( $CODE->{'OPEN'}, "Unable to open pipe $pipe_cmd : $OS_ERROR" );
         return;
     }
 

Modified: branches/next-gen/lib/PFTools/Net.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Net.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Net.pm (original)
+++ branches/next-gen/lib/PFTools/Net.pm Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Packages.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Packages.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Packages.pm (original)
+++ branches/next-gen/lib/PFTools/Packages.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Parser.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Parser.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Parser.pm (original)
+++ branches/next-gen/lib/PFTools/Parser.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Structqueries.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Structqueries.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Structqueries.pm (original)
+++ branches/next-gen/lib/PFTools/Structqueries.pm Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 use PFTools::Logger;

Modified: branches/next-gen/lib/PFTools/Update.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update.pm (original)
+++ branches/next-gen/lib/PFTools/Update.pm Tue Sep  7 09:30:29 2010
@@ -26,6 +26,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Addfile.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Addfile.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Addfile.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Addfile.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Addlink.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Addlink.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Addlink.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Addlink.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Addmount.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Addmount.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Addmount.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Addmount.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Common.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Common.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Common.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Common.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Createfile.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Createfile.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Createfile.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Createfile.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Installpkg.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Installpkg.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Installpkg.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Installpkg.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Mkdir.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Mkdir.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Mkdir.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Mkdir.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Purgepkg.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Purgepkg.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Purgepkg.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Purgepkg.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Removedir.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Removedir.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Removedir.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Removedir.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Update/Removefile.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Removefile.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Removefile.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Removefile.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');

Modified: branches/next-gen/lib/PFTools/Utils.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Utils.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Utils.pm (original)
+++ branches/next-gen/lib/PFTools/Utils.pm Tue Sep  7 09:30:29 2010
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 
 our @ISA = ('Exporter');
@@ -626,7 +627,7 @@
 
     unless ( open( SRC, $input_file ) ) {
         Warn( $CODE->{'OPEN'},
-            "Unable top open file " . $input_file . " : $!" );
+            "Unable top open file " . $input_file . " : $OS_ERROR" );
         return 0;
     }
     my @src = <SRC>;

Modified: branches/next-gen/lib/PFTools/VCS.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/VCS.pm?rev=883&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/VCS.pm (original)
+++ branches/next-gen/lib/PFTools/VCS.pm Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
 use PFTools::Logger;
 use Data::Dumper;

Modified: branches/next-gen/sbin/fix_hosts
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/fix_hosts?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/fix_hosts (original)
+++ branches/next-gen/sbin/fix_hosts Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use warnings;
 
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Structqueries;
 use PFTools::Utils;
 use PFTools::Logger;
@@ -56,7 +57,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-h --host	: hostname for which we want to build interfaces file
 	-s --site	: site on which hostname is defined (optional)

Modified: branches/next-gen/sbin/mk_dhcp
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_dhcp?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_dhcp (original)
+++ branches/next-gen/sbin/mk_dhcp Tue Sep  7 09:30:29 2010
@@ -24,6 +24,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long qw( :config ignore_case_always bundling );
 use PFTools::Logger;
 use PFTools::Utils;
@@ -51,7 +52,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-H --header : header file for dhcp configuration
 	-s --site	: site on which hostname is defined

Modified: branches/next-gen/sbin/mk_grubopt
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_grubopt?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_grubopt (original)
+++ branches/next-gen/sbin/mk_grubopt Tue Sep  7 09:30:29 2010
@@ -29,6 +29,7 @@
 use PFTools::Utils;
 use PFTools::Structqueries;
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 
 ####################################################
 # Vars
@@ -56,7 +57,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	-h --help	: print help and exit
 	-h --host	: the hostname for which you want to build grub configuration
 	-s --site	: the site where the hostname is defined

Modified: branches/next-gen/sbin/mk_interfaces
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_interfaces?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_interfaces (original)
+++ branches/next-gen/sbin/mk_interfaces Tue Sep  7 09:30:29 2010
@@ -24,6 +24,7 @@
 use warnings;
 
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Utils;
 use PFTools::Structqueries;
 use PFTools::Logger;
@@ -52,7 +53,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-h --host	: hostname for which we want to build interfaces file
 	-s --site	: site on which hostname is defined (optional)

Modified: branches/next-gen/sbin/mk_pxelinuxcfg
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_pxelinuxcfg?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_pxelinuxcfg (original)
+++ branches/next-gen/sbin/mk_pxelinuxcfg Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use warnings;
 
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Utils;
 use PFTools::Logger;
 use Data::Dumper;
@@ -56,7 +57,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-s --site	: site for which you want to build PXE and preseed files
 	--script	: script which is "wgotten" and executed as post-install preseed default value is pf-tools-config.sh

Modified: branches/next-gen/sbin/mk_resolvconf
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_resolvconf?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_resolvconf (original)
+++ branches/next-gen/sbin/mk_resolvconf Tue Sep  7 09:30:29 2010
@@ -24,6 +24,7 @@
 use warnings;
 
 use Getopt::Long qw( :config ignore_case_always bundling );
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Utils;
 use PFTools::Logger;
 use PFTools::Structqueries;
@@ -52,7 +53,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-h --host	: hostname for which we want to build interfaces file
 	-s --site	: site on which hostname is defined (optional)

Modified: branches/next-gen/sbin/mk_sitezone
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_sitezone?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_sitezone (original)
+++ branches/next-gen/sbin/mk_sitezone Tue Sep  7 09:30:29 2010
@@ -25,6 +25,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long qw( :config ignore_case_always bundling );
 use PFTools::Utils;
 use PFTools::Logger;
@@ -51,7 +52,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help		: print help and exit
 	-s --site	: site on which hostname is defined
 	--store		: file where global structure datas are in storable format (optional)

Modified: branches/next-gen/sbin/mk_sourceslist
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_sourceslist?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_sourceslist (original)
+++ branches/next-gen/sbin/mk_sourceslist Tue Sep  7 09:30:29 2010
@@ -28,6 +28,7 @@
 use PFTools::Logger;
 use PFTools::Structqueries;
 use Sys::Hostname;
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long qw( :config ignore_case_always bundling );
 
 ############################################

Modified: branches/next-gen/sbin/update-config
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/update-config?rev=883&op=diff
==============================================================================
--- branches/next-gen/sbin/update-config (original)
+++ branches/next-gen/sbin/update-config Tue Sep  7 09:30:29 2010
@@ -24,6 +24,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long qw( :config ignore_case_always bundling );
 
 use PFTools::Utils;
@@ -50,7 +51,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help			: print help and exit
 	-h --host		: hostname for update-config
 	--site			: site for hostname (optional)

Modified: branches/next-gen/tools/Display_IP_config
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/Display_IP_config?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/Display_IP_config (original)
+++ branches/next-gen/tools/Display_IP_config Tue Sep  7 09:30:29 2010
@@ -28,7 +28,7 @@
 use warnings;
 
 use Data::Dumper;
-
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Utils;
 use NetAddr::IP;
 use Getopt::Long qw ( :config ignore_case_always bundling );
@@ -58,7 +58,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help	: print help and exit
 	-h --host	: the hostclass for which you want to display configuration
 	-s --site	: the site where the hostname is defined

Modified: branches/next-gen/tools/Translate_old_config
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/Translate_old_config?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/Translate_old_config (original)
+++ branches/next-gen/tools/Translate_old_config Tue Sep  7 09:30:29 2010
@@ -28,6 +28,7 @@
 use warnings;
 
 use Data::Dumper;
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Logger;
 use PFTools::Compat::Parser;
 use PFTools::Compat::Translation;
@@ -53,7 +54,7 @@
     print STDERR << "# ENDHELP";
     $program - version $version
 
-Usage:	$0 [options]
+Usage:	$program [options]
 	--help	: print help and exit
 	-t --type	: type of configuration file, allowed types are : config, network
 				- config is for update-* file

Modified: branches/next-gen/tools/dumpiplist.pl
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/dumpiplist.pl?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/dumpiplist.pl (original)
+++ branches/next-gen/tools/dumpiplist.pl Tue Sep  7 09:30:29 2010
@@ -28,7 +28,7 @@
 use warnings;
 
 use Data::Dumper;
-
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use PFTools::Net;
 use PFTools::Update;
 use Getopt::Long qw ( :config ignore_case_always bundling );
@@ -38,7 +38,7 @@
 my $src     = '';
 my $read    = 0;
 my $program = $0;
-$program =~ s%.*/%%;    # cheap basename
+$program =~ s%.*/%%;                 # cheap basename
 my $version = sprintf( "svn-r%s", q$Revision$ =~ /([\d.]+)/ );
 
 sub _ipcomp {

Modified: branches/next-gen/tools/kvmlaunch
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/kvmlaunch?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/kvmlaunch (original)
+++ branches/next-gen/tools/kvmlaunch Tue Sep  7 09:30:29 2010
@@ -152,8 +152,7 @@
     }
 
     my @interfaces = __get_list_of_interfaces( $Z, $vm_hostname );
-    my @net_args
-        = map { ( '-net', $_ ) }
+    my @net_args = map { ( '-net', $_ ) }
         map {
         (   "nic,vlan=$_->{'vlan'},macaddr=$_->{'mac'},model=e1000",
             "tap,vlan=$_->{'vlan'},ifname=$_->{'ifname'},script=no",

Modified: branches/next-gen/tools/pflaunch
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/pflaunch?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/pflaunch (original)
+++ branches/next-gen/tools/pflaunch Tue Sep  7 09:30:29 2010
@@ -31,6 +31,7 @@
 # il va chercher la conf dans config/GLOBAL/PF/«hostname».cfg
 #
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Expect;
 use File::Temp;
 use Getopt::Long;
@@ -136,7 +137,7 @@
     foreach my $cmd (@$cmds) {
         my @ret = `$cmd 2>&1`;
 
-        if ($?) {
+        if ($CHILD_ERROR) {
             $ok = 0;
         }
         elsif ($quiet) {
@@ -593,7 +594,7 @@
     __Debug( "  bridge `" . $brname . " @ " . $vlan_setup->{network} . "'" );
 
     #  `ifconfig $brname 2>/dev/null`;
-    __runCmds( ["brctl addbr $brname"], 1 );    # unless ($?);
+    __runCmds( ["brctl addbr $brname"], 1 );    # unless ($CHILD_ERROR);
 
     # J'applique les réglages pour le bridge,
     # s'il y a un réglage particulier pour un bridge je l'utilise
@@ -627,7 +628,7 @@
     my $trunk = Config_Key( $configfile, "global", "trunk" );
     $trunk = "eth1" unless ($trunk);
     `ifconfig $trunk up 2>/dev/null`;
-    unless ($?) {
+    unless ($CHILD_ERROR) {
         __Info("    Upping `$trunk.$tag'");
         __runCmds(
             [   "vconfig set_name_type DEV_PLUS_VID_NO_PAD",
@@ -682,7 +683,7 @@
             next unless (/^$brname:/);
             chomp;
             `ifconfig $_ 2>/dev/null`;
-            __runCmds( "ifconfig $_ down", 1 ) unless $?;
+            __runCmds( "ifconfig $_ down", 1 ) unless $CHILD_ERROR;
         }
         close STATUS_IFBR;
     }
@@ -699,7 +700,7 @@
 
     #  descend les $trunk.$tag
     __runCmds( [ "ifconfig $trunk.$1 down", "vconfig rem $trunk.$1" ], "1" )
-        if ( !$? and $brname =~ /(\d+)$/ );
+        if ( !$CHILD_ERROR and $brname =~ /(\d+)$/ );
 
     if ( -f $PF_STATUS_DIR . "/bridge/" . $brname ) {
         unlink $PF_STATUS_DIR . "/bridge/" . $brname;
@@ -763,7 +764,7 @@
     }
 
     `ifconfig $if 2>&1`;
-    if ($?) {
+    if ($CHILD_ERROR) {
 
         # Pourquoi
         __Debug(
@@ -917,7 +918,7 @@
     $screen->slave->clone_winsize_from( \*STDIN );
     $screen->spawn("screen -r $hostname");
     unless ($screen) {
-        __Err("Pas réussi à récupérer le screen: `$!'");
+        __Err("Pas réussi à récupérer le screen: `$OS_ERROR'");
         return;
     }
 
@@ -1043,10 +1044,10 @@
                     = sub { die "alarm\n" };    # N.B. : \n obligatoire
                 alarm 15;
                 `uml_mconsole $_->{vm} halt 2>&1`;
-                $_->{status} = $HALTED unless $?;
+                $_->{status} = $HALTED unless $CHILD_ERROR;
                 alarm 0;
             };
-            $failed = 1 if ($@);
+            $failed = 1 if ($EVAL_ERROR);
         }
         elsif ( __Umlrunning( $_->{vm} ) ) {
             $failed = 1;
@@ -1066,7 +1067,7 @@
     my $fichier;
     return unless ( -d "/var/run/screen/S-root" );
     opendir( SCREENDIR, "/var/run/screen/S-root" )
-        or __Fault("can't open $!");
+        or __Fault("can't open $OS_ERROR");
     while ( defined( $fichier = readdir(SCREENDIR) ) ) {
         next if ( $fichier =~ /^\./ );
 
@@ -1208,7 +1209,7 @@
         $nm = "$ip/$cidr";    # Et voilà !
     }
 
-    my $netmap = new Net::IP($nm) || die "$?";
+    my $netmap = new Net::IP($nm) || die "$CHILD_ERROR";    # FIXME: WTF?
     unless ($netmap) {
         __Err("`$nm' n'est pas une adresse réseau valide");
         return;
@@ -1526,7 +1527,7 @@
 
     return unless ( -f $PF_STATUS_DIR . "/lock" );
     open( LOCK, "<" . $PF_STATUS_DIR . "/lock" )
-        or __Fault("Can't open lock file $!");
+        or __Fault("Can't open lock file $OS_ERROR");
     my $pid = <LOCK>;
     close LOCK;
 
@@ -1549,7 +1550,7 @@
 sub __SetLock {
 
     open( LOCK, ">" . $PF_STATUS_DIR . "/lock" )
-        or __Fault("Can't open lock file $!");
+        or __Fault("Can't open lock file $OS_ERROR");
     print LOCK $$;
     close LOCK;
 
@@ -1569,7 +1570,7 @@
     $path = "/" unless $path;
     my @dfr = `/bin/df -P $path`;
 
-    if ($?) {
+    if ($CHILD_ERROR) {
         __Err("df failed");
         return;
     }
@@ -1732,10 +1733,10 @@
         if ( -f $procfile ) {
             __Debug("  $procfile = 0");
             open( EBTABLE, "> $procfile" )
-                or __Err("Can't open $procfile for writing: $!");
+                or __Err("Can't open $procfile for writing: $OS_ERROR");
             print EBTABLE 0;
             close(EBTABLE)
-                or __Fault("Can't close $procfile after writing: $!");
+                or __Fault("Can't close $procfile after writing: $OS_ERROR");
         }
 
 #    else {

Modified: branches/next-gen/tools/umlaunch
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/umlaunch?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/umlaunch (original)
+++ branches/next-gen/tools/umlaunch Tue Sep  7 09:30:29 2010
@@ -26,6 +26,7 @@
 use strict;
 use warnings;
 
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long;
 use Socket;
 use PFTools::Conf;
@@ -34,8 +35,8 @@
 
 $PFTools::Conf::PFTOOLS_VARS->{'UML'} = 1;
 
-my $mem      = "128";    # Default RAM size (MB)
-my $disksize = "768";    # Default disz size (MB)
+my $mem      = "128";                # Default RAM size (MB)
+my $disksize = "768";                # Default disz size (MB)
 
 my $ETHTRUNK = 'eth1';
 
@@ -52,7 +53,7 @@
 }
 
 `ifconfig $ETHTRUNK 2>/dev/null`;
-undef $ETHTRUNK if $?;
+undef $ETHTRUNK if $CHILD_ERROR;
 
 my $options;
 $options->{errors}     = 1;
@@ -289,10 +290,10 @@
     }
 
     my $notify;
-    socket( $notify, AF_UNIX, SOCK_DGRAM, 0 ) || die "socket: $!\n";
+    socket( $notify, AF_UNIX, SOCK_DGRAM, 0 ) || die "socket: $OS_ERROR\n";
     unlink("$ENV{HOME}/.uml/$host.notify");
     bind( $notify, sockaddr_un("$ENV{HOME}/.uml/$host.notify") )
-        || die "bind: $!\n";
+        || die "bind: $OS_ERROR\n";
 
     print $cmdline . "\n";
     system($cmdline);

Modified: branches/next-gen/tools/xenlaunch
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/tools/xenlaunch?rev=883&op=diff
==============================================================================
--- branches/next-gen/tools/xenlaunch (original)
+++ branches/next-gen/tools/xenlaunch Tue Sep  7 09:30:29 2010
@@ -23,6 +23,7 @@
 
 use Sitalibs::Config;
 use Data::Dumper;
+use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long;
 
 my $XENCFGDIR      = "/etc/xen";
@@ -247,7 +248,7 @@
 unless ( -d $DISKDIR . "/" . $vm ) {
     `mkdir -p $DISKDIR/$vm`;
     die "Probleme lors de la cration du dossier " . $DISKDIR . "/" . $vm
-        if ($!);
+        if ($CHILD_ERROR);
 }
 unless ( -f $DISKDIR . "/" . $vm . "/swap.img" ) {
     print "Creation du l'image swap\n";
@@ -275,7 +276,7 @@
 # Generation du fichier de configuration
 
 open XMCFG, ">" . $XENCFGDIR . "/" . $vm
-    or die "Can't open $XENCFGDIR/$vm $!";
+    or die "Can't open $XENCFGDIR/$vm: $OS_ERROR";
 
 print XMCFG "kernel = \"" . $KERNELDIR . "/" . $kernel . "\"\n";
 print XMCFG "memory = $mem\n";
@@ -293,7 +294,7 @@
 print "Lancement de $vm\n";
 
 my @xmlog = `xm create $vm`;
-if ($?) { print foreach @xmlog }
+if ($CHILD_ERROR) { print foreach @xmlog }
 
 &__renamevif( $vm, $famille, $num );
 




More information about the pf-tools-commits mailing list