Kaydet (Commit) baefe3a7 authored tarafından Michael Stahl's avatar Michael Stahl

gbuild: fix build of installation set with missing .ui translations

As demonstrated by commit b875362c,
scp2 will reference all languages' UIConfig zip file, but gbuild only
builds those that have existing input files from translations;
tweak UIConfig class to always build a zip file, and the Zip command to
work with no inputs as well, which requires a little hack.

Change-Id: If6dbb07aa856c94802b9abdcaa20ba03e59d37fa
üst 80583d1c
......@@ -225,6 +225,8 @@ $(call gb_Postprocess_register_target,AllUIConfigs,UIConfig,$(1))
endef
define gb_UIConfig__UIConfig_for_lang
$(call gb_UIConfig_get_target,$(1)) : $(call gb_Zip_get_target,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(2)))
$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_Zip_get_clean_target,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(2)))
$(call gb_Zip_Zip_internal,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(2)),$(gb_UILocalizeTarget_WORKDIR)/$(1))
$(call gb_Zip_add_commandoptions,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(2)),--suffixes .ui)
$(call gb_Zip_get_target,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(2))) : $(SRCDIR)/solenv/gbuild/UIConfig.mk
......@@ -258,8 +260,6 @@ endef
#
# gb_UIConfig__add_uifile_for_lang target file lang
define gb_UIConfig__add_uifile_for_lang
$(call gb_UIConfig_get_target,$(1)) : $(call gb_Zip_get_target,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(3)))
$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_Zip_get_clean_target,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(3)))
$(call gb_Zip_add_file,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(3)),$(notdir $(2))/$(3).ui)
$(call gb_Zip_add_dependency,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(3)),$(call gb_UILocalizeTarget_get_target,$(1)/$(notdir $(2))))
$(call gb_Zip_set_install_name,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(3)),$(INSTROOT)/$(gb_UIConfig_INSTDIR)/$(1)/ui/res/$(3).zip)
......
......@@ -40,16 +40,22 @@ $(dir $(call gb_Zip_get_target,%))%/.dir :
# rule to create zip package in workdir
# --filesync makes sure that all files in the zip package will be removed that no longer are in $(FILES)
# if there are no files, zip fails; copy empty zip file to target in that case
$(call gb_Zip_get_target,%) :
$(call gb_Output_announce,$*,$(true),ZIP,3)
$(if $(FILES),$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\
$(call gb_Helper_abbreviate_dirs,\
$(if $(FILES),\
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\
$(FILES)) && \
cd $(LOCATION) && cat $${RESPONSEFILE} | tr "[:space:]" "\n" | $(gb_Zip_ZIPCOMMAND) -@rX --filesync --must-match $(call gb_Zip_get_target,$*) && \
rm -f $${RESPONSEFILE} && \
touch $@ \
$(if $(INSTALL_NAME),&& cp $(call gb_Zip_get_target,$*) $(INSTALL_NAME)) \
))
cd $(LOCATION) && \
cat $${RESPONSEFILE} | tr "[:space:]" "\n" | \
$(gb_Zip_ZIPCOMMAND) -@rX --filesync --must-match \
$(call gb_Zip_get_target,$*) && \
rm -f $${RESPONSEFILE} && \
touch $@\
, cp $(SRCDIR)/solenv/gbuild/empty.zip $@)\
$(if $(INSTALL_NAME),&& cp $(call gb_Zip_get_target,$*) $(INSTALL_NAME)) \
)
# the preparation target is here to ensure proper ordering of actions in cases
# when we want to, e.g., create a zip from files created by a custom target
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment