From e051858c3ecc2852321236d31dfef836333c4f65 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 4 Apr 2024 11:13:04 +0200 Subject: [PATCH] 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. --- misc/translator/tmpl_process3.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl index 6417226d9b6..5e4865d6a9f 100755 --- a/misc/translator/tmpl_process3.pl +++ b/misc/translator/tmpl_process3.pl @@ -381,7 +381,7 @@ if ($action eq 'install') { } else { # just copying the file mkdir_recursive($targetdir) unless -d $targetdir; - system("cp -f $input $target"); + system("cp -f '$input' '$target'") == 0 or warn "Cannot copy $input to $target"; print STDERR "Copying $input...\n" unless $quiet; } } -- 2.34.1