summaryrefslogtreecommitdiff
path: root/rules/patch/RULES
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-05-15 14:24:39 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-05-15 14:24:39 +0200
commit87c7f58e398e7f11030518f03251cb22795497bf (patch)
tree5d2fd0b781d1d7d554b96027ed681ab7a45bf7f9 /rules/patch/RULES
parent8fadddfa5cd7c3ddc1c595fd952ac74a444187c8 (diff)
parent4788e56dae6f6c1367084c064e62eb1b86d5583f (diff)
downloadrules-cc-87c7f58e398e7f11030518f03251cb22795497bf.tar.gz
Merge commit '4788e56dae6f6c1367084c064e62eb1b86d5583f' into rules/rules-cc
Diffstat (limited to 'rules/patch/RULES')
-rw-r--r--rules/patch/RULES21
1 files changed, 18 insertions, 3 deletions
diff --git a/rules/patch/RULES b/rules/patch/RULES
index 446f842..e7d50f9 100644
--- a/rules/patch/RULES
+++ b/rules/patch/RULES
@@ -144,13 +144,15 @@
{ "doc": ["Replace a file, logically in place, by a patched version"]
, "target_fields": ["src", "patch"]
, "config_vars": ["PATCH", "ENV"]
- , "implicit": {"patch-defaults": ["defaults"]}
+ , "implicit":
+ {"patch-defaults": ["defaults"], "defaults": [["shell", "defaults"]]}
, "field_doc":
{ "src":
[ "The single source file to patch, typically an explicit file reference."
]
, "patch": ["The patch to apply."]
, "patch-defaults": ["The patch binary (and toolchain) to use"]
+ , "defaults": ["The shell toolchain to use"]
}
, "artifacts_doc":
["The patched file, staged to the position the of the original file"]
@@ -163,12 +165,23 @@
, "default-ENV": "default-ENV"
, "default-PATH": "default-PATH"
, "default-NON_SYSTEM_TOOLS": "default-NON_SYSTEM_TOOLS"
+ , "sh-TOOLCHAIN": ["CC", "default-TOOLCHAIN"]
+ , "sh-PATH": ["CC", "default-PATH"]
+ , "sh": ["shell", "sh"]
}
, "expression":
{ "type": "let*"
, "bindings":
[ ["TOOLCHAIN_DIR", "toolchain"]
- , ["TOOLCHAIN", {"type": "CALL_EXPRESSION", "name": "default-TOOLCHAIN"}]
+ , [ "TOOLCHAIN"
+ , { "type": "disjoint_map_union"
+ , "msg": "Staging conflict between patch and sh toolchain"
+ , "$1":
+ [ {"type": "CALL_EXPRESSION", "name": "default-TOOLCHAIN"}
+ , {"type": "CALL_EXPRESSION", "name": "sh-TOOLCHAIN"}
+ ]
+ }
+ ]
, [ "TOOLCHAIN"
, { "type": "to_subdir"
, "subdir": {"type": "var", "name": "TOOLCHAIN_DIR"}
@@ -228,6 +241,7 @@
{ "type": "++"
, "$1":
[ {"type": "CALL_EXPRESSION", "name": "default-PATH"}
+ , {"type": "CALL_EXPRESSION", "name": "sh-PATH"}
, { "type": "if"
, "cond": {"type": "var", "name": "ENV_PATH"}
, "then": [{"type": "var", "name": "ENV_PATH"}]
@@ -239,6 +253,7 @@
]
}
]
+ , ["sh", {"type": "CALL_EXPRESSION", "name": "sh"}]
, [ "orig"
, { "type": "let*"
, "bindings": [["fieldname", "src"], ["location", "orig"]]
@@ -294,7 +309,7 @@
, { "type": "ACTION"
, "inputs": {"type": "var", "name": "inputs"}
, "outs": ["patched"]
- , "cmd": ["sh", "./run_patch.sh"]
+ , "cmd": [{"type": "var", "name": "sh"}, "./run_patch.sh"]
, "env": {"type": "var", "name": "ENV"}
}
]