[Libreoffice-commits] core.git: 2 commits - solenv/bin solenv/gbuild sysui/Package_infoplist.mk
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 17 06:10:51 UTC 2019
solenv/bin/modules/installer/systemactions.pm | 14 ++++++++++++++
solenv/gbuild/Package.mk | 20 ++++++++++++++++++++
sysui/Package_infoplist.mk | 4 +++-
3 files changed, 37 insertions(+), 1 deletion(-)
New commits:
commit 47a774fbef8c224e4853de3fdd0230b9442bb716
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jul 16 15:55:19 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jul 17 08:10:00 2019 +0200
tdf#125693: On macOS, create empty LibreOffice.app/Contents/Resources/en.lproj
...as otherwise languages like Slovenian (which do not have a full system
integration) fall back to other LibreOffice.app/Contents/Resource/*.lproj
localizations instead of to English (whose Info.plist is stored as
LibreOffice.app/Contents/Info.plist, not as some
LibreOffice.app/Contents/Resources/en.lproj/InfoPlist.strings as is done for
other languages).
Change-Id: Ic69907a066e9afe1d66045016ad6bf9d997c67d0
Reviewed-on: https://gerrit.libreoffice.org/75728
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sysui/Package_infoplist.mk b/sysui/Package_infoplist.mk
index 7712b3e77e4e..de53ba5ba769 100644
--- a/sysui/Package_infoplist.mk
+++ b/sysui/Package_infoplist.mk
@@ -17,9 +17,11 @@ $(eval $(call gb_Package_add_files,infoplist,$(PRODUCTNAME_WITHOUT_SPACES).app/C
Info.plist \
))
-$(foreach lang,$(filter ca cs da de el en es fi fr hr hu id it ja ko ms nl no pl pt pt_PT ro ru sk sv th tr uk vi zh_CN zh_TW,$(gb_WITH_LANG)),\
+$(foreach lang,$(filter ca cs da de el es fi fr hr hu id it ja ko ms nl no pl pt pt_PT ro ru sk sv th tr uk vi zh_CN zh_TW,$(gb_WITH_LANG)),\
$(eval $(call gb_Package_add_files,infoplist,$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Resources/$(lang).lproj,\
InfoPlist_$(lang)/InfoPlist.strings \
)))
+$(eval $(call gb_Package_add_empty_directory,infoplist,$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Resources/en.lproj))
+
# vim: set noet sw=4 ts=4:
commit cabadfc288e5e7324723c62f36b918a80db90323
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jul 16 12:06:47 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jul 17 08:09:52 2019 +0200
Introduce gb_Package_add_empty_directories
...which will be needed in a subsequent patch to fix tdf#125693.
The installer code could not handle a directory in a .filelist, the simplest
hack appears to be to add a special case for an empty source dir to
copy_one_file in solenv/bin/modules/installer/systemactions.pm.
Includes changes made by Stephan Bergmann <sbergman at redhat.com>.
Change-Id: I52dca2543a66eb76117598d77d559592e26ce859
Reviewed-on: https://gerrit.libreoffice.org/75702
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index 9b12ff63c271..4f7a18bba5e6 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -277,6 +277,16 @@ sub create_directories
# Copying one file
########################
+sub is_empty_dir
+{
+ my ($dir) = @_;
+ my ($handle, $count);
+ opendir($handle, $dir) or return 0;
+ $count = scalar(grep { $_ ne '.' && $_ ne '..' } readdir($handle));
+ closedir($handle);
+ return $count == 0;
+}
+
sub copy_one_file
{
my ($source, $dest) = @_;
@@ -286,6 +296,10 @@ sub copy_one_file
if ( -l $source ) {
$copyreturn = symlink(readlink("$source"), "$dest");
}
+ elsif (-d $source && is_empty_dir($source)) {
+ my $mode = (stat($source))[2] & 07777;
+ $copyreturn = mkdir($dest, $mode);
+ }
else {
$copyreturn = copy($source, $dest);
}
diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk
index b1f2c2f2cfe0..45a56ff44478 100644
--- a/solenv/gbuild/Package.mk
+++ b/solenv/gbuild/Package.mk
@@ -129,6 +129,26 @@ gb_Package_OUTDIR_$(1) := $(2)
endef
+# Add empty directory (if it's non-empty, don't use this, use
+# gb_Package_add_file for the files in it instead!)
+define gb_Package_add_empty_directory
+$(call gb_Package__check,$(1))
+$(if $(strip $(2)),,$(call gb_Output_error,gb_Package_add_directory requires 2 arguments))
+$(call gb_Package_get_target,$(1)) :| $$(gb_Package_OUTDIR_$(1))/$(2)/.dir
+gb_Package_$(1)_FILES += $$(gb_Package_OUTDIR_$(1))/$(2)
+$(call gb_Package_get_clean_target,$(1)) : FILES += $$(gb_Package_OUTDIR_$(1))/$(2)
+
+endef
+
+# Example:
+# $(eval $(call gb_Package_add_empty_directories,foo_inc,inc/foo))
+# # -> inc/foo
+define gb_Package_add_empty_directories
+$(call gb_Package__check,$(1))
+$(foreach file,$(2),$(call gb_Package_add_empty_directory,$(1),$(file)))
+
+endef
+
define gb_Package_add_symbolic_link
$(call gb_Package__check,$(1))
$(if $(strip $(3)),,$(call gb_Output_error,gb_Package_add_symbolic_link requires 3 arguments))
More information about the Libreoffice-commits
mailing list