summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/patchreview.py
diff options
context:
space:
mode:
authorMickael RAMILISON <mickael.ramilison@smile.fr>2023-10-10 22:58:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-15 09:11:47 +0100
commit9c7148318fd78eefe7c30d2d151b7f1ffd3834f8 (patch)
tree4d0cbd1d1d3ed612b791645ec9b4afba0b9543a7 /scripts/contrib/patchreview.py
parent988dc0dea4398e77a7d7862d4655a9b1f5eaa06d (diff)
downloadpoky-9c7148318fd78eefe7c30d2d151b7f1ffd3834f8.tar.gz
scripts/patchreview: Add a custom pattern for finding recipe patches
This introduces support for specifying a search pattern with the -p/--pattern option in the patchreview.py script. This is designed to accommodate the directory structure of meta-openembedded. (From OE-Core rev: 599046ea9302af0cf856d3fcd827f6a2be75b7e1) Signed-off-by: Mickael RAMILISON <mickael.ramilison@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/patchreview.py')
-rwxr-xr-xscripts/contrib/patchreview.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/contrib/patchreview.py b/scripts/contrib/patchreview.py
index b22cc07f0a..43de105adc 100755
--- a/scripts/contrib/patchreview.py
+++ b/scripts/contrib/patchreview.py
@@ -207,10 +207,11 @@ if __name__ == "__main__":
207 args.add_argument("-v", "--verbose", action="store_true", help="show per-patch results") 207 args.add_argument("-v", "--verbose", action="store_true", help="show per-patch results")
208 args.add_argument("-g", "--histogram", action="store_true", help="show patch histogram") 208 args.add_argument("-g", "--histogram", action="store_true", help="show patch histogram")
209 args.add_argument("-j", "--json", help="update JSON") 209 args.add_argument("-j", "--json", help="update JSON")
210 args.add_argument("-p", "--pattern", nargs=1, action="extend", default=["recipes-*/**/*.patch", "recipes-*/**/*.diff"], help="pattern to search recipes patch")
210 args.add_argument("directory", help="directory to scan") 211 args.add_argument("directory", help="directory to scan")
211 args = args.parse_args() 212 args = args.parse_args()
212 213
213 patches = subprocess.check_output(("git", "-C", args.directory, "ls-files", "recipes-*/**/*.patch", "recipes-*/**/*.diff")).decode("utf-8").split() 214 patches = subprocess.check_output(("git", "-C", args.directory, "ls-files") + tuple(args.pattern)).decode("utf-8").split()
214 results = patchreview(args.directory, patches) 215 results = patchreview(args.directory, patches)
215 analyse(results, want_blame=args.blame, verbose=args.verbose) 216 analyse(results, want_blame=args.blame, verbose=args.verbose)
216 217