@@ -2830,8 +2830,6 @@ def patch_step(self, beginpath=None, patches=None):
2830
2830
self .log .info ("Applying patch %s" % patch ['name' ])
2831
2831
trace_msg ("applying patch %s" % patch ['name' ])
2832
2832
2833
- # patch source at specified index (first source if not specified)
2834
- srcind = patch .get ('source' , 0 )
2835
2833
# if patch level is specified, use that (otherwise let apply_patch derive patch level)
2836
2834
level = patch .get ('level' , None )
2837
2835
# determine suffix of source path to apply patch in (if any)
@@ -2840,16 +2838,14 @@ def patch_step(self, beginpath=None, patches=None):
2840
2838
copy_patch = 'copy' in patch and 'sourcepath' not in patch
2841
2839
options = patch .get ('opts' , None ) # Extra options for patch command
2842
2840
2843
- self .log .debug ("Source index: %s; patch level: %s; source path suffix: %s; copy patch: %s; options: %s" ,
2844
- srcind , level , srcpathsuffix , copy_patch , options )
2841
+ self .log .debug ("Patch level: %s; source path suffix: %s; copy patch: %s; options: %s" ,
2842
+ level , srcpathsuffix , copy_patch , options )
2845
2843
2846
2844
if beginpath is None :
2847
- try :
2848
- beginpath = self .src [srcind ]['finalpath' ]
2849
- self .log .debug ("Determine begin path for patch %s: %s" % (patch ['name' ], beginpath ))
2850
- except IndexError as err :
2851
- raise EasyBuildError ("Can't apply patch %s to source at index %s of list %s: %s" ,
2852
- patch ['name' ], srcind , self .src , err )
2845
+ if not self .src :
2846
+ raise EasyBuildError ("Can't apply patch %s to source if no sources are given" , patch ['name' ])
2847
+ beginpath = self .src [0 ]['finalpath' ]
2848
+ self .log .debug ("Determined begin path for patch %s: %s" % (patch ['name' ], beginpath ))
2853
2849
else :
2854
2850
self .log .debug ("Using specified begin path for patch %s: %s" % (patch ['name' ], beginpath ))
2855
2851
0 commit comments