@@ -2584,9 +2584,24 @@ def check_checksums_for(self, ent, sub='', source_cnt=None):
25842584 ec_fn = os .path .basename (self .cfg .path )
25852585 checksum_issues = []
25862586
2587- sources = ent .get ('sources' , [])
2588- patches = ent .get ('patches' , []) + ent .get ('postinstallpatches' , [])
2589- checksums = ent .get ('checksums' , [])
2587+ if isinstance (ent , EasyConfig ):
2588+ # try to get value with templates resolved, but fall back to not resolving templates;
2589+ # this is better for error reporting that includes names of source files
2590+ try :
2591+ sources = ent .get ('sources' , [])
2592+ patches = ent .get ('patches' , []) + ent .get ('postinstallpatches' , [])
2593+ checksums = ent .get ('checksums' , [])
2594+ except EasyBuildError :
2595+ sources = ent .get_ref ('sources' )
2596+ patches = ent .get_ref ('patches' ) + ent .get_ref ('postinstallpatches' )
2597+ checksums = ent .get_ref ('checksums' )
2598+ elif isinstance (ent , dict ):
2599+ sources = ent .get ('sources' , [])
2600+ patches = ent .get ('patches' , []) + ent .get ('postinstallpatches' , [])
2601+ checksums = ent .get ('checksums' , [])
2602+ else :
2603+ raise EasyBuildError (f"Unexpected value type in EasyBlock.check_checksums_for: { type (ent )} " )
2604+
25902605 # Single source should be re-wrapped as a list, and checksums with it
25912606 if isinstance (sources , dict ):
25922607 sources = [sources ]
0 commit comments