Skip to content

Commit 4d8c8ba

Browse files
committed
base: Add alternative spelling for patch-path-strip with underscores
1 parent dfcdd78 commit 4d8c8ba

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

xbstrap/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,7 +2769,12 @@ def patch_src(cfg, src):
27692769
["hg", "import", os.path.join(src.patch_dir, patch)], cwd=src.source_dir
27702770
)
27712771
elif "url" in source:
2772-
path_strip = str(source["patch-path-strip"]) if "patch-path-strip" in source else "0"
2772+
path_strip = "0"
2773+
if "patch_path_strip" in source:
2774+
path_strip = str(source["patch_path_strip"])
2775+
elif "patch-path-strip" in source: # Accept old spelling
2776+
path_strip = str(source["patch-path-strip"])
2777+
27732778
with open(os.path.join(src.patch_dir, patch), "r") as fd:
27742779
subprocess.check_call(
27752780
["patch", "-p", path_strip, "--merge"], stdin=fd, cwd=src.source_dir

xbstrap/schema.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ definitions:
8080
type: string
8181
'patch-path-strip':
8282
type: integer
83+
'patch_path_strip':
84+
type: integer
8385
'checksum':
8486
type: string
8587
# VCS sources.

0 commit comments

Comments
 (0)