Bug 12301 - translate script raised warnings with perl 5.18
Summary: translate script raised warnings with perl 5.18
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 12151
  Show dependency treegraph
 
Reported: 2014-05-21 11:15 UTC by Jonathan Druart
Modified: 2015-06-04 23:30 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12301: Remove warnings on translate scripts (12.54 KB, patch)
2014-05-21 11:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 12301: Remove warnings on translate scripts (12.74 KB, patch)
2014-05-24 18:40 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 12301: Remove warnings on translate scripts (12.82 KB, patch)
2014-05-28 11:30 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-05-21 11:15:04 UTC
./translate update la-ng
Smartmatch is experimental at ./translate line 54.
[...]
main::token_negligible_p() called too early to check prototype at ./xgettext.pl line 52.
[...]


On the way, this patch will fix errors raised by perlcritic and perl -wc
Comment 1 Jonathan Druart 2014-05-21 11:23:08 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-05-24 18:40:36 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2014-05-28 11:30:39 UTC
Created attachment 28513 [details] [review]
Bug 12301: Remove warnings on translate scripts

Using perl v5.18, the following is warned on updating/installing
templates:
  Smartmatch is experimental at ./translate line 54.

Moreover, the following should exist with previous perl versions:

perlcritic xgettext
Subroutine prototypes used at line 29, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 44, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 60, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 72, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 89, column 1.  See page 194 of PBP.
(Severity: 5)
Variable declared in conditional statement at line 105, column 13.
Declare variables outside of the condition.  (Severity: 5)
Subroutine prototypes used at line 127, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 136, column 1.  See page 194 of PBP.
(Severity: 5)
Variable declared in conditional statement at line 190, column 7.
Declare variables outside of the condition.  (Severity: 5)
Subroutine prototypes used at line 237, column 1.  See page 194 of PBP.
(Severity: 5)
Bareword file handle opened at line 238, column 5.  See pages 202,204 of
PBP.  (Severity: 5)
Two-argument "open" used at line 238, column 5.  See page 207 of PBP.
(Severity: 5)
Subroutine prototypes used at line 277, column 1.  See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 311, column 1.  See page 194 of PBP.
(Severity: 5)
Bareword file handle opened at line 350, column 9.  See pages 202,204 of
PBP.  (Severity: 5)
Two-argument "open" used at line 350, column 9.  See page 207 of PBP.
(Severity: 5)
Bareword file handle opened at line 353, column 5.  See pages 202,204 of
PBP.  (Severity: 5)
Bareword file handle opened at line 359, column 5.  See pages 202,204 of
PBP.  (Severity: 5)
Two-argument "open" used at line 359, column 5.  See page 207 of PBP.
(Severity: 5)

perl -wc xgettext.pl
\1 better written as $1 at TmplTokenizer.pm line 474.
main::token_negligible_p() called too early to check prototype at
xgettext.pl line 52.
xgettext.pl syntax OK

Test plan:
Apply this patch and verify the warnings/errors does not appear anymore
and no regression is found on creating/updating/installing templates.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no koha-qa errros.
Tested with perl v5.18.2
No warnings, no problem detected on create/update/install i18n files

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Tomás Cohen Arazi 2014-05-30 18:58:47 UTC
Pushed to master.

Thanks Jonathan!
Comment 5 Galen Charlton 2014-05-30 19:45:53 UTC
Pushed to 3.16.x.