summaryrefslogtreecommitdiff
path: root/src/buildstream/plugins/sources/patch.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/plugins/sources/patch.py')
-rw-r--r--src/buildstream/plugins/sources/patch.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/buildstream/plugins/sources/patch.py b/src/buildstream/plugins/sources/patch.py
index 2be4ee2f7..e9c4ff050 100644
--- a/src/buildstream/plugins/sources/patch.py
+++ b/src/buildstream/plugins/sources/patch.py
@@ -56,9 +56,7 @@ class PatchSource(Source):
def configure(self, node):
node.validate_keys(["path", "strip-level", *Source.COMMON_CONFIG_KEYS])
- self.path = self.node_get_project_path(
- node.get_scalar("path"), check_is_file=True
- )
+ self.path = self.node_get_project_path(node.get_scalar("path"), check_is_file=True)
self.strip_level = node.get_int("strip-level", default=1)
self.fullpath = os.path.join(self.get_project_directory(), self.path)
@@ -91,20 +89,12 @@ class PatchSource(Source):
# Bail out with a comprehensive message if the target directory is empty
if not os.listdir(directory):
raise SourceError(
- "Nothing to patch in directory '{}'".format(directory),
- reason="patch-no-files",
+ "Nothing to patch in directory '{}'".format(directory), reason="patch-no-files",
)
strip_level_option = "-p{}".format(self.strip_level)
self.call(
- [
- self.host_patch,
- strip_level_option,
- "-i",
- self.fullpath,
- "-d",
- directory,
- ],
+ [self.host_patch, strip_level_option, "-i", self.fullpath, "-d", directory,],
fail="Failed to apply patch {}".format(self.path),
)