From 99cd91ad2dbbc1c24bf4aea41865147013f947bb Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 19 Dec 2018 20:32:32 +0000 Subject: [PATCH] Bug 20000: Use Modern::Perl in installer scripts To test: Check that we are using Modern::Perl when strict *and* warnings were used before, and commented lines and FIXMEs have been removed from the rest, out of files listed below. data/mysql/backfill_statistics.pl data/mysql/labels_upgrade.pl data/mysql/patroncards_upgrade.pl data/mysql/update22to30.pl data/mysql/updatedatabase.pl externalmodules.pl html-template-to-template-toolkit.pl install.pl Sponsored-by: Catalyst IT Signed-off-by: Maryse Simard Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 20a38ee50e6fe62712e299bcec9e939dc2bbb58e) Signed-off-by: Martin Renvoize --- installer/data/mysql/backfill_statistics.pl | 3 +-- installer/data/mysql/labels_upgrade.pl | 3 --- installer/data/mysql/patroncards_upgrade.pl | 3 --- installer/data/mysql/update22to30.pl | 1 - installer/data/mysql/updatedatabase.pl | 3 +-- installer/externalmodules.pl | 5 ++--- installer/html-template-to-template-toolkit.pl | 3 +-- installer/install.pl | 3 +-- 8 files changed, 6 insertions(+), 18 deletions(-) diff --git a/installer/data/mysql/backfill_statistics.pl b/installer/data/mysql/backfill_statistics.pl index d03b46177d..488255b711 100755 --- a/installer/data/mysql/backfill_statistics.pl +++ b/installer/data/mysql/backfill_statistics.pl @@ -3,8 +3,7 @@ # Part of the Koha Library Software www.koha-community.org # Licensed under the GPL. -use strict; -use warnings; +use Modern::Perl; # CPAN modules use DBI; diff --git a/installer/data/mysql/labels_upgrade.pl b/installer/data/mysql/labels_upgrade.pl index 158a4ec118..859a7d9e80 100755 --- a/installer/data/mysql/labels_upgrade.pl +++ b/installer/data/mysql/labels_upgrade.pl @@ -17,9 +17,6 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -#use strict; -#use warnings; FIXME - Bug 2505 - use C4::Context; my $sth = C4::Context->dbh; diff --git a/installer/data/mysql/patroncards_upgrade.pl b/installer/data/mysql/patroncards_upgrade.pl index b47049bec6..fde702e1f4 100755 --- a/installer/data/mysql/patroncards_upgrade.pl +++ b/installer/data/mysql/patroncards_upgrade.pl @@ -17,9 +17,6 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -#use strict; -#use warnings; FIXME - Bug 2505 - use C4::Context; my $sth = C4::Context->dbh; diff --git a/installer/data/mysql/update22to30.pl b/installer/data/mysql/update22to30.pl index f10ace95c5..d38f080bcc 100755 --- a/installer/data/mysql/update22to30.pl +++ b/installer/data/mysql/update22to30.pl @@ -12,7 +12,6 @@ # NOTE: If you do something more than once in here, make it table driven. use strict; -#use warnings; FIXME - Bug 2505 # CPAN modules use DBI; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f619c94ef0..82f95025a1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -27,8 +27,7 @@ # NOTE: Please keep the version in kohaversion.pl up-to-date! -use strict; -use warnings; +use Modern::Perl; use feature 'say'; diff --git a/installer/externalmodules.pl b/installer/externalmodules.pl index 42eb4b7ef1..0d338abf46 100755 --- a/installer/externalmodules.pl +++ b/installer/externalmodules.pl @@ -4,10 +4,9 @@ # It provides you not only the list of modules BUT ALSO the files that uses those modules. # utf8 or warnings or other lib use are not taken into account at the moment. - -use strict; -use warnings; +use Modern::Perl; use C4::Context; + my $dir=C4::Context->config('intranetdir'); qx(grep -r "^ *use" $dir | grep -v "C4\|strict\|vars" >/tmp/modulesKoha.log); $dir=C4::Context->config('opacdir'); diff --git a/installer/html-template-to-template-toolkit.pl b/installer/html-template-to-template-toolkit.pl index 9905abe44a..60cd951dd1 100755 --- a/installer/html-template-to-template-toolkit.pl +++ b/installer/html-template-to-template-toolkit.pl @@ -1,7 +1,6 @@ #!/usr/bin/perl -use strict; -use warnings; +use Modern::Perl; use Carp; use Data::Dumper; diff --git a/installer/install.pl b/installer/install.pl index 459606d4cf..bf9ccc4229 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use diagnostics; use C4::InstallAuth; -- 2.39.5