@@ -2830,8 +2830,6 @@ def patch_step(self, beginpath=None, patches=None):
28302830 self .log .info ("Applying patch %s" % patch ['name' ])
28312831 trace_msg ("applying patch %s" % patch ['name' ])
28322832
2833- # patch source at specified index (first source if not specified)
2834- srcind = patch .get ('source' , 0 )
28352833 # if patch level is specified, use that (otherwise let apply_patch derive patch level)
28362834 level = patch .get ('level' , None )
28372835 # determine suffix of source path to apply patch in (if any)
@@ -2840,16 +2838,14 @@ def patch_step(self, beginpath=None, patches=None):
28402838 copy_patch = 'copy' in patch and 'sourcepath' not in patch
28412839 options = patch .get ('opts' , None ) # Extra options for patch command
28422840
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 )
28452843
28462844 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 ))
28532849 else :
28542850 self .log .debug ("Using specified begin path for patch %s: %s" % (patch ['name' ], beginpath ))
28552851
0 commit comments