[pve-devel] [PATCH] do not use -w switch as it breaks modules

Stefan Priebe s.priebe at profihost.ag
Mon Sep 30 11:50:42 CEST 2013


-w enabled warnings for all modules - even when these modules comes from the OS and are not compatible
with warnings. This is the reason to NOT use -w and instead use "use warnings".
---
 bin/pveam             |    3 ++-
 bin/pvectl            |    3 ++-
 bin/pvedaemon         |    3 ++-
 bin/pvemailforward.pl |    2 +-
 bin/pveperf           |    3 ++-
 bin/pveproxy          |    3 ++-
 bin/pvesh             |    3 ++-
 bin/pvestatd          |    3 ++-
 bin/pvesubscription   |    3 ++-
 bin/pveupgrade        |    4 +++-
 bin/pveversion        |    3 ++-
 11 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/bin/pveam b/bin/pveam
index 4f1309c..adf1de6 100755
--- a/bin/pveam
+++ b/bin/pveam
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use PVE::Cluster;
 use PVE::APLInfo;
 
diff --git a/bin/pvectl b/bin/pvectl
index 834c9e2..f8ae3ad 100755
--- a/bin/pvectl
+++ b/bin/pvectl
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use PVE::Tools qw(extract_param);
 use PVE::Cluster qw(cfs_register_file cfs_read_file);
diff --git a/bin/pvedaemon b/bin/pvedaemon
index 6049405..9184d1f 100755
--- a/bin/pvedaemon
+++ b/bin/pvedaemon
@@ -1,10 +1,11 @@
-#!/usr/bin/perl -T -w
+#!/usr/bin/perl -T
 
 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
 
 delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};  
 
 use strict;
+use warnings;
 use Getopt::Long;
 use POSIX ":sys_wait_h";
 use Socket;
diff --git a/bin/pvemailforward.pl b/bin/pvemailforward.pl
index 9dbd79e..53b58a0 100755
--- a/bin/pvemailforward.pl
+++ b/bin/pvemailforward.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w -T
+#!/usr/bin/perl -T
 
 use strict;
 use warnings;
diff --git a/bin/pveperf b/bin/pveperf
index d0f8432..55e97b4 100755
--- a/bin/pveperf
+++ b/bin/pveperf
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use File::Sync;
 use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
 use Net::DNS::Resolver;
diff --git a/bin/pveproxy b/bin/pveproxy
index 6cd33e3..83228eb 100755
--- a/bin/pveproxy
+++ b/bin/pveproxy
@@ -1,10 +1,11 @@
-#!/usr/bin/perl -T -w
+#!/usr/bin/perl -T
 
 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
 
 delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};  
 
 use strict;
+use warnings;
 use English;
 use Getopt::Long;
 use POSIX ":sys_wait_h";
diff --git a/bin/pvesh b/bin/pvesh
index 3ab685c..7074c14 100755
--- a/bin/pvesh
+++ b/bin/pvesh
@@ -1,9 +1,10 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 # TODO:
 # implement persistent history ?
  
 use strict;
+use warnings;
 use Term::ReadLine;
 use File::Basename;
 use Getopt::Long;
diff --git a/bin/pvestatd b/bin/pvestatd
index 2aa7c5a..59d53e1 100755
--- a/bin/pvestatd
+++ b/bin/pvestatd
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use PVE::SafeSyslog;
 use POSIX ":sys_wait_h";
 use Fcntl ':flock';
diff --git a/bin/pvesubscription b/bin/pvesubscription
index fbb5d11..e54bc52 100755
--- a/bin/pvesubscription
+++ b/bin/pvesubscription
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use PVE::Tools;
 use PVE::SafeSyslog;
diff --git a/bin/pveupgrade b/bin/pveupgrade
index f439fa7..0ce0182 100755
--- a/bin/pveupgrade
+++ b/bin/pveupgrade
@@ -1,6 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
+
 use File::stat ();
 use Getopt::Long;
 
diff --git a/bin/pveversion b/bin/pveversion
index 9b185bd..bed349e 100755
--- a/bin/pveversion
+++ b/bin/pveversion
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use POSIX;
 use Getopt::Long;
 use PVE::API2::APT;
-- 
1.7.10.4




More information about the pve-devel mailing list