easybuild-framework icon indicating copy to clipboard operation
easybuild-framework copied to clipboard

show readable error message when applying patch without (extracted) source

Open Flamefire opened this issue 9 months ago • 3 comments

When there is no source self.src is an empty list which leads to a rather generic error message. Improve that by showing that there was no source to apply the patch to.

For extensions self.src is set to a string as only a single source is supported. Accessing self.src[0].['finalpath'] leads to an error

TypeError: string indices must be integers This happens when the source didn't got extracted so self.ext_dir and hence beginpath will be None. Make the error show that the source was not extracted.

While doing that get rid of patch['source'] which can never be set as it would trigger a failure in create_patch_info as it isn't specified as an allowed key. It isn't useful anyway as only the first source will have its finalpath set correctly, the other, when unpacked to the same folder, are just referring to that folder instead of their subfolder.

Flamefire avatar Jan 06 '25 15:01 Flamefire