Commits (2)
......@@ -60,8 +60,34 @@ switch [module-info mode] {
puts stdout "source \"$PREFIX/conda/etc/profile.d/conda.sh\";\n"
# Activate base? No: anaconda should just provide the conda tool
# puts stdout "conda activate;\n"
#puts stdout "conda activate;\n"
# Safety check! Warn if an admin loads anaconda on an auristor system
catch {
# Check if we're running auristor
set afsversion [exec fs --version]
if [regexp -nocase {^auristor} $afsversion] {
# Admin groups for this module (regex format)
set admins {sys.modules:administrators|sys.modules:psi_python}
# Determine current user. Prefer klist, but fall back to $USER
catch {
exec klist 2>/dev/null | sed -E -n {s/.*principal: ([^@]+)(@.*)?$/\1/p};
} principal option
if { [dict get $option -code] != 0} {
set principal $::env(USER)
# Determine whether the user belongs to one of the admin groups
if [regexp $admins [exec pts mem $principal]] {
puts stderr "WARNING: You have loaded the anaconda module on an Auristor system. Do not install packages!"
"unload" -
"remove" {
# Only run this if conda is in the PATH