From 6eb1d25997f030498a2a5dfe90a11aacce37ce34 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 22 Dec 2025 13:38:31 +0100 Subject: [PATCH 1/4] update mdsplus backend wrt to idspath --- common/al_env.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/common/al_env.sh.in b/common/al_env.sh.in index 22878aac..3ce4bf14 100644 --- a/common/al_env.sh.in +++ b/common/al_env.sh.in @@ -14,6 +14,7 @@ if [ -d "${CMAKE_INSTALL_PREFIX}/lib/python${PYVER}/site-packages" ]; then fi if [ -d "${CMAKE_INSTALL_PREFIX}/models/mdsplus" ]; then export ids_path="${CMAKE_INSTALL_PREFIX}/models/mdsplus" + export MDSPLUS_MODEL_PATH=$ids_path fi if [ -f "${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml" ]; then export IDSDEF_PATH="${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml" From 58b9ad8895e05e3df8867a48c2463406e738b661 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Wed, 14 Jan 2026 13:06:28 +0100 Subject: [PATCH 2/4] make env variable idspath readonly --- common/al_env.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/common/al_env.sh.in b/common/al_env.sh.in index 3ce4bf14..5fd588fa 100644 --- a/common/al_env.sh.in +++ b/common/al_env.sh.in @@ -14,6 +14,7 @@ if [ -d "${CMAKE_INSTALL_PREFIX}/lib/python${PYVER}/site-packages" ]; then fi if [ -d "${CMAKE_INSTALL_PREFIX}/models/mdsplus" ]; then export ids_path="${CMAKE_INSTALL_PREFIX}/models/mdsplus" + readonly ids_path export MDSPLUS_MODEL_PATH=$ids_path fi if [ -f "${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml" ]; then From d0439b155e5d9a5c134fe9c25e9bb0f00ddd374b Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Wed, 14 Jan 2026 14:40:13 +0100 Subject: [PATCH 3/4] modified mdsplus backend wrt ids path --- common/al_env.sh.in | 4 +--- src/mdsplus/mdsplus_backend.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/al_env.sh.in b/common/al_env.sh.in index 5fd588fa..6a5d254b 100644 --- a/common/al_env.sh.in +++ b/common/al_env.sh.in @@ -13,9 +13,7 @@ if [ -d "${CMAKE_INSTALL_PREFIX}/lib/python${PYVER}/site-packages" ]; then export PYTHONPATH="${CMAKE_INSTALL_PREFIX}/lib/python${PYVER}/site-packages:$PYTHONPATH" fi if [ -d "${CMAKE_INSTALL_PREFIX}/models/mdsplus" ]; then - export ids_path="${CMAKE_INSTALL_PREFIX}/models/mdsplus" - readonly ids_path - export MDSPLUS_MODEL_PATH=$ids_path + export MDSPLUS_MODEL_PATH="${CMAKE_INSTALL_PREFIX}/models/mdsplus" fi if [ -f "${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml" ]; then export IDSDEF_PATH="${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml" diff --git a/src/mdsplus/mdsplus_backend.cpp b/src/mdsplus/mdsplus_backend.cpp index a6bdbfcc..dfa45871 100644 --- a/src/mdsplus/mdsplus_backend.cpp +++ b/src/mdsplus/mdsplus_backend.cpp @@ -1428,7 +1428,7 @@ static char *getPathInfo(MDSplus::Data *data, MDSplus::TreeNode *refNode) std::string translatedBaseStr(translatedBase); if(originalIdsPath == "") { - char *origPath = getenv(szPath); + char *origPath = getenv("MDSPLUS_MODEL_PATH"); if(origPath) originalIdsPath = origPath; } From 36aafacb965db01153f105fc30152f8a61b978b8 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Wed, 14 Jan 2026 15:44:10 +0100 Subject: [PATCH 4/4] updated resetIdsPath and setDataEnv to take MDSPLUS_MODEL_PATH --- src/mdsplus/mdsplus_backend.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/mdsplus/mdsplus_backend.cpp b/src/mdsplus/mdsplus_backend.cpp index dfa45871..cf2819f3 100644 --- a/src/mdsplus/mdsplus_backend.cpp +++ b/src/mdsplus/mdsplus_backend.cpp @@ -1440,10 +1440,11 @@ static char *getPathInfo(MDSplus::Data *data, MDSplus::TreeNode *refNode) } #ifdef WIN32 char szEnv[256] = { 0 }; - sprintf(szEnv, "%s=%s", szPath, translatedBaseStr.c_str()); + //sprintf(szEnv, "%s=%s", szPath, translatedBaseStr.c_str()); + sprintf(szEnv, "%s=%s", "MDSPLUS_MODEL_PATH", translatedBaseStr.c_str()); putenv(szEnv); #else // WIN32 - setenv(szPath, translatedBaseStr.c_str(), 1); + setenv("MDSPLUS_MODEL_PATH", translatedBaseStr.c_str(), 1); #endif // WIN32 } } @@ -1469,10 +1470,11 @@ void MDSplusBackend::resetIdsPath(std::string strTree) { #ifdef WIN32 char szEnv[256] = { 0 }; - sprintf(szEnv, "%s=%s", szPath, originalIdsPath.c_str()); + //sprintf(szEnv, "%s=%s", szPath, originalIdsPath.c_str()); + sprintf(szEnv, "%s=%s", "MDSPLUS_MODEL_PATH", originalIdsPath.c_str()); putenv(szEnv); #else // WIN32 - setenv(szPath, originalIdsPath.c_str(), 1); + setenv("MDSPLUS_MODEL_PATH", originalIdsPath.c_str(), 1); #endif // WIN32 // Reset the global variable originalIdsPath to an empty string so @@ -1495,7 +1497,7 @@ void MDSplusBackend::resetIdsPath(std::string strTree) { if(originalIdsPath == "") //Do it only once in case it is defined { - char *origPath = getenv(szPath); + char *origPath = getenv("MDSPLUS_MODEL_PATH"); if(origPath) originalIdsPath = origPath; } @@ -1508,11 +1510,11 @@ void MDSplusBackend::resetIdsPath(std::string strTree) { #ifdef WIN32 char szEnv[256] = { 0 }; // sprintf(szEnv, "%s=%s", szPath, mdsplusBaseStr.c_str()); - sprintf(szEnv, "%s=%s", szPath, newPathStr.c_str()); + sprintf(szEnv, "%s=%s", "MDSPLUS_MODEL_PATH", newPathStr.c_str()); putenv(szEnv); #else // WIN32 // setenv(szPath, mdsplusBaseStr.c_str(), 1); - setenv(szPath, newPathStr.c_str(), 1); + setenv("MDSPLUS_MODEL_PATH", newPathStr.c_str(), 1); #endif // WIN32 }