From fd3d6480a9b96877167898a3bd58c186b8fe99bc Mon Sep 17 00:00:00 2001 From: "jerad.k" Date: Thu, 18 May 2023 15:07:26 +0800 Subject: [PATCH] fix(I73YZ8): Add 'source ${mpprc_file}' to user_bashrc in PreInstallUtility and delete it in PostUninstallImpl --- script/impl/postuninstall/PostUninstallImpl.py | 2 ++ script/local/PreInstallUtility.py | 1 + 2 files changed, 3 insertions(+) diff --git a/script/impl/postuninstall/PostUninstallImpl.py b/script/impl/postuninstall/PostUninstallImpl.py index 696cae90..2f4f88bb 100644 --- a/script/impl/postuninstall/PostUninstallImpl.py +++ b/script/impl/postuninstall/PostUninstallImpl.py @@ -483,6 +483,8 @@ class PostUninstallImpl: if os.path.exists(user_bashrc): FileUtil.deleteLine(user_bashrc, "^\\s*export\\s*%s=.*$" % DefaultValue.MPPRC_FILE_ENV) + FileUtil.deleteLine(user_bashrc, + "^\\s*source\\s*=\\s*%s" % DefaultValue.MPPRC_FILE_ENV) # clean $GAUSS_ENV if (not self.deleteUser): diff --git a/script/local/PreInstallUtility.py b/script/local/PreInstallUtility.py index 77087083..467e9b3b 100644 --- a/script/local/PreInstallUtility.py +++ b/script/local/PreInstallUtility.py @@ -1335,6 +1335,7 @@ Common options: FileUtil.deleteLine(self.user_env_file, "^\\s*export\\s*%s=.*$" % DefaultValue.MPPRC_FILE_ENV) context = "export %s=%s" % (DefaultValue.MPPRC_FILE_ENV, self.mpprcFile) + context += "\nsource %s" % self.mpprcFile FileUtil.writeFile(self.user_env_file, [context]) self.logger.debug("Successfully flush 'export MPPRC' in bashrc") -- Gitee