From 1aa5d1723c82637df4f86e817d5a523d53aa9df1 Mon Sep 17 00:00:00 2001 From: asv Date: Tue, 27 Jun 2006 07:39:03 +0000 Subject: [PATCH] Fix to bug PAL10465. Modification of resource files location in "build" and "installation" directories. Now resource files are placed in share/salome/resources/. Various configuration files (configure.in.base, make_module/conclude/commence, etc.) are changed. --- DEPRECATED/configure.in.base | 7 ++- bin/appli_install.sh | 3 +- bin/appliskel/README | 2 +- bin/appliskel/SalomeApp.xml | 44 +++++++++---------- bin/appliskel/env.d/envSalome.sh | 3 +- bin/launchConfigureParser.py | 8 +--- bin/runSalome.py | 26 +++++------ configure.ac | 4 ++ doc/SALOME_Application.txt | 2 +- doc/salome/version.texi | 4 +- salome_adm/unix/DEPRECATED/make_commence.in | 1 + salome_adm/unix/DEPRECATED/make_conclude.in | 24 +++++----- salome_adm/unix/DEPRECATED/make_module.in | 14 +++--- salome_adm/unix/make_common_starter.am | 2 +- .../SALOME_ResourcesManager.cxx | 4 +- src/SALOMEDS/Test/SALOMEDSTest.cxx | 2 +- src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx | 2 +- 17 files changed, 77 insertions(+), 75 deletions(-) diff --git a/DEPRECATED/configure.in.base b/DEPRECATED/configure.in.base index 1567a6394..6a42ccbcb 100644 --- a/DEPRECATED/configure.in.base +++ b/DEPRECATED/configure.in.base @@ -27,6 +27,10 @@ AC_SUBST(VERSION) XVERSION=0x030200 AC_SUBST(XVERSION) +# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) +MODULE_NAME=kernel +AC_SUBST(MODULE_NAME) + dnl dnl Initialize source and build root directories dnl @@ -412,8 +416,7 @@ else fi # make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl -do +for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl # if test ! -d $rep ; then # eval mkdir $rep # fi diff --git a/bin/appli_install.sh b/bin/appli_install.sh index 3e7c53f70..37da0092e 100644 --- a/bin/appli_install.sh +++ b/bin/appli_install.sh @@ -78,8 +78,7 @@ echo "export PYHELLO_ROOT_DIR=$APPLI_ROOT" >> env.d/configSalome.sh # --- GUI config -echo "export config_var=$APPLI_ROOT:$APPLI_ROOT/share/salome/resources" >> env.d/configGUI.sh -echo "export SUITRoot=$APPLI_ROOT/share/salome" >> env.d/configGUI.sh +echo "export config_var=$APPLI_ROOT:$APPLI_ROOT/share/salome/resources/gui" >> env.d/configGUI.sh # --- SAMPLES directory diff --git a/bin/appliskel/README b/bin/appliskel/README index f3f283cb8..644da2122 100644 --- a/bin/appliskel/README +++ b/bin/appliskel/README @@ -90,7 +90,7 @@ CatalogRessources.xml SalomeApp.xml This file is similar to the default given - in ${GUI_ROOT_DIR}/share/salome/resources + in ${GUI_ROOT_DIR}/share/salome/resources/gui Proposal for env.d scripts diff --git a/bin/appliskel/SalomeApp.xml b/bin/appliskel/SalomeApp.xml index 6897b7136..7caea4e03 100644 --- a/bin/appliskel/SalomeApp.xml +++ b/bin/appliskel/SalomeApp.xml @@ -26,28 +26,28 @@
- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
diff --git a/bin/appliskel/env.d/envSalome.sh b/bin/appliskel/env.d/envSalome.sh index 5a6c6c48e..ca620c35e 100644 --- a/bin/appliskel/env.d/envSalome.sh +++ b/bin/appliskel/env.d/envSalome.sh @@ -29,9 +29,8 @@ REPINST=/home/prascle/SALOME2/Install export KERNEL_ROOT_DIR=${REPINST}/KERNEL_V301 export GUI_ROOT_DIR=${REPINST}/GUI_V301 -#export SalomeAppConfig=${GUI_ROOT_DIR}/share/salome/resources +#export SalomeAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui export SalomeAppConfig=${HOME}/${APPLI} -export SUITRoot=${GUI_ROOT_DIR}/share/salome export GEOM_ROOT_DIR=${REPINST}/GEOM_V301 export MED_ROOT_DIR=${REPINST}/MED_V301 diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index f4bea5ff0..4379642a8 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -227,14 +227,10 @@ class xml_parser: config_var = appname+'Config' # set resources variables if not yet set if os.getenv("GUI_ROOT_DIR"): - if not os.getenv("SUITRoot"): - os.environ["SUITRoot"] = os.getenv("GUI_ROOT_DIR") + "/share/salome" if not os.getenv(config_var): - os.environ[config_var] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources" + os.environ[config_var] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui" pass else : - if not os.getenv("SUITRoot"): - os.environ["SUITRoot"] = "" if not os.getenv(config_var): os.environ[config_var] = "" @@ -441,5 +437,5 @@ if 't' in cmd_opts: dirs = re.split('[;|:]', os.environ[config_var] ) for m in args[modules_nam]: if m not in ["KERNEL", "GUI", ""] and os.getenv("%s_ROOT_DIR"%m): - dirs.append( os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources" ) + dirs.append( os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources/" + m.lower() ) os.environ[config_var] = ":".join(dirs) diff --git a/bin/runSalome.py b/bin/runSalome.py index 9f0732b9c..2c2c9fc02 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -24,7 +24,7 @@ import orbmodule process_id = {} -# salome_subdir variable is used for composing paths like $KERNEL_ROOT_DIR/share/salome/resources, etc. +# salome_subdir variable is used for composing paths like $KERNEL_ROOT_DIR/share/salome/resources/kernel, etc. # before moving to SUIT-based gui, instead of salome_subdir there was args['appname'] used. # but after - 'appname' = "SalomeApp", so using it in making the subdirectory is an error. salome_subdir = "salome" @@ -172,7 +172,7 @@ def set_env(args, modules_list, modules_root_dir): os.environ["SMESH_MeshersList"]="StdMeshers" if not os.environ.has_key("SALOME_StdMeshersResources"): os.environ["SALOME_StdMeshersResources"] \ - = modules_root_dir["SMESH"]+"/share/"+args["appname"]+"/resources" + = modules_root_dir["SMESH"]+"/share/"+args["appname"]+"/resources/smesh" pass if args.has_key("SMESH_plugins"): for plugin in args["SMESH_plugins"]: @@ -190,7 +190,7 @@ def set_env(args, modules_list, modules_root_dir): = os.environ["SMESH_MeshersList"]+":"+plugin if not os.environ.has_key("SALOME_"+plugin+"Resources"): os.environ["SALOME_"+plugin+"Resources"] \ - = plugin_root+"/share/"+args["appname"]+"/resources" + = plugin_root+"/share/"+args["appname"]+"/resources/"+plugin.lower() add_path(os.path.join(plugin_root,"lib",python_version, "site-packages",salome_subdir), "PYTHONPATH") @@ -210,28 +210,27 @@ def set_env(args, modules_list, modules_root_dir): # set resources variables if not yet set # Done now by launchConfigureParser.py #if os.getenv("GUI_ROOT_DIR"): - #if not os.getenv("SUITRoot"): os.environ["SUITRoot"] = os.getenv("GUI_ROOT_DIR") + "/share/salome" - #if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources" + #if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui" # set CSF_PluginDefaults variable only if it is not customized # by the user if not os.getenv("CSF_PluginDefaults"): os.environ["CSF_PluginDefaults"] \ = os.path.join(modules_root_dir["KERNEL"],"share", - salome_subdir,"resources") + salome_subdir,"resources","kernel") os.environ["CSF_SALOMEDS_ResourcesDefaults"] \ = os.path.join(modules_root_dir["KERNEL"],"share", - salome_subdir,"resources") + salome_subdir,"resources","kernel") if "GEOM" in modules_list: print "GEOM OCAF Resources" os.environ["CSF_GEOMDS_ResourcesDefaults"] \ = os.path.join(modules_root_dir["GEOM"],"share", - salome_subdir,"resources") + salome_subdir,"resources","geom") print "GEOM Shape Healing Resources" os.environ["CSF_ShHealingDefaults"] \ = os.path.join(modules_root_dir["GEOM"],"share", - salome_subdir,"resources") + salome_subdir,"resources","geom") # ----------------------------------------------------------------------------- @@ -357,7 +356,8 @@ class CatalogServer(Server): cata_path.extend( glob.glob(os.path.join(module_root_dir, "share",salome_subdir, - "resources",module_cata))) + "resources",module.lower(), + module_cata))) pass pass self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 @@ -470,7 +470,7 @@ class SessionServer(Server): cata_path.extend( glob.glob(os.path.join(module_root_dir,"share", salome_subdir,"resources", - module_cata))) + module.lower(),module_cata))) if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 else: @@ -511,7 +511,7 @@ class ContainerManagerServer(Server): cata_path.extend( glob.glob(os.path.join(module_root_dir,"share", self.args['appname'],"resources", - module_cata))) + module.lower(),module_cata))) pass pass if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): @@ -526,7 +526,7 @@ class NotifyServer(Server): self.modules_root_dir=modules_root_dir myLogName = os.environ["LOGNAME"] self.CMD=['notifd','-c', - self.modules_root_dir["KERNEL"] +'/share/salome/resources/channel.cfg', + self.modules_root_dir["KERNEL"] +'/share/salome/resources/kernel/channel.cfg', '-DFactoryIORFileName=/tmp/'+myLogName+'_rdifact.ior', '-DChannelIORFileName=/tmp/'+myLogName+'_rdichan.ior', '-DReportLogFile=/tmp/'+myLogName+'_notifd.report', diff --git a/configure.ac b/configure.ac index 0161290f1..6fe4e801f 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,10 @@ XVERSION=0x030200 AC_SUBST(VERSION) AC_SUBST(XVERSION) +# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) +MODULE_NAME=kernel +AC_SUBST(MODULE_NAME) + echo echo --------------------------------------------- echo Initialize source and build root directories diff --git a/doc/SALOME_Application.txt b/doc/SALOME_Application.txt index 736f50add..ab6c52b96 100644 --- a/doc/SALOME_Application.txt +++ b/doc/SALOME_Application.txt @@ -180,7 +180,7 @@ Other configuration files SalomeApp.xml This file is similar to the default given - in ${GUI_ROOT_DIR}/share/salome/resources + in ${GUI_ROOT_DIR}/share/salome/resources/gui CatalogRessources.xml diff --git a/doc/salome/version.texi b/doc/salome/version.texi index f9a81011e..b78723440 100644 --- a/doc/salome/version.texi +++ b/doc/salome/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 31 May 2006 -@set UPDATED-MONTH May 2006 +@set UPDATED 2 June 2006 +@set UPDATED-MONTH June 2006 @set EDITION 3.2.0 @set VERSION 3.2.0 diff --git a/salome_adm/unix/DEPRECATED/make_commence.in b/salome_adm/unix/DEPRECATED/make_commence.in index 55199bf36..7b0ac2043 100644 --- a/salome_adm/unix/DEPRECATED/make_commence.in +++ b/salome_adm/unix/DEPRECATED/make_commence.in @@ -9,6 +9,7 @@ SHELL=@SHELL@ HAVE_SSTREAM=@HAVE_SSTREAM@ +MODULE_NAME=@MODULE_NAME@ LIBS=@LIBS@ LIBSFORBIN=@LIBS@ diff --git a/salome_adm/unix/DEPRECATED/make_conclude.in b/salome_adm/unix/DEPRECATED/make_conclude.in index 9583f49d4..7a75995dc 100644 --- a/salome_adm/unix/DEPRECATED/make_conclude.in +++ b/salome_adm/unix/DEPRECATED/make_conclude.in @@ -164,11 +164,11 @@ RESOURCES_FILES ?= $(RESOURCES_FILES_ALL) resources: resources-po resources-cp -resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm) +resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm) -resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%) +resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%) -$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : % +$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : % cp -fr $< $@; # Make installation directories if they don't exist. @@ -228,19 +228,19 @@ $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: % # generic rule to install .qm files : install-qm: resources - $(INSTALL) -d $(datadir)/resources - @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \ + $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME) + @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \ if test $$f != X; then \ - ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \ + ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \ fi; \ done # generic rule to install resources files (png, ini ...): install-res: resources - $(INSTALL) -d $(datadir)/resources - @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \ + $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME) + @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \ if test $$f != X; then \ - ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \ + ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \ fi; \ done @@ -291,7 +291,7 @@ uninstall: # Uninstall qm files @for f in X $(PO_FILES:%.po=%.qm); do \ if test $$f != X; then \ - $(LT_UNINSTALL) $(datadir)/resources/$$f ; \ + $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \ fi; \ done @@ -336,7 +336,7 @@ clean: mostlyclean # distclean: clean #remove qm file ! - -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm) + -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm) #remove include files -$(RM) $(DEST_HEADERS) -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep* @@ -383,7 +383,7 @@ distclean: clean %_wrap.cxx : %.i $(SWIG) $(SWIG_FLAGS) -o $@ $< -$(top_builddir)/share/salome/resources/%.qm: %.po +$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po $(MSG2QM) $< $@ ; \ #------------------------------------------------------------------------------ diff --git a/salome_adm/unix/DEPRECATED/make_module.in b/salome_adm/unix/DEPRECATED/make_module.in index bb26129cb..2231eed78 100644 --- a/salome_adm/unix/DEPRECATED/make_module.in +++ b/salome_adm/unix/DEPRECATED/make_module.in @@ -56,9 +56,9 @@ resources: resources-cp (cd $$d && $(MAKE) $@) || exit 1; \ done -resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%) +resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%) -$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : % +$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : % cp -fr $< $@; #data: @@ -104,15 +104,15 @@ distclean: clean @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done - -$(RM) $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%) + -$(RM) $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%) -$(RM) Makefile install-resources: resources-cp # one resources directory for all salome modules - $(INSTALL) -d $(datadir)/resources - @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \ + $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME) + @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \ if test $$f != X; then \ - ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \ + ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \ fi; \ done @@ -120,7 +120,7 @@ install-resources: resources-cp uninstall-resources: @for f in X $(RESOURCES_FILES); do \ if test $$f != X; then \ - $(LT_UNINSTALL) $(datadir)/resources/$$f ; \ + $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \ fi; \ done diff --git a/salome_adm/unix/make_common_starter.am b/salome_adm/unix/make_common_starter.am index 220be3f5e..007845b44 100644 --- a/salome_adm/unix/make_common_starter.am +++ b/salome_adm/unix/make_common_starter.am @@ -16,7 +16,7 @@ salomescriptdir = $(bindir) salomeidldir = $(prefix)/idl/@PACKAGE@ # Directory for installing resource files -salomeresdir = $(prefix)/share/@PACKAGE@/resources +salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@ # Directories for installing admin files salomeadmdir = $(prefix)/salome_adm diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 9e9c57da4..992b565f7 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -66,7 +66,7 @@ SALOME_ResourcesManager(CORBA::ORB_ptr orb, * - if ${APPLI} exists in environment, * look for ${HOME}/*{APPLI}/CatalogResources.xml * - else look for default: - * ${KERNEL_ROOT_DIR}/share/salome/resources/CatalogResources.xml + * ${KERNEL_ROOT_DIR}/share/salome/resources/kernel/CatalogResources.xml * - parse XML resource file. */ //============================================================================= @@ -87,7 +87,7 @@ SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb) else { _path_resources = getenv("KERNEL_ROOT_DIR"); - _path_resources += "/share/salome/resources/CatalogResources.xml"; + _path_resources += "/share/salome/resources/kernel/CatalogResources.xml"; } ParseXmlFile(); diff --git a/src/SALOMEDS/Test/SALOMEDSTest.cxx b/src/SALOMEDS/Test/SALOMEDSTest.cxx index 6221e9b83..88443291b 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest.cxx @@ -58,7 +58,7 @@ using namespace std; void SALOMEDSTest::setUp() { TCollection_AsciiString kernel(getenv("KERNEL_ROOT_DIR")); - TCollection_AsciiString subPath("/share/salome/resources"); + TCollection_AsciiString subPath("/share/salome/resources/kernel"); TCollection_AsciiString csf_var = (kernel+subPath); setenv("CSF_PluginDefaults", csf_var.ToCString(), 0); setenv("CSF_SALOMEDS_ResourcesDefaults", csf_var.ToCString(), 0); diff --git a/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx b/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx index de90a0a9e..30029799d 100644 --- a/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx +++ b/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx @@ -46,7 +46,7 @@ using namespace std; void SALOMEDSImplTest::setUp() { TCollection_AsciiString kernel(getenv("KERNEL_ROOT_DIR")); - TCollection_AsciiString subPath("/share/salome/resources"); + TCollection_AsciiString subPath("/share/salome/resources/kernel"); TCollection_AsciiString csf_var = (kernel+subPath); setenv("CSF_PluginDefaults", csf_var.ToCString(), 0); setenv("CSF_SALOMEDS_ResourcesDefaults", csf_var.ToCString(), 0); -- 2.39.2