Bug 36516

Summary: translation script could output useless warning
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: I18N/L10NAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to oldstable --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: f.demians, fridolin.somers, jonathan.druart, lucas, m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06
Attachments: Bug 36516: Fix useless warning from translation script
Bug 36516: Fix useless warning from translation script
Bug 36516: Fix useless warning from translation script

Description Jonathan Druart 2024-04-04 09:13:00 UTC
I lost too much time trying to know what the translation script outputs
  sh: 1: Syntax error: end of file unexpected
Comment 1 Jonathan Druart 2024-04-04 09:15:53 UTC
Created attachment 164410 [details] [review]
Bug 36516: Fix useless warning from translation script

I lost too much time trying to know what the translation script outputs
  sh: 1: Syntax error: end of file unexpected

To recreate:
touch 'koha-tmpl/intranet-tmpl/prog/en/modules/<' (yes, don't ask!)
koha-translate -i de-DE --dev kohadev
or
koha-translate -u de-DE --dev kohadev

And you get the shell error without any ideas what's happening!

With this patch applied you will not get any errors because the quote
will actually copy the file (what is expected).

But without the quote the cp command will fail and the explanation will be
displayed
sh: 1: Syntax error: end of file unexpected
Cannot copy /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/< to /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/de-DE/modules/< at /kohadevbox/koha/misc/translator/tmpl_process3.pl line 385.
Comment 2 David Nind 2024-04-04 19:36:49 UTC
Created attachment 164436 [details] [review]
Bug 36516: Fix useless warning from translation script

I lost too much time trying to know what the translation script outputs
  sh: 1: Syntax error: end of file unexpected

To recreate:
touch 'koha-tmpl/intranet-tmpl/prog/en/modules/<' (yes, don't ask!)
koha-translate -i de-DE --dev kohadev
or
koha-translate -u de-DE --dev kohadev

And you get the shell error without any ideas what's happening!

With this patch applied you will not get any errors because the quote
will actually copy the file (what is expected).

But without the quote the cp command will fail and the explanation will be
displayed
sh: 1: Syntax error: end of file unexpected
Cannot copy /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/< to /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/de-DE/modules/< at /kohadevbox/koha/misc/translator/tmpl_process3.pl line 385.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2024-04-05 07:11:59 UTC
Created attachment 164453 [details] [review]
Bug 36516: Fix useless warning from translation script

I lost too much time trying to know what the translation script outputs
  sh: 1: Syntax error: end of file unexpected

To recreate:
touch 'koha-tmpl/intranet-tmpl/prog/en/modules/<' (yes, don't ask!)
koha-translate -i de-DE --dev kohadev
or
koha-translate -u de-DE --dev kohadev

And you get the shell error without any ideas what's happening!

With this patch applied you will not get any errors because the quote
will actually copy the file (what is expected).

But without the quote the cp command will fail and the explanation will be
displayed
sh: 1: Syntax error: end of file unexpected
Cannot copy /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/< to /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/de-DE/modules/< at /kohadevbox/koha/misc/translator/tmpl_process3.pl line 385.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Katrin Fischer 2024-04-05 09:53:25 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 5 Fridolin Somers 2024-05-23 11:47:39 UTC
Pushed to 23.11.x for 23.11.06
Comment 6 Lucas Gass 2024-05-28 17:25:09 UTC
Backported to 23.05.x for upcoming 23.05.12