diff options
-rw-r--r-- | bitbake/.b4-config | 4 | ||||
-rwxr-xr-x | bitbake/contrib/b4-wrapper-bitbake.py | 40 |
2 files changed, 44 insertions, 0 deletions
diff --git a/bitbake/.b4-config b/bitbake/.b4-config new file mode 100644 index 0000000000..047f0b94a4 --- /dev/null +++ b/bitbake/.b4-config | |||
@@ -0,0 +1,4 @@ | |||
1 | [b4] | ||
2 | send-series-to = bitbake-devel@lists.openembedded.org | ||
3 | send-auto-cc-cmd = ./contrib/b4-wrapper-bitbake.py send-auto-cc-cmd | ||
4 | prep-pre-flight-checks = disable-needs-checking | ||
diff --git a/bitbake/contrib/b4-wrapper-bitbake.py b/bitbake/contrib/b4-wrapper-bitbake.py new file mode 100755 index 0000000000..87dff2c3a7 --- /dev/null +++ b/bitbake/contrib/b4-wrapper-bitbake.py | |||
@@ -0,0 +1,40 @@ | |||
1 | #!/usr/bin/env python3 | ||
2 | # | ||
3 | # Copyright OpenEmbedded Contributors | ||
4 | # | ||
5 | # SPDX-License-Identifier: MIT | ||
6 | # | ||
7 | # This script is to be called by b4: | ||
8 | # - through b4.send-auto-cc-cmd with "send-auto-cc-cmd" as first argument, | ||
9 | # | ||
10 | # When send-auto-cc-cmd is passed: | ||
11 | # | ||
12 | # This returns the list of Cc recipients for a patch. | ||
13 | # | ||
14 | # This script takes as stdin a patch. | ||
15 | |||
16 | import subprocess | ||
17 | import sys | ||
18 | |||
19 | cmd = sys.argv[1] | ||
20 | if cmd != "send-auto-cc-cmd": | ||
21 | sys.exit(-1) | ||
22 | |||
23 | patch = sys.stdin.read() | ||
24 | |||
25 | if subprocess.call(["which", "lsdiff"], stdout=subprocess.DEVNULL) != 0: | ||
26 | print("lsdiff missing from host, please install patchutils") | ||
27 | sys.exit(-1) | ||
28 | |||
29 | files = subprocess.check_output(["lsdiff", "--strip-match=1", "--strip=1", "--include=doc/*"], | ||
30 | input=patch, text=True) | ||
31 | if len(files): | ||
32 | print("docs@lists.yoctoproject.org") | ||
33 | else: | ||
34 | # Handle patches made with --no-prefix | ||
35 | files = subprocess.check_output(["lsdiff", "--include=doc/*"], | ||
36 | input=patch, text=True) | ||
37 | if len(files): | ||
38 | print("docs@lists.yoctoproject.org") | ||
39 | |||
40 | sys.exit(0) | ||