From 87dd1780a31de9ea1df70a8511c262ff252bf99a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Dec 2013 12:29:11 +0100 Subject: [PATCH] Get rid of $(share_subdir_name) again Quoting 56211a166ab25d80de84c2cccce22be15a9be051 "fdo#72394 Don't endlessly expand $(share_subdir_name) into itself": * The compile-time variable LIBO_SHARE_FOLDER should not end up as a runtime framework path variable, esp. since accidentally re-substituting it for "share" segments in unrelated URLs like does not make sense. ac4e19f9085dbd0103c7336a5318aa1e55b3e3e0 "fdo#68552: Don't (attempt to) do run-time expansion of build-time parameters" had already attempted a fix for that, but it had to be reverted again with 791a8b96f754798192875da287c84f8cfa4e533e because it "Unfortunately does not work if BUILDDIR is different from SRCDIR." So this time fix it not via configure-expanded *.in files, but via xsltproc (for officecfg/registry/ files) and sed (for wizards/soruce/configshare files). The changes to officecfg/util/alllang.xsl will replace @LIBO_SHARE_FOLDER@ only in oor:name attribues (and in text), not in any other attributes, because I have no idea how to write that generically in XSLT and it happens to be only needed in oor:name for now. Change-Id: Iec78eb70dcbf1a5bbabf4e42f21c44dc65c3e438 --- framework/inc/services/substitutepathvars.hxx | 1 - .../source/services/substitutepathvars.cxx | 9 +-- .../data/org/openoffice/Office/Paths.xcu | 24 ++++---- .../data/org/openoffice/Office/WebWizard.xcu | 4 +- .../schema/org/openoffice/Office/Common.xcs | 42 +++++++------- officecfg/util/alllang.xsl | 55 +++++++++++++++++-- officecfg/util/schema_trim.xsl | 40 +++++++++++++- solenv/gbuild/Configuration.mk | 4 ++ wizards/CustomTarget_share.mk | 25 +++++++++ wizards/Module_wizards.mk | 1 + wizards/Package_share.mk | 2 +- wizards/source/configshare/dialog.xlc | 18 +++--- wizards/source/configshare/script.xlc | 18 +++--- 13 files changed, 174 insertions(+), 69 deletions(-) create mode 100644 wizards/CustomTarget_share.mk diff --git a/framework/inc/services/substitutepathvars.hxx b/framework/inc/services/substitutepathvars.hxx index ba0e34b37a82..cda8321bbe67 100644 --- a/framework/inc/services/substitutepathvars.hxx +++ b/framework/inc/services/substitutepathvars.hxx @@ -177,7 +177,6 @@ enum PreDefVariable PREDEFVAR_BASEINSTURL, PREDEFVAR_USERDATAURL, PREDEFVAR_BRANDBASEURL, - PREDEFVAR_SHARE_SUBDIR_NAME, PREDEFVAR_COUNT }; diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index ac2dc08784df..1be48e8e4f1d 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -104,7 +104,6 @@ #define VARIABLE_BASEINSTURL "$(baseinsturl)" #define VARIABLE_USERDATAURL "$(userdataurl)" #define VARIABLE_BRANDBASEURL "$(brandbaseurl)" -#define VARIABLE_SHARE_SUBDIR_NAME "$(share_subdir_name)" using namespace com::sun::star::uno; using namespace com::sun::star::beans; @@ -194,8 +193,7 @@ static const FixedVariable aFixedVarTable[] = // New variable of hierachy service (#i32656#) { VARIABLE_BASEINSTURL, PREDEFVAR_BASEINSTURL, REPLACELENGTH_BASEINSTURL,true }, { VARIABLE_USERDATAURL, PREDEFVAR_USERDATAURL, REPLACELENGTH_USERDATAURL,true }, - { VARIABLE_BRANDBASEURL,PREDEFVAR_BRANDBASEURL, RTL_CONSTASCII_LENGTH(VARIABLE_BRANDBASEURL), true }, - { VARIABLE_SHARE_SUBDIR_NAME,PREDEFVAR_SHARE_SUBDIR_NAME, RTL_CONSTASCII_LENGTH(VARIABLE_SHARE_SUBDIR_NAME), false } + { VARIABLE_BRANDBASEURL,PREDEFVAR_BRANDBASEURL, RTL_CONSTASCII_LENGTH(VARIABLE_BRANDBASEURL), true } }; //_________________________________________________________________________________________________________________ @@ -992,8 +990,7 @@ throw ( RuntimeException ) bool bMatch = true; if ( pIterFixed->eVariable == PREDEFVAR_LANG || pIterFixed->eVariable == PREDEFVAR_LANGID || - pIterFixed->eVariable == PREDEFVAR_VLANG || - pIterFixed->eVariable == PREDEFVAR_SHARE_SUBDIR_NAME ) + pIterFixed->eVariable == PREDEFVAR_VLANG ) { // Special path variables as they can occur in the middle of a path. Only match if they // describe a whole directory and not only a substring of a directory! @@ -1111,8 +1108,6 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable rtl::Bootstrap::expandMacros( aPreDefPathVariables.m_FixedVar[PREDEFVAR_BRANDBASEURL]); - aPreDefPathVariables.m_FixedVar[PREDEFVAR_SHARE_SUBDIR_NAME] = rtl::OUString(LIBO_SHARE_FOLDER); - // Get inspath and userpath from bootstrap mechanism in every case as file URL ::utl::Bootstrap::PathStatus aState; OUString sVal ; diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu index ace000205363..4b5ec7dd2f8f 100644 --- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu @@ -26,7 +26,7 @@ - + $(userurl)/autocorr @@ -34,7 +34,7 @@ - + $(userurl)/autotext @@ -52,7 +52,7 @@ - + $(userurl)/basic @@ -60,12 +60,12 @@ - + - + @@ -80,7 +80,7 @@ - + $(userurl)/gallery @@ -103,8 +103,8 @@ - - + + $(userurl)/wordbook @@ -112,7 +112,7 @@ - + $(userurl)/wordbook @@ -135,7 +135,7 @@ - + @@ -158,7 +158,7 @@ - + $(userurl)/template @@ -166,7 +166,7 @@ - + diff --git a/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu b/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu index 70f0f097d9f2..3861af800175 100644 --- a/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu +++ b/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu @@ -1241,12 +1241,12 @@ - $(inst)/$(share_subdir_name)/gallery/www-back/ + $(inst)/@LIBO_SHARE_FOLDER@/gallery/www-back/ - $(inst)/$(share_subdir_name)/gallery/surface + $(inst)/@LIBO_SHARE_FOLDER@/gallery/surface diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 1c9081b51c14..069a12870ebe 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -1529,7 +1529,7 @@ Specifies the settings of the AutoCorrect dialog. - $(insturl)/$(share_subdir_name)/autocorr + $(insturl)/@LIBO_SHARE_FOLDER@/autocorr $(userurl)/autocorr @@ -1539,7 +1539,7 @@ modules. - $(insturl)/$(share_subdir_name)/autotext/$(vlang) + $(insturl)/@LIBO_SHARE_FOLDER@/autotext/$(vlang) $(userurl)/autotext @@ -1555,7 +1555,7 @@ AutoPilots. - $(insturl)/$(share_subdir_name)/basic + $(insturl)/@LIBO_SHARE_FOLDER@/basic $(userurl)/basic @@ -1564,20 +1564,20 @@ Contains the bitmap files which can be used for menu and toolbar icons. - $(insturl)/$(share_subdir_name)/config/symbol + $(insturl)/@LIBO_SHARE_FOLDER@/config/symbol Contains the configuration files. This value cannot be changed through the user interface. - $(insturl)/$(share_subdir_name)/config + $(insturl)/@LIBO_SHARE_FOLDER@/config Contains the provided dictionaries. - $(insturl)/$(share_subdir_name)/wordbook + $(insturl)/@LIBO_SHARE_FOLDER@/wordbook @@ -1598,7 +1598,7 @@ and multimedia files. - $(insturl)/$(share_subdir_name)/gallery + $(insturl)/@LIBO_SHARE_FOLDER@/gallery $(userurl)/gallery @@ -1620,7 +1620,7 @@ Contains the files that are necessary for the spellcheck. - $(insturl)/$(share_subdir_name)/dict + $(insturl)/@LIBO_SHARE_FOLDER@/dict @@ -1665,8 +1665,8 @@ sub-folders. - $(insturl)/$(share_subdir_name)/template/$(vlang) - $(insturl)/$(share_subdir_name)/template/common + $(insturl)/@LIBO_SHARE_FOLDER@/template/$(vlang) + $(insturl)/@LIBO_SHARE_FOLDER@/template/common $(userurl)/template @@ -1677,7 +1677,7 @@ merged from UserConfig and from these folders. - $(insturl)/$(share_subdir_name)/config + $(insturl)/@LIBO_SHARE_FOLDER@/config @@ -1720,7 +1720,7 @@ AutoCorrect dialog. - $(insturl)/$(share_subdir_name)/autocorr + $(insturl)/@LIBO_SHARE_FOLDER@/autocorr $(userurl)/autocorr @@ -1730,7 +1730,7 @@ located. - $(insturl)/$(share_subdir_name)/autotext/$(vlang) + $(insturl)/@LIBO_SHARE_FOLDER@/autotext/$(vlang) $(userurl)/autotext @@ -1747,7 +1747,7 @@ the AutoPilots, are located. - $(insturl)/$(share_subdir_name)/basic + $(insturl)/@LIBO_SHARE_FOLDER@/basic $(userurl)/basic @@ -1756,21 +1756,21 @@ Specifies the default directory where the bitmap files, which can be used for the menu and toolbar icons, are located. - $(insturl)/$(share_subdir_name)/config/symbol + $(insturl)/@LIBO_SHARE_FOLDER@/config/symbol Specifies the default directory where the configuration files are stored. - $(insturl)/$(share_subdir_name)/config + $(insturl)/@LIBO_SHARE_FOLDER@/config Specifies the default directory where the provided dictionaries are located. - $(insturl)/$(share_subdir_name)/wordbook/$(vlang) + $(insturl)/@LIBO_SHARE_FOLDER@/wordbook/$(vlang) @@ -1792,7 +1792,7 @@ multimedia files are located. - $(insturl)/$(share_subdir_name)/gallery + $(insturl)/@LIBO_SHARE_FOLDER@/gallery $(userurl)/gallery @@ -1815,7 +1815,7 @@ Specifies the default directory where the files that are necessary for the spellcheck are saved. - $(insturl)/$(share_subdir_name)/dict + $(insturl)/@LIBO_SHARE_FOLDER@/dict @@ -1853,8 +1853,8 @@ are located in folders and sub-folders. - $(insturl)/$(share_subdir_name)/template/$(vlang) - $(insturl)/$(share_subdir_name)/template/common + $(insturl)/@LIBO_SHARE_FOLDER@/template/$(vlang) + $(insturl)/@LIBO_SHARE_FOLDER@/template/common $(userurl)/template diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl index 252a0beefe66..31b53bccd853 100644 --- a/officecfg/util/alllang.xsl +++ b/officecfg/util/alllang.xsl @@ -34,6 +34,8 @@ . en-US + + @@ -91,7 +93,7 @@ - + @@ -265,8 +267,7 @@ - - + @@ -275,12 +276,17 @@ - - + + + + + + + @@ -333,4 +339,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/officecfg/util/schema_trim.xsl b/officecfg/util/schema_trim.xsl index 4f75348b2ecb..79b3c5c8cb4f 100644 --- a/officecfg/util/schema_trim.xsl +++ b/officecfg/util/schema_trim.xsl @@ -23,6 +23,8 @@ xmlns:oor="http://openoffice.org/2001/registry" version="1.0"> + + @@ -68,9 +70,43 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solenv/gbuild/Configuration.mk b/solenv/gbuild/Configuration.mk index ae671b7ac3a8..06aa8a174816 100644 --- a/solenv/gbuild/Configuration.mk +++ b/solenv/gbuild/Configuration.mk @@ -84,6 +84,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(3) && \ $(gb_Configuration_XSLTCOMMAND) --nonet \ -o $(1) \ + --stringparam LIBO_SHARE_FOLDER $(LIBO_SHARE_FOLDER) \ $(gb_XcsTarget_XSLT_SchemaTrim) \ $(3)) endef @@ -120,6 +121,7 @@ $(call gb_Helper_abbreviate_dirs,\ -o $(1) \ --stringparam xcs $(call gb_XcsTarget_for_XcuTarget,$(XCUFILE)) \ $(gb_Configuration__stringparam_schemaRoot) \ + --stringparam LIBO_SHARE_FOLDER $(LIBO_SHARE_FOLDER) \ --path $(SRCDIR)/officecfg/registry \ $(gb_XcuTarget_XSLT_AllLang) \ $(3)) @@ -155,6 +157,7 @@ $(call gb_Helper_abbreviate_dirs,\ --stringparam xcs $(4) \ $(gb_Configuration__stringparam_schemaRoot) \ --stringparam module $(notdir $(subst -,/,$(basename $(notdir $(2))))) \ + --stringparam LIBO_SHARE_FOLDER $(LIBO_SHARE_FOLDER) \ $(gb_XcuTarget_XSLT_AllLang) \ $(3)) endef @@ -251,6 +254,7 @@ $(call gb_Helper_abbreviate_dirs,\ --stringparam xcs $(call gb_XcsTarget_for_XcuTarget,$(XCUFILE)) \ $(gb_Configuration__stringparam_schemaRoot) \ --stringparam locale $(word 2,$(subst /, ,$(2))) \ + --stringparam LIBO_SHARE_FOLDER $(LIBO_SHARE_FOLDER) \ --path $(SRCDIR)/officecfg/registry \ $(gb_XcuTarget_XSLT_AllLang) \ $(3)) diff --git a/wizards/CustomTarget_share.mk b/wizards/CustomTarget_share.mk new file mode 100644 index 000000000000..43d1811d7a13 --- /dev/null +++ b/wizards/CustomTarget_share.mk @@ -0,0 +1,25 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CustomTarget_CustomTarget,wizards/share)) + +$(call gb_CustomTarget_get_target,wizards/share): \ + $(call gb_CustomTarget_get_workdir,wizards/share)/dialog.xlc \ + $(call gb_CustomTarget_get_workdir,wizards/share)/script.xlc + +$(call gb_CustomTarget_get_workdir,wizards/share)/%.xlc: \ + $(SRCDIR)/wizards/source/configshare/%.xlc \ + | $(call gb_CustomTarget_get_workdir,wizards/share)/.dir + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1) + sed -e 's/@LIBO_SHARE_FOLDER@/$(LIBO_SHARE_FOLDER)/' $< > $@ + +# vim:set shiftwidth=4 tabstop=4 noexpandtab: + + +# vim: set noet sw=4 ts=4: diff --git a/wizards/Module_wizards.mk b/wizards/Module_wizards.mk index 652033de0a33..a67109cbcafd 100644 --- a/wizards/Module_wizards.mk +++ b/wizards/Module_wizards.mk @@ -20,6 +20,7 @@ $(eval $(call gb_Module_Module,wizards)) $(eval $(call gb_Module_add_targets,wizards,\ + CustomTarget_share \ Package_access2base \ Package_depot \ Package_euro \ diff --git a/wizards/Package_share.mk b/wizards/Package_share.mk index b24affad3720..b986041e04ea 100644 --- a/wizards/Package_share.mk +++ b/wizards/Package_share.mk @@ -17,7 +17,7 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # -$(eval $(call gb_Package_Package,wizards_basicshare,$(SRCDIR)/wizards/source/configshare)) +$(eval $(call gb_Package_Package,wizards_basicshare,$(call gb_CustomTarget_get_workdir,wizards/share))) $(eval $(call gb_Package_add_files,wizards_basicshare,$(LIBO_SHARE_FOLDER)/basic,\ dialog.xlc \ diff --git a/wizards/source/configshare/dialog.xlc b/wizards/source/configshare/dialog.xlc index 0bcbe9da27a2..89647f648b69 100644 --- a/wizards/source/configshare/dialog.xlc +++ b/wizards/source/configshare/dialog.xlc @@ -1,13 +1,13 @@ - - - - - - - - - + + + + + + + + + diff --git a/wizards/source/configshare/script.xlc b/wizards/source/configshare/script.xlc index d42fa2e2533a..69dbb2832db3 100644 --- a/wizards/source/configshare/script.xlc +++ b/wizards/source/configshare/script.xlc @@ -1,13 +1,13 @@ - - - - - - - - - + + + + + + + + +