[Libreoffice-commits] core.git: 2 commits - instsetoo_native/CustomTarget_install.mk scp2/macros scp2/source

Tor Lillqvist tml at iki.fi
Thu Aug 8 13:41:06 PDT 2013


 instsetoo_native/CustomTarget_install.mk |    3 --
 scp2/macros/macro.pl                     |   37 ++++++++++++++++++++++++++++++-
 scp2/source/ooo/directory_ooo.scp        |    5 ----
 scp2/source/ooo/file_ooo.scp             |    7 -----
 4 files changed, 39 insertions(+), 13 deletions(-)

New commits:
commit dfc4ace4278d6c9e77ec150f947a1a6ee454d70d
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Aug 8 23:10:16 2013 +0300

    fdo#62442: Move the InfoPlist.strings files into the app from langpacks
    
    The digital signature of an app bundle includes an integrity check for
    the Resources subtree. This is the normal place for Mac apps to have
    their read-only non-code "resources". In LibreOffice it is currently
    not much used, though.
    
    The signature thus breaks when a lang pack installer is run and plops
    its InfoPlist.strings file into the "Resources" subtree. This file
    contains translations of strings in the app's Info.plist file. For
    LibreOffice, it contains translations only for some of the file type
    names in Info.plist. (Why only some, I don't know.)
    
    Files installed by a lang pack insaller into other locations in the
    app bundle don't harm the signature.
    
    Making the InfoPlist.strings files be distributed as part of the main
    app bundle instead of in langpacks should keep the signature valid
    even if a lang pack is installed. The InfoPlist.strings files are
    small so the size of the main app should not grow significantly.
    
    This required introduction of a new functionality in scp2: The
    possibility to generate a list of several complete File or Directory
    stanzas, one for each language for which translations are being
    built.
    
    (This is different from the existing functionality, used for files
    that go into lang packs, where a stanza contains several Name or
    HostName attributes (or whatever the term is) where the attribute
    names are qualified with the language code in parens.)
    
    Change-Id: I3afd9b08944fe1bccb5f0c881d740d260f589e39

diff --git a/scp2/macros/macro.pl b/scp2/macros/macro.pl
index e86623c..3ebeabe 100644
--- a/scp2/macros/macro.pl
+++ b/scp2/macros/macro.pl
@@ -21,6 +21,7 @@ my $destfile;
 my $config_stamp;
 my $lastcompletelangiso_var;
 my $completelangiso_var = $ENV{COMPLETELANGISO_VAR};
+my $help_langs_var = $ENV{HELP_LANGS};
 
 if ( !defined $completelangiso_var) {
     print STDERR "ERROR: No language defined!\n";
@@ -33,13 +34,15 @@ if (!args_require_build()) {
 }
 
 my @completelangiso = split " +", $completelangiso_var;
-my @helplangs = split " +", $ENV{HELP_LANGS};
+my @helplangs = split " +", $help_langs_var;
 
 open OUTFILE, ">$outfile" or die "$0 ERROR: cannot open $outfile for writing!\n";
 
 print OUTFILE "// generated file, do not edit\n\n";
 print OUTFILE "// languages used for last time generation\n";
 print OUTFILE "// completelangiso: $completelangiso_var\n\n";
+print OUTFILE "// help_langs: $help_langs_var\n\n";
+write_ITERATE_ALL_LANG();
 write_ALL_LANG();
 write_OTHER_LANGS();
 write_DIR_ISOLANGUAGE_ALL_LANG_2();
@@ -57,6 +60,38 @@ close OUTFILE;
 
 rename $outfile, $destfile;
 
+sub write_ITERATE_ALL_LANG
+{
+    print OUTFILE "#define ITERATE_ALL_LANG_FILE(gid,dir,macro,name,ext) ";
+    foreach $lang (@helplangs) {
+        my $shortlang = $lang;
+        $shortlang = "en" if $shortlang eq "en-US";
+        my $speciallang = $lang;
+        $speciallang =~ s/-/_/;
+        print OUTFILE "\\\nFile CONCAT3(gid_File_,gid,_$speciallang)";
+        print OUTFILE "\\\n\tDir = CONCAT3(gid_Dir_,dir,_$speciallang);";
+        print OUTFILE "\\\n\tmacro;";
+        print OUTFILE "\\\n\tName = STRING(CONCAT3(name,_$lang,ext)); ";
+        print OUTFILE "\\\nEnd ";
+        print OUTFILE "\\\n";
+    }
+    print OUTFILE "\n\n";
+
+    print OUTFILE "#define ITERATE_ALL_LANG_DIR_LPROJ(gid,parent) ";
+    foreach $lang (@helplangs) {
+        my $shortlang = $lang;
+        $shortlang = "en" if $shortlang eq "en-US";
+        my $speciallang = $lang;
+        $speciallang =~ s/-/_/;
+        print OUTFILE "\\\nDirectory CONCAT3(gid_Dir_,gid,_$speciallang)";
+        print OUTFILE "\\\n\tParentID = CONCAT2(gid_Dir_,parent);";
+        print OUTFILE "\\\n\tDosName = \"$shortlang.lproj\"; ";
+        print OUTFILE "\\\nEnd ";
+        print OUTFILE "\\\n";
+    }
+    print OUTFILE "\n\n";
+}
+
 sub write_ALL_LANG
 {
     print OUTFILE "#define ALL_LANG(ident, resid) ";
diff --git a/scp2/source/ooo/directory_ooo.scp b/scp2/source/ooo/directory_ooo.scp
index 6037330..2647561 100644
--- a/scp2/source/ooo/directory_ooo.scp
+++ b/scp2/source/ooo/directory_ooo.scp
@@ -26,10 +26,7 @@ End
 #endif
 
 #ifdef MACOSX
-Directory gid_Dir_Bundle_Contents_Resources_Lang
-    ParentID = gid_Dir_Bundle_Contents_Resources;
-    DIR_ISOLANGUAGE_ALL_LANG_LPROJ;
-End
+ITERATE_ALL_LANG_DIR_LPROJ(Bundle_Contents_Resources_Lang,Bundle_Contents_Resources)
 #endif
 
 #ifdef MACOSX
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index 256636d..f51f0a6 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -756,12 +756,7 @@ End
 #endif
 
 #ifdef MACOSX
-File gid_File_InfoPlist_Lang
-    Dir = gid_Dir_Bundle_Contents_Resources_Lang;
-    ARCHIVE_TXT_FILE_BODY;
-    Styles = (ARCHIVE);
-    EXTRA_ALL_LANG(InfoPlist,zip);
-End
+ITERATE_ALL_LANG_FILE(InfoPlist_Lang,Bundle_Contents_Resources_Lang,ARCHIVE_TXT_FILE_BODY,InfoPlist,.zip)
 #endif
 
 #ifdef MACOSX
commit 1b5ed901af4aefad8397f259c85a6a94871df2e1
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Aug 8 20:51:18 2013 +0300

    Simplify check for verbosity
    
    Just check for $(VERBOSE) or $(verbose) being non-empty instead of
    checking for $(VERBOSE) equalling "TRUE". Isn't our normal way to do a
    verbose make to pass verbose=t?
    
    Change-Id: Ic4ddc1fe025fed55ca56fd21b615640c389c0454

diff --git a/instsetoo_native/CustomTarget_install.mk b/instsetoo_native/CustomTarget_install.mk
index ffedb20..5045b5a 100644
--- a/instsetoo_native/CustomTarget_install.mk
+++ b/instsetoo_native/CustomTarget_install.mk
@@ -88,8 +88,7 @@ $(foreach pkgformat,$(5),\
 	) \
 	$(4) \
 	-format $(pkgformat) \
-	$(if $(filter TRUE,$(VERBOSE)),-verbose, \
-		$(if $(findstring s,$(MAKEFLAGS)),-quiet)) \
+	$(if $(VERBOSE)$(verbose),-verbose,-quiet) \
 )
 endef
 


More information about the Libreoffice-commits mailing list