@@ -449,8 +449,8 @@ def config_options(self):
449449 'buildpath' : ("Temporary build path" , None , 'store' , mk_full_default_path ('buildpath' )),
450450 'containerpath' : ("Location where container recipe & image will be stored" , None , 'store' ,
451451 mk_full_default_path ('containerpath' )),
452- 'external-modules-metadata' : ("List of files specifying metadata for external modules (INI format)" ,
453- 'strlist' , 'store' , None ),
452+ 'external-modules-metadata' : ("List of (glob patterns for) paths to files specifying metadata "
453+ "for external modules (INI format)" , 'strlist' , 'store' , None ),
454454 'hooks' : ("Location of Python module with hook implementations" , 'str' , 'store' , None ),
455455 'ignore-dirs' : ("Directory names to ignore when searching for files/dirs" ,
456456 'strlist' , 'store' , ['.git' , '.svn' ]),
@@ -1471,14 +1471,25 @@ def parse_external_modules_metadata(cfgs):
14711471 """
14721472 Parse metadata for external modules.
14731473
1474- :param cfgs: list of config files providing metadata for external modules
1474+ :param cfgs: list of (glob patterns for) paths to config files providing metadata for external modules
14751475 :return: parsed metadata for external modules
14761476 """
1477+ if cfgs is None :
1478+ cfgs = []
1479+
1480+ # expand glob patterns, and report error for faulty paths
1481+ paths = []
1482+ for cfg in cfgs :
1483+ res = glob .glob (cfg )
1484+ if res :
1485+ paths .extend (res )
1486+ else :
1487+ # if there are no matches, we report an error to avoid silently ignores faulty paths
1488+ raise EasyBuildError ("Specified path for file with external modules metadata does not exist: %s" , cfg )
1489+ cfgs = paths
14771490
14781491 # use external modules metadata configuration files that are available by default, unless others are specified
14791492 if not cfgs :
1480- cfgs = []
1481-
14821493 # we expect to find *external_modules_metadata.cfg files in etc/ on same level as easybuild/framework
14831494 topdirs = [os .path .dirname (os .path .dirname (os .path .dirname (__file__ )))]
14841495
@@ -1502,14 +1513,11 @@ def parse_external_modules_metadata(cfgs):
15021513
15031514 parsed_metadata = ConfigObj ()
15041515 for cfg in cfgs :
1505- if os .path .isfile (cfg ):
1506- _log .debug ("Parsing %s with external modules metadata" , cfg )
1507- try :
1508- parsed_metadata .merge (ConfigObj (cfg ))
1509- except ConfigObjError as err :
1510- raise EasyBuildError ("Failed to parse %s with external modules metadata: %s" , cfg , err )
1511- else :
1512- raise EasyBuildError ("Specified path for file with external modules metadata does not exist: %s" , cfg )
1516+ _log .debug ("Parsing %s with external modules metadata" , cfg )
1517+ try :
1518+ parsed_metadata .merge (ConfigObj (cfg ))
1519+ except ConfigObjError as err :
1520+ raise EasyBuildError ("Failed to parse %s with external modules metadata: %s" , cfg , err )
15131521
15141522 # make sure name/version values are always lists, make sure they're equal length
15151523 for mod , entry in parsed_metadata .items ():
0 commit comments