Skip to content
Snippets Groups Projects

Remove cmd

Merged Ashwin Kumar Karnad requested to merge continue-with-remove-cmd into main
3 unresolved threads
Files
2
@@ -1082,7 +1082,7 @@ def remove_environment(mpsd_release, root_dir, package_sets="NONE", force_remove
"""Remove release from installation.
Handle 3 situations :
1. remove dosent specify what to remove
1. remove does not specify what to remove
-> warn and exit
2. remove all package_sets from release
-> remove release folder except logs
@@ -1097,7 +1097,7 @@ def remove_environment(mpsd_release, root_dir, package_sets="NONE", force_remove
A Path object representing the path to the directory where
the release and package_sets will be installed.
package_sets : list of str
A list of strings representing the package_sets to install
A list of strings representing the package_sets to remove
(e.g., "foss2021a-mpi", "global_generic", "ALL").
force_remove : bool, optional
A boolean indicating whether to force remove the release.
@@ -1190,6 +1190,7 @@ def remove_spack_environment(spack_dir, environment_name, build_log_path=None):
then uninstall all packages exclusive to the environment,
then deactivate the environment,
and finally remove the environment.
Parameters
----------
spack_dir : pathlib.Path
@@ -1202,7 +1203,7 @@ def remove_spack_environment(spack_dir, environment_name, build_log_path=None):
logging.warning(f"Removing spack environment {environment_name}")
spack_env = spack_dir / "share" / "spack" / "setup-env.sh"
commands_to_execute = [
f"export SPACK_DIR={spack_dir}", # need to set SPACK_DIR in dash and sh
f"export SPACK_ROOT={spack_dir}", # need to set SPACK_ROOT in dash and sh
f". {spack_env}",
f"spack env activate {environment_name}",
f"for spec in $(spack -e {environment_name} find" # this line continues
@@ -1237,7 +1238,7 @@ def remove_spack_package(spack_dir, package, build_log_path=None):
logging.info(f"Removing spack package {package}")
spack_env = spack_dir / "share" / "spack" / "setup-env.sh"
commands_to_execute = [
f"export SPACK_DIR={spack_dir}", # need to set SPACK_DIR in dash and sh
f"export SPACK_ROOT={spack_dir}", # need to set SPACK_ROOT in dash and sh
f". {spack_env}",
f"spack uninstall -y {package}",
]
Loading