summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2013-12-03 08:19:36 +0100
committerAndras Timar <andras.timar@collabora.com>2013-12-09 12:50:10 +0100
commit7fe9808f009af2f0a4da58663eacd2caccdcaafe (patch)
tree9726e9637aa51d98c770bd6240ede9a151ee81b2 /solenv
parent830b42cba24db82105fc129bcf73f9d3920ff8d0 (diff)
Zip .ui translations per UIConfig target.
Fix installer / scp2 to not ignore directory prefix in 'Name'. Change-Id: Ib319363c8be73a72029f1ba3833e518e15c55e29 Reviewed-on: https://gerrit.libreoffice.org/6915 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/modules/installer/scriptitems.pm2
-rw-r--r--solenv/gbuild/UIConfig.mk30
-rw-r--r--solenv/gbuild/Zip.mk29
3 files changed, 41 insertions, 20 deletions
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
index fe767f71c712..be1123d658cf 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -874,7 +874,7 @@ sub get_Destination_Directory_For_Item_From_Directorylist # this is used f
elsif ((!( $ispredefinedprogdir )) && (!( $ispredefinedconfigdir )))
{
my $directorynameref = get_Directoryname_From_Directorygid($dirsarrayref, $searchdirgid, $onelanguage, $oneitemgid);
- $destfilename = $$directorynameref . $installer::globals::separator . $oneitemname;
+ $destfilename = $$directorynameref . $installer::globals::separator . $oneitem->{'Name'};
}
else
{
diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk
index 657d3625720a..14d05c6e77d5 100644
--- a/solenv/gbuild/UIConfig.mk
+++ b/solenv/gbuild/UIConfig.mk
@@ -61,17 +61,17 @@ $(call gb_UILocalizeTarget_get_clean_target,%) :
#
# gb_UILocalizeTarget_UILocalizeTarget target
define gb_UILocalizeTarget_UILocalizeTarget
-$(call gb_UILocalizeTarget__UILocalizeTarget_impl,$(1),$(wildcard $(foreach lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(dir $(1))).po)))
+$(call gb_UILocalizeTarget__UILocalizeTarget_impl,$(1),$(2),$(wildcard $(foreach lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(dir $(2))).po)))
endef
# gb_UILocalizeTarget__UILocalizeTarget_impl target pofiles
define gb_UILocalizeTarget__UILocalizeTarget_impl
-$(call gb_UILocalizeTarget_get_target,$(1)) : POFILES := $(2)
-$(call gb_UILocalizeTarget_get_target,$(1)) : UIConfig_FILE := $(SRCDIR)/$(1).ui
+$(call gb_UILocalizeTarget_get_target,$(1)) : POFILES := $(3)
+$(call gb_UILocalizeTarget_get_target,$(1)) : UIConfig_FILE := $(SRCDIR)/$(2).ui
-$(call gb_UILocalizeTarget_get_target,$(1)) : $(2)
-$(call gb_UILocalizeTarget_get_target,$(1)) : $(SRCDIR)/$(1).ui
+$(call gb_UILocalizeTarget_get_target,$(1)) : $(3)
+$(call gb_UILocalizeTarget_get_target,$(1)) : $(SRCDIR)/$(2).ui
$(call gb_UILocalizeTarget_get_target,$(1)) :| \
$(dir $(call gb_UILocalizeTarget_get_target,$(1))).dir \
$(call gb_UILocalizeTarget_get_workdir,$(1))/.dir
@@ -196,8 +196,8 @@ $(call gb_UIConfig_get_clean_target,%) :
)
gb_UIConfig_get_packagename = UIConfig/$(1)
-gb_UIConfig_get_packagename_for_lang = UIConfig/$(1)_$(2)
gb_UIConfig_get_packagesetname = UIConfig/$(1)
+gb_UIConfig_get_zipname_for_lang = UIConfig/$(1)/$(2)
# Processes and delivers a set of UI configuration files.
#
@@ -227,9 +227,8 @@ $(call gb_Postprocess_register_target,AllUIConfigs,UIConfig,$(1))
endef
define gb_UIConfig__UIConfig_for_lang
-$(call gb_Package_Package_internal,$(call gb_UIConfig_get_packagename_for_lang,$(1),$(2)),$(gb_UILocalizeTarget_WORKDIR))
-$(call gb_UIConfig_get_target,$(1)) : $(call gb_Package_get_target,$(call gb_UIConfig_get_packagename_for_lang,$(1),$(2)))
-$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(call gb_UIConfig_get_packagename_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_get_target,$(call gb_UIConfig_get_zipname_for_lang,$(1),$(2))) : $(SRCDIR)/solenv/gbuild/UIConfig.mk
endef
@@ -260,8 +259,11 @@ endef
#
# gb_UIConfig__add_uifile_for_lang target file lang
define gb_UIConfig__add_uifile_for_lang
-$(call gb_UIConfig__package_uifile,$(1),$(call gb_UIConfig_get_packagename_for_lang,$(1),$(3)),res/$(3)/$(notdir $(2)),$(2)/$(3).ui)
-$(call gb_Package_SOURCEDIR_$(call gb_UIConfig_get_packagename_for_lang,$(1),$(3)))/$(2)/$(3).ui : $(call gb_UILocalizeTarget_get_target,$(2))
+$(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)
endef
@@ -278,9 +280,9 @@ endef
# gb_UIConfig__add_translations_impl target uifile langs
define gb_UIConfig__add_translations_impl
-$(call gb_UILocalizeTarget_UILocalizeTarget,$(2))
-$(call gb_UIConfig_get_target,$(1)) : $(call gb_UILocalizeTarget_get_target,$(2))
-$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UILocalizeTarget_get_clean_target,$(2))
+$(call gb_UILocalizeTarget_UILocalizeTarget,$(1)/$(notdir $(2)),$(2))
+$(call gb_UIConfig_get_target,$(1)) : $(call gb_UILocalizeTarget_get_target,$(1)/$(notdir $(2)))
+$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UILocalizeTarget_get_clean_target,$(1)/$(notdir $(2)))
$(foreach lang,$(3),$(call gb_UIConfig__add_uifile_for_real_lang,$(1),$(2),$(lang)))
endef
diff --git a/solenv/gbuild/Zip.mk b/solenv/gbuild/Zip.mk
index ae21f7f4cd7e..a675766bb10b 100644
--- a/solenv/gbuild/Zip.mk
+++ b/solenv/gbuild/Zip.mk
@@ -28,25 +28,33 @@ $(call gb_Zip_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),ZIP,3)
$(call gb_Helper_abbreviate_dirs,\
$(if $(CLEAR_LOCATION),rm -rf $(gb_Package_Location_$*) &&) \
+ $(if $(INSTALL_NAME),rm -f $(INSTALL_NAME) &&) \
rm -f $(call gb_Zip_get_target,$*) && \
rm -f $(call gb_Zip__get_preparation_target,$*))
+$(dir $(call gb_Zip_get_target,%)).dir :
+ $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(dir $(call gb_Zip_get_target,%))%/.dir :
+ $(if $(wildcard $(dir $@)),,mkdir -p $(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)
$(call gb_Zip_get_target,%) :
$(call gb_Output_announce,$*,$(true),ZIP,3)
- $(call gb_Helper_abbreviate_dirs,\
+ $(if $(FILES),$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\
$(FILES)) && \
- mkdir -p $(dir $(call gb_Zip_get_target,$*)) && \
cd $(LOCATION) && cat $${RESPONSEFILE} | tr "[:space:]" "\n" | $(gb_Zip_ZIPCOMMAND) -@rX --filesync --must-match $(call gb_Zip_get_target,$*) && \
- rm -f $${RESPONSEFILE} )
+ rm -f $${RESPONSEFILE} && \
+ touch $@ \
+ $(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
$(call gb_Zip__get_preparation_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && touch $@)
+ touch $@
# clear file list, set location (zipping uses relative paths)
# register target and clean target
@@ -57,8 +65,12 @@ $(call gb_Zip__get_preparation_target,%) :
# the location can't be stored in a scoped variable as it is needed in the add_file macro (see rule above)
define gb_Zip_Zip_internal_nodeliver
$(call gb_Zip_get_target,$(1)) : FILES :=
+$(call gb_Zip_get_target,$(1)) : INSTALL_NAME :=
$(call gb_Zip_get_target,$(1)) : LOCATION := $(2)
+$(call gb_Zip_get_target,$(1)) :| $(dir $(call gb_Zip_get_target,$(1))).dir
+$(call gb_Zip__get_preparation_target,$(1)) :| $(dir $(call gb_Zip__get_preparation_target,$(1))).dir
$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION :=
+$(call gb_Zip_get_clean_target,$(1)) : INSTALL_NAME :=
$(eval gb_Package_Location_$(1) := $(2))
endef
@@ -118,6 +130,13 @@ $(call gb_Zip_get_target,$(1)) : gb_Zip_ZIPCOMMAND += $(2)
endef
+define gb_Zip_set_install_name
+$(call gb_Zip_get_target,$(1)) : INSTALL_NAME := $(2)
+$(call gb_Zip_get_target,$(1)) :| $(dir $(2)).dir
+$(call gb_Zip_get_clean_target,$(1)) : INSTALL_NAME := $(2)
+
+endef
+
define gb_Zip_use_unpacked
$(call gb_Zip__get_preparation_target,$(1)) \
:| $(call gb_UnpackedTarball_get_final_target,$(2))