From cc047529640fb24234ab981795a2e443d76c534a Mon Sep 17 00:00:00 2001 From: Stefan Priebe Date: Mon, 30 Sep 2013 11:50:42 +0200 Subject: [PATCH] do not use -w switch as it breaks modules -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 4f1309c3d..adf1de696 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 834c9e2b0..f8ae3ad12 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 60494055a..9184d1f28 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 9dbd79ef5..53b58a07b 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 d0f84322d..55e97b4a2 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 6cd33e3a7..83228eb2a 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 3ab685cfb..7074c14fa 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 2aa7c5a5b..59d53e1d5 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 fbb5d11f3..e54bc5206 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 f439fa7b4..0ce01824d 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 9b185bdb7..bed349e8a 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;