@@ -334,12 +334,6 @@ def is_loaded(self, mod_names):
334334
335335 return res
336336
337- def check_version (self , minimal_version ):
338- """
339- Check the minimal version of the moduletool in the module file
340- """
341- return self .VERSION_CHECK % minimal_version
342-
343337 def det_installdir (self , modfile ):
344338 """
345339 Determine installation directory used by given module file
@@ -656,8 +650,6 @@ class ModuleGeneratorTcl(ModuleGenerator):
656650 LOAD_TEMPLATE_DEPENDS_ON = "depends-on %(mod_name)s"
657651 IS_LOADED_TEMPLATE = 'is-loaded %s'
658652
659- MODTOOL_VERSION_CHECK = ''
660-
661653 def check_group (self , group , error_msg = None ):
662654 """
663655 Generate a check of the software group and the current user, and refuse to load the module if the user don't
@@ -754,10 +746,6 @@ def get_description(self, conflict=True):
754746 # - 'conflict Compiler/GCC/4.8.2/OpenMPI' for 'Compiler/GCC/4.8.2/OpenMPI/1.6.4'
755747 lines .extend (['' , "conflict %s" % os .path .dirname (self .app .short_mod_name )])
756748
757- provide_list = self ._generate_provides_list ()
758- if self .modules_tool .supports_extensions and provide_list :
759- lines .extend (['' , 'extensions %s' % ', ' .join (provide_list )])
760-
761749 whatis_lines = ["module-whatis {%s}" % re .sub (r'([{}\[\]])' , r'\\\1' , l ) for l in self ._generate_whatis_lines ()]
762750 txt += '\n ' .join (['' ] + lines + ['' ]) % {
763751 'name' : self .app .name ,
@@ -1005,7 +993,7 @@ class ModuleGeneratorLua(ModuleGenerator):
1005993 LOAD_TEMPLATE_DEPENDS_ON = 'depends_on("%(mod_name)s")'
1006994 IS_LOADED_TEMPLATE = 'isloaded("%s")'
1007995
1008- VERSION_CHECK = 'convertToCanonical(LmodVersion()) > convertToCanonical("%s")'
996+ VERSION_CHECK = 'convertToCanonical(LmodVersion()) > convertToCanonical("%(ver_maj)s.%(ver_min) s")'
1009997
1010998 PATH_JOIN_TEMPLATE = 'pathJoin(root, "%s")'
1011999 UPDATE_PATH_TEMPLATE = '%s_path("%s", %s)'
@@ -1021,6 +1009,15 @@ def __init__(self, *args, **kwargs):
10211009 if self .modules_tool .version and LooseVersion (self .modules_tool .version ) >= LooseVersion ('7.7.38' ):
10221010 self .DOT_MODULERC = '.modulerc.lua'
10231011
1012+ def check_version (self , minimal_version_maj , minimal_version_min ):
1013+ """
1014+ Check the minimal version of the moduletool in the module file
1015+ """
1016+ return self .VERSION_CHECK % {
1017+ 'ver_maj' : minimal_version_maj ,
1018+ 'ver_min' : minimal_version_min ,
1019+ }
1020+
10241021 def check_group (self , group , error_msg = None ):
10251022 """
10261023 Generate a check of the software group and the current user, and refuse to load the module if the user don't
@@ -1137,7 +1134,7 @@ def get_description(self, conflict=True):
11371134
11381135 if provide_list :
11391136 provide_list_mod = 'extensions(%s)' % ', ' .join (['"%s"' % x for x in provide_list ])
1140- lines .extend (['' , self .conditional_statement (self .check_version ("8.2.0 " ), provide_list_mod )])
1137+ lines .extend (['' , self .conditional_statement (self .check_version ("8" , "2 " ), provide_list_mod )])
11411138
11421139 txt += '\n ' .join (['' ] + lines + ['' ]) % {
11431140 'name' : self .app .name ,
0 commit comments