diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-05-15 14:24:39 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-05-15 14:24:39 +0200 |
commit | 87c7f58e398e7f11030518f03251cb22795497bf (patch) | |
tree | 5d2fd0b781d1d7d554b96027ed681ab7a45bf7f9 /rules/patch | |
parent | 8fadddfa5cd7c3ddc1c595fd952ac74a444187c8 (diff) | |
parent | 4788e56dae6f6c1367084c064e62eb1b86d5583f (diff) | |
download | rules-cc-87c7f58e398e7f11030518f03251cb22795497bf.tar.gz |
Merge commit '4788e56dae6f6c1367084c064e62eb1b86d5583f' into rules/rules-cc
Diffstat (limited to 'rules/patch')
-rw-r--r-- | rules/patch/RULES | 21 |
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"} } ] |