[Libreoffice-commits] core.git: solenv/gbuild
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Oct 25 07:35:56 UTC 2018
solenv/gbuild/GeneratedPackage.mk | 45 ++++++++++++--------------------------
1 file changed, 15 insertions(+), 30 deletions(-)
New commits:
commit 808dcac5f733ab5addcec0d3b3dcf5637aebd352
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
AuthorDate: Wed Oct 24 15:27:53 2018 +0200
Commit: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Thu Oct 25 09:35:31 2018 +0200
avoid running into commandline length limits on win with all-lang help
also simplify the recipe by removing the one-time-use only calls to
helper commands
Unclear though why help adds the lang-dirs individually, as all come
from the same subdir and end up in the same target dir...
Change-Id: I489b1ac3f1312a565fb2a9cfc071d94201c74555
Reviewed-on: https://gerrit.libreoffice.org/62304
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/solenv/gbuild/GeneratedPackage.mk b/solenv/gbuild/GeneratedPackage.mk
index bd279b060f1c..25af209b857e 100644
--- a/solenv/gbuild/GeneratedPackage.mk
+++ b/solenv/gbuild/GeneratedPackage.mk
@@ -22,43 +22,28 @@
gb_GeneratedPackage__get_srcdir = $(lastword $(subst <>, ,$(1)))
gb_GeneratedPackage__get_destdir = $(firstword $(subst <>, ,$(1)))
-define gb_GeneratedPackage__command_cp
-mkdir -p $(dir $(2)) && \
-cp -R $(PACKAGE_SOURCEDIR)/$(1) $(2)
-endef
-
-define gb_GeneratedPackage__command
-$(call gb_Output_announce,$(2),$(true),GPK,2)
-$(call gb_Helper_abbreviate_dirs,\
- rm -rf $(foreach pair,$(PACKAGE_DIRS),$(call gb_GeneratedPackage__get_destdir,$(pair))) && \
- $(foreach pair,$(PACKAGE_DIRS),\
- $(call gb_GeneratedPackage__command_cp,$(call gb_GeneratedPackage__get_srcdir,$(pair)),$(call gb_GeneratedPackage__get_destdir,$(pair))) &&) \
- $(FIND) \
- $(foreach pair,$(PACKAGE_DIRS),$(call gb_GeneratedPackage__get_destdir,$(pair))) \
- \( -type f -o -type l \) -print \
- > $(1) \
-)
-endef
-
-define gb_GeneratedPackage__check_dirs
-$(if $(PACKAGE_DIRS),,$(call gb_Output_error,no dirs were added))
-$(foreach pair,$(PACKAGE_DIRS),\
- $(if $(wildcard $(PACKAGE_SOURCEDIR)/$(call gb_GeneratedPackage__get_srcdir,$(pair))),,\
- $(call gb_Output_error,source dir $(PACKAGE_SOURCEDIR)/$(call gb_GeneratedPackage__get_srcdir,$(pair)) does not exist) \
- ) \
-)
-
-endef
-
$(dir $(call gb_GeneratedPackage_get_target,%)).dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(dir $(call gb_GeneratedPackage_get_target,%))%.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+# require all added directories to exist
+$(call gb_GeneratedPackage_get_target,%) :| $(foreach pair,$(PACKAGE_DIRS),$(PACKAGE_SOURCEDIR)/$(call gb_GeneratedPackage__get_srcdir,$(pair)))
+
+# split in two commands to avoid running into commandline/environment size limits
+# on windows with all languages the processing of help can truncate the find command otherwise
$(call gb_GeneratedPackage_get_target,%) :
- $(call gb_GeneratedPackage__check_dirs,$*)
- $(call gb_GeneratedPackage__command,$@,$*)
+ $(call gb_Output_announce,$*,$(true),GPK,2)
+ $(if $(PACKAGE_DIRS),,$(call gb_Output_error,no dirs were added))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -rf $(foreach pair,$(PACKAGE_DIRS),$(call gb_GeneratedPackage__get_destdir,$(pair))) \
+ && mkdir -p $(foreach pair,$(PACKAGE_DIRS),$(dir $(call gb_GeneratedPackage__get_destdir,$(pair)))) \
+ $(foreach pair,$(PACKAGE_DIRS),&& cp -R $(PACKAGE_SOURCEDIR)/$(call gb_GeneratedPackage__get_srcdir,$(pair)) $(call gb_GeneratedPackage__get_destdir,$(pair))) \
+ )
+ $(call gb_Helper_abbreviate_dirs,\
+ $(FIND) $(foreach pair,$(PACKAGE_DIRS),$(call gb_GeneratedPackage__get_destdir,$(pair))) \( -type f -o -type l \) -print > $@ \
+ )
.PHONY : $(call gb_GeneratedPackage_get_clean_target,%)
$(call gb_GeneratedPackage_get_clean_target,%) :
More information about the Libreoffice-commits
mailing list