Bug 15687 - Syntax errors in misc/translator/xgettext.pl
Summary: Syntax errors in misc/translator/xgettext.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on: 6679
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-28 08:31 UTC by Julian Maurice
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

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


Attachments
Bug 15687: Fix xgettext.pl syntax errors (1.38 KB, patch)
2016-01-28 08:33 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 15687: Fix xgettext.pl syntax errors (1.45 KB, patch)
2016-01-28 10:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15687: Fix xgettext.pl syntax errors (1.51 KB, patch)
2016-01-29 12:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 15687 [QA Followup] - Tidy sub to remove tab characters (1.73 KB, patch)
2016-01-29 12:03 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2016-01-28 08:31:36 UTC
It seems that Bug 6679 broke xgettext.pl

To reproduce:
1. cd misc/translator
2. perl -cw xgettext.pl

Errors:

Use of ?PATTERN? without explicit operator is deprecated at xgettext.pl line 51.
Number found where operator expected at xgettext.pl line 52, near "$t == C4::TmplTokenType::DIRECTIVE? 1"
  (Might be a runaway multi-line ?? string starting on line 51)
        (Missing operator before  1?)
"my" variable $t masks earlier declaration in same scope at xgettext.pl line 54.
Use of my $_ is experimental at xgettext.pl line 54.
"my" variable $t masks earlier declaration in same statement at xgettext.pl line 55.
Use of ?PATTERN? without explicit operator is deprecated at xgettext.pl line 55.
"my" variable $t masks earlier declaration in same statement at xgettext.pl line 56.
String found where operator expected at xgettext.pl line 57, near "''"
        (Missing semicolon on previous line?)
syntax error at xgettext.pl line 52, near "$t == C4::TmplTokenType::DIRECTIVE? 1"
syntax error at xgettext.pl line 57, near "''"
Global symbol "$x" requires explicit package name at xgettext.pl line 58.
syntax error at xgettext.pl line 58, near "} ) "
Can't use global @_ in "my" at xgettext.pl line 64, near "= @_"
Global symbol "$string" requires explicit package name at xgettext.pl line 66.
Global symbol "$token" requires explicit package name at xgettext.pl line 66.
Global symbol "$string" requires explicit package name at xgettext.pl line 67.
Global symbol "$token" requires explicit package name at xgettext.pl line 69.
syntax error at xgettext.pl line 71, near "}"
xgettext.pl has too many errors.
Comment 1 Julian Maurice 2016-01-28 08:33:47 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-01-28 10:27:24 UTC
the translate script is broken as well

% ./translate update fr-FR
Comment 3 Jonathan Druart 2016-01-28 10:29:55 UTC
Julian, there are some other occurrences in xgettext.pl which certainly need to be fixed.

I think that the easiest way is to revert the original patch.

Upgrading to critical.
Comment 4 Julian Maurice 2016-01-28 10:34:00 UTC
(In reply to Jonathan Druart from comment #3)
> Julian, there are some other occurrences in xgettext.pl which certainly need
> to be fixed.
> 
> I think that the easiest way is to revert the original patch.

With the patch,
- perl -cw xgettext.pl is OK
- ./translate update fr-FR works fine too

Why do you think the revert is needed ?
Comment 5 Julian Maurice 2016-01-28 10:34:42 UTC
s/needed/easiest/
Comment 6 Jonathan Druart 2016-01-28 10:42:04 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-01-28 10:42:33 UTC
(In reply to Julian Maurice from comment #4)
> (In reply to Jonathan Druart from comment #3)
> > Julian, there are some other occurrences in xgettext.pl which certainly need
> > to be fixed.
> > 
> > I think that the easiest way is to revert the original patch.
> 
> With the patch,
> - perl -cw xgettext.pl is OK
> - ./translate update fr-FR works fine too
> 
> Why do you think the revert is needed ?

Indeed, sorry. Everything is fine with the patch applied.
Comment 8 Kyle M Hall 2016-01-29 12:03:37 UTC
Created attachment 47461 [details] [review]
Bug 15687: Fix xgettext.pl syntax errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2016-01-29 12:03:47 UTC
Created attachment 47462 [details] [review]
Bug 15687 [QA Followup] - Tidy sub to remove tab characters

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Brendan Gallagher 2016-02-03 23:02:10 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 11 Julian Maurice 2016-02-04 11:22:58 UTC
Patches pushed to 3.22.x, will be in 3.22.3
Comment 12 Frédéric Demians 2016-02-18 18:37:50 UTC
Patches pushed to 3.20.x, will be in 3.20.9.