diff --git a/xbstrap/base.py b/xbstrap/base.py index 8cd6e7e..b17efb4 100644 --- a/xbstrap/base.py +++ b/xbstrap/base.py @@ -2769,7 +2769,12 @@ def patch_src(cfg, src): ["hg", "import", os.path.join(src.patch_dir, patch)], cwd=src.source_dir ) elif "url" in source: - path_strip = str(source["patch-path-strip"]) if "patch-path-strip" in source else "0" + path_strip = "0" + if "patch_path_strip" in source: + path_strip = str(source["patch_path_strip"]) + elif "patch-path-strip" in source: # Accept old spelling + path_strip = str(source["patch-path-strip"]) + with open(os.path.join(src.patch_dir, patch), "r") as fd: subprocess.check_call( ["patch", "-p", path_strip, "--merge"], stdin=fd, cwd=src.source_dir diff --git a/xbstrap/schema.yml b/xbstrap/schema.yml index 2a7bbc0..5966eae 100644 --- a/xbstrap/schema.yml +++ b/xbstrap/schema.yml @@ -80,6 +80,8 @@ definitions: type: string 'patch-path-strip': type: integer + 'patch_path_strip': + type: integer 'checksum': type: string # VCS sources.