From b2c5a84d2132fba8f444307d5f43d630e9f7fd60 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Wed, 29 Nov 2023 11:28:08 +0100 Subject: [PATCH 1/2] hide CO7 software by default --- Lmod-config.spec | 4 +++- SitePackage.lua | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Lmod-config.spec b/Lmod-config.spec index da55a49..d092ab3 100644 --- a/Lmod-config.spec +++ b/Lmod-config.spec @@ -1,6 +1,6 @@ Summary: Sitepackage and other config files for Lmod Name: Lmod-config -Version: 1.5 +Version: 1.6 Release: 1 License: GPL Group: Applications/System @@ -40,6 +40,8 @@ exit 0 %{_libexecdir}/lmod/run_lmod_cache.py %changelog +* Wed Nov 29 2023 Ward Poelmans +- Hide legacy software trees (CO7) * Thu Nov 09 2023 Alex Domingo - Hide AlphaFold modules for ColabFold * Tue Jun 13 2023 Ward Poelmans diff --git a/SitePackage.lua b/SitePackage.lua index b1972ec..c07580f 100644 --- a/SitePackage.lua +++ b/SitePackage.lua @@ -234,6 +234,8 @@ local function visible_hook(modT) -- modT is a table with: fullName, sn, fn and isVisible -- The latter is a boolean to determine if a module is visible or not + local mt = MT:singleton() + if modT.fullName:find("cluster/%.") then modT.isVisible = false elseif modT.fullName:find("EESSI/") then @@ -242,12 +244,10 @@ local function visible_hook(modT) modT.isVisible = false elseif modT.fullName:find("AlphaFold/.*ColabFold") then modT.isVisible = false + elseif modT.fn:find("^/apps/brussel/CO7/") and not mt:exists('legacy-software') then + modT.isVisible = false elseif module_age(modT) > 5 then - local mt = MT:singleton() - -- do not hide anything if legacy-software is loaded - if not mt:exists('legacy-software') then - modT.isVisible = false - end + modT.isVisible = false end end From 03c8918b5789e3638225ff00f4d144c87fb0ed62 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Wed, 29 Nov 2023 11:46:22 +0100 Subject: [PATCH 2/2] re-arrange logic --- Lmod-config.spec | 2 +- SitePackage.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Lmod-config.spec b/Lmod-config.spec index d092ab3..c1fc963 100644 --- a/Lmod-config.spec +++ b/Lmod-config.spec @@ -1,7 +1,7 @@ Summary: Sitepackage and other config files for Lmod Name: Lmod-config Version: 1.6 -Release: 1 +Release: 2 License: GPL Group: Applications/System BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot diff --git a/SitePackage.lua b/SitePackage.lua index c07580f..c89c5dd 100644 --- a/SitePackage.lua +++ b/SitePackage.lua @@ -244,8 +244,10 @@ local function visible_hook(modT) modT.isVisible = false elseif modT.fullName:find("AlphaFold/.*ColabFold") then modT.isVisible = false - elseif modT.fn:find("^/apps/brussel/CO7/") and not mt:exists('legacy-software') then - modT.isVisible = false + elseif modT.fn:find("^/apps/brussel/CO7/") then + if not mt:exists('legacy-software') then + modT.isVisible = false + end elseif module_age(modT) > 5 then modT.isVisible = false end