Bug 11571: fix breakage of -f option for translate script
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 16 Jan 2014 14:47:42 +0000 (15:47 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 26 Jan 2014 15:50:41 +0000 (15:50 +0000)
Bug 7934 breaks the -f option introduced in bug 9161; this patch
repairs the regression.

While the generation of the command tmpl_process3.pl, a space is
missing if the -x option is given.

The tmpl_process3.pl is called like:
/home/koha/src/misc/translator/tmpl_process3.pl -q update -i
/home/koha/src/koha-tmpl/intranet-tmpl/prog/en/ -s
/home/koha/src/misc/translator/po/fr-FR-i-staff-t-prog-v-3006000.po -r
-x 'help'-f pay.tt

Revised test plan:
1) cd ./misc/translator
2) put a warn at LangInstaller.pm line 375.
3) time ./translate update fr-FR -f pay.tt
-- note the execution time and the output. The options in the
    command contain "-x 'help'-f pay.tt"
    The -f param is not passed to the script.
    The execution time is strangely long.
5) git reset --hard origin/master
6) apply this patch
7) put a warn at LangInstaller.pm line 375.
8) time ./translate update fr-FR -f pay.tt
-- verify the output and the execution time is now corrected.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
misc/translator/LangInstaller.pm

index 50ba308..158ca22 100644 (file)
@@ -349,7 +349,7 @@ sub install_tmpl {
             "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r $excludes" .
             (
                 @$files
-                    ? '-f ' . join ' -f ', @$files
+                    ? ' -f ' . join ' -f ', @$files
                     : ''
             )
     }
@@ -378,7 +378,7 @@ sub update_tmpl {
             "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r $excludes" .
             (
                 @$files
-                    ? '-f ' . join ' -f ', @$files
+                    ? ' -f ' . join ' -f ', @$files
                     : ''
             )
     }
@@ -417,7 +417,7 @@ sub create_tmpl {
             "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r $excludes" .
             (
                 @$files
-                    ? '-f ' . join ' -f ', @$files
+                    ? ' -f ' . join ' -f ', @$files
                     : ''
             )
     }