From 4a7ec67faeeae3b3f8a5a38c49ac7ec74135e072 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Wed, 3 Oct 2018 11:24:38 +0300 Subject: [PATCH] Bug 21480: misc/translator/translate does not work with perl 5.26 Perl 5.26 (or earlier) introduced a security feature, where implicitly including the program directory as a Perl library directory no longer happens (perl -I. ). This causes translate to fail because it cannot find the *.pm -files in it's own directory. This patch adds the familiar mantra use lib $FindBin::Bin; to the relevant scripts. To test: 1. Install Ubuntu18.04 or something else with Perl 5.26 2. Install Koha (we use the dev-install) 3. cd $KOHA_PATH/misc/translator/ 4. perl translate create fi-FI 5. Observe problems with missing modules. Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart Cannot recreate the issue right now but the changes make sense. Signed-off-by: Nick Clemens (cherry picked from commit 8aa86cdf2d5e0dbda7d21394e52f37ba17a8064c) Signed-off-by: Martin Renvoize (cherry picked from commit 24e2d2d9c46772804ee1904ec7ab3e80a8bf9d28) Signed-off-by: Fridolin Somers --- misc/translator/text-extract.pl | 4 ++++ misc/translator/text-extract2.pl | 3 +++ misc/translator/tmpl_process3.pl | 3 +++ misc/translator/translate | 3 +++ misc/translator/xgettext.pl | 3 +++ 5 files changed, 16 insertions(+) diff --git a/misc/translator/text-extract.pl b/misc/translator/text-extract.pl index 4e2fbdce77..10d35200e3 100755 --- a/misc/translator/text-extract.pl +++ b/misc/translator/text-extract.pl @@ -1,6 +1,10 @@ #!/usr/bin/perl #use strict; #use warnings; FIXME - Bug 2505 + +use FindBin; +use lib $FindBin::Bin; + use HTML::Tree; use Getopt::Std; getopt("f:"); diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index cfcd027651..f7a5c83e0e 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -14,6 +14,9 @@ # --> This will be relatively major rework, and requires corresponding # rework in tmpl_process.pl +use FindBin; +use lib $FindBin::Bin; + use strict; #use warnings; FIXME - Bug 2505 use Getopt::Long; diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl index 4ded16fb7c..e39e64c390 100755 --- a/misc/translator/tmpl_process3.pl +++ b/misc/translator/tmpl_process3.pl @@ -4,6 +4,9 @@ # Parts copyright 2003-2004 Jerome Vizcaino # Parts copyright 2004 Ambrose Li +use FindBin; +use lib $FindBin::Bin; + =head1 NAME tmpl_process3.pl - Alternative version of tmpl_process.pl diff --git a/misc/translator/translate b/misc/translator/translate index 697a3db14a..59a0c127ee 100755 --- a/misc/translator/translate +++ b/misc/translator/translate @@ -19,6 +19,9 @@ package Main; +use FindBin; +use lib $FindBin::Bin; + use strict; use warnings; diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index 8d555478ad..508fd87855 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -6,6 +6,9 @@ xgettext.pl - xgettext(1)-like interface for .tt strings extraction =cut +use FindBin; +use lib $FindBin::Bin; + use strict; use warnings; use Getopt::Long; -- 2.39.5