Bug 12081: make tmpl_process3.pl delete ts temp files
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Mon, 14 Apr 2014 22:35:35 +0000 (19:35 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 13 Aug 2014 14:26:38 +0000 (10:26 -0400)
This patch enable deletion of temp files used by
tmpl_process3.pl.
Just removed coments on existing code

To test:
1. Do a count of files on /tmp ( ls /tmp | wc -l )
2. Update preferred language
3. Count again, new files on /tmp
4. Apply the patch
5. Update again, check, no new files

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: I watched what temp files were actually in /tmp to make
      sure other processes didn't magically increase/decrease
      the number.
          $ perl translate update {lang code}
      generated 10 temporary files for me (2x5 po files). After
      removing those ten files, and applying the patch, no
      other files were generated.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
These lines has been commented by commit
a399dcefad193fc21ef2dc1fe31d07686ab2da46 without any apparent good
reason.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit de81d7abe43f3c2eed327b52e212bc790b406961)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d9e1a5de8eeb01a450321e4a64d1b9d3fa444405)

misc/translator/tmpl_process3.pl

index 993e2a8..d34a85f 100755 (executable)
@@ -354,8 +354,8 @@ if ($action eq 'create')  {
     error_normal "Text extraction failed: $xgettext: $!\n", undef;
     error_additional "Will not run msgmerge\n", undef;
     }
-#   unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef;
-#   unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef;
+    unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef;
+    unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef;
 
 } elsif ($action eq 'update') {
     my($tmph1, $tmpfile1) = tmpnam();
@@ -380,8 +380,8 @@ if ($action eq 'create')  {
     error_normal "Text extraction failed: $xgettext: $!\n", undef;
     error_additional "Will not run msgmerge\n", undef;
     }
-#   unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef;
-#   unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef;
+    unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef;
+    unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef;
 
 } elsif ($action eq 'install') {
     if(!defined($out_dir)) {