From 352ac5db21d9d23b520942128164cc254cba6256 Mon Sep 17 00:00:00 2001 From: Suter Andreas Date: Wed, 17 Feb 2016 12:59:03 +0100 Subject: [PATCH] install default XML startup files under /home/nemu/.musrfit rather than /bin. Since this is a substantial indentation, the version number has been incremented. --- ChangeLog | 9 ++++++-- README.md | 3 ++- configure.ac | 9 ++++---- src/Makefile.am | 6 ++--- src/classes/PStartupHandler.cpp | 29 ++++++++++++++++-------- src/musredit/musredit_startup.xml.in | 2 +- src/musredit_qt5/musredit_startup.xml.in | 2 +- src/musrfit_startup.xml | 2 +- 8 files changed, 39 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0e66dac3..dd3ab127 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,11 +2,16 @@ # ChangeLog #--------------------------------------------------------------------- +changes since 0.17.0 +=================================== + + changes since 0.16.0 =================================== NEW 2016-01-22 update of the docu which now describes the RRF option. -CHANGED 2016-02-17 start to move the startup XML-files to $HOME/.musrfit - rather than having it within $prefix/bin. +CHANGED 2016-02-17 move the startup XML-files to $HOME/.musrfit + rather than having it within $prefix/bin. Increase + therefore the version number to 0.17.0 CHANGED 2016-02-16 if the LEM file is created 2012 or later and the data-file-format tag is still ROOT-NPP or ROOT-PPC, it will automatically switched to MUSR-ROOT. This way red/green diff --git a/README.md b/README.md index fd52af9c..84454b3e 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,5 @@ For a more exhaustive user documentation see: ### Contact ### - \ No newline at end of file + + diff --git a/configure.ac b/configure.ac index fa00d12e..4931abfc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_REVISION([m4_esyscmd_s([git describe --always])]) AC_PREREQ(2.63) -AC_INIT([musrfit],[0.16.0],[andreas.suter@psi.ch]) +AC_INIT([musrfit],[0.17.0],[andreas.suter@psi.ch]) AC_CONFIG_AUX_DIR(admin) AC_CANONICAL_HOST #AC_MSG_RESULT([${host} ${host_cpu} ${host_vendor} ${host_os}]) @@ -35,7 +35,7 @@ dnl ----------------------------------------------- #release versioning MUSR_MAJOR_VERSION=0 -MUSR_MINOR_VERSION=16 +MUSR_MINOR_VERSION=17 MUSR_MICRO_VERSION=0 #release versioning @@ -1401,6 +1401,7 @@ echo "" echo " Installation directories:" echo " -------------------------" echo "" -echo " Programs and XML configuration files: ${INSTALLDIR}/bin" -echo " Documentation: ${DOCDIR}" +echo " Programs: ${INSTALLDIR}/bin" +echo " XML configuration files: ${HOME}/.musrfit" +echo " Documentation: ${DOCDIR}" echo "" diff --git a/src/Makefile.am b/src/Makefile.am index 069d6d17..5a1540a8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -60,7 +60,7 @@ write_musrRoot_runHeader_SOURCES = write_musrRoot_runHeader.cpp musrRootValidation_SOURCES = musrRootValidation.cpp dump_header_SOURCES = dump_header.cpp -xmldir = $(bindir) +xmldir = $(HOME)/.musrfit xml_DATA = musrfit_startup.xml LIBADD = $(PMUSR_LIBS) $(MUSR_ROOT_LIBS) $(LEM_LIBS) $(PSIBIN_LIBS) $(MUD_LIBS) $(PNEXUS_LIBS) @@ -82,7 +82,7 @@ install-xmlDATA: $(xml_DATA) DIFF="$$(diff "$(DESTDIR)$(xmldir)/$(xml_DATA)" "$(xml_DATA)" 2>&1)"; \ if test "x$$DIFF" != "x"; then \ echo " " && \ - echo " musrfit_startup.xml in $(bindir)" && \ + echo " musrfit_startup.xml in $(xmldir)" && \ echo " is different from the distribution's version." && \ echo " Do you want to overwrite it? [y/N]" && \ read OVERWRITE && \ @@ -101,7 +101,7 @@ uninstall-xmlDATA: DIFF="$$(diff "$(DESTDIR)$(xmldir)/$(xml_DATA)" "$(xml_DATA)" 2>&1)"; \ if test "x$$DIFF" != "x"; then \ echo " " && \ - echo " musrfit_startup.xml in $(bindir)" && \ + echo " musrfit_startup.xml in $(xmldir)" && \ echo " is different from the distribution's version." && \ echo " Do you want to remove it? [y/N]" && \ read REMOVE && \ diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index 47414ed3..9077629e 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -93,11 +93,13 @@ PStartupHandler::PStartupHandler() fStartupFilePath = ""; // get default path (for the moment only linux like) - Char_t *pmusrpath; - Char_t *home; + Char_t *pmusrpath=0; + Char_t *home=0; Char_t musrpath[128]; Char_t startup_path_name[128]; - Bool_t pmusrpathfound = false; + Bool_t found = false; + + strncpy(musrpath, "", sizeof(musrpath)); // check if the startup file is found in the current directory strcpy(startup_path_name, "./musrfit_startup.xml"); @@ -105,20 +107,27 @@ PStartupHandler::PStartupHandler() fStartupFileFound = true; fStartupFilePath = TString(startup_path_name); } else { // startup file is not found in the current directory - // check if the MUSRFITPATH system variable is set + // check if the startup file is found under $HOME/.musrfit + home = getenv("HOME"); + if (home != 0) { + sprintf(musrpath, "%s/.musrfit", home); + found = true; + } pmusrpath = getenv("MUSRFITPATH"); - if (pmusrpath != 0) { - if (strcmp(pmusrpath, "")) { // MUSRFITPATH variable set but empty - pmusrpathfound = true; + if (!found) { + // check if the MUSRFITPATH system variable is set + if (pmusrpath != 0) { + if (strcmp(pmusrpath, "")) { // MUSRFITPATH variable set but empty + found = true; + } } } - if (!pmusrpathfound) { // MUSRFITPATH not set or empty, will try default one + if (!found) { // MUSRFITPATH not set or empty, will try default one home = getenv("ROOTSYS"); sprintf(musrpath, "%s/bin", home); cerr << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl; - } else { - strncpy(musrpath, pmusrpath, sizeof(musrpath)); } + sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath); fStartupFilePath = TString(startup_path_name); if (StartupFileExists(startup_path_name)) { diff --git a/src/musredit/musredit_startup.xml.in b/src/musredit/musredit_startup.xml.in index 4493befe..07c1d4d3 100644 --- a/src/musredit/musredit_startup.xml.in +++ b/src/musredit/musredit_startup.xml.in @@ -1,5 +1,5 @@ - + This is handling default setting parameters for the musredit. diff --git a/src/musredit_qt5/musredit_startup.xml.in b/src/musredit_qt5/musredit_startup.xml.in index d51cc3d5..2493a713 100644 --- a/src/musredit_qt5/musredit_startup.xml.in +++ b/src/musredit_qt5/musredit_startup.xml.in @@ -1,5 +1,5 @@ - + This is handling default setting parameters for the musredit. diff --git a/src/musrfit_startup.xml b/src/musrfit_startup.xml index e35450e9..daf13703 100644 --- a/src/musrfit_startup.xml +++ b/src/musrfit_startup.xml @@ -1,5 +1,5 @@ - + Defines default settings for the musrfit package