]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/patchreview: Add a custom pattern for finding recipe patches
authorMickael RAMILISON <mickael.ramilison@smile.fr>
Tue, 10 Oct 2023 20:58:57 +0000 (22:58 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 15 Oct 2023 08:11:40 +0000 (09:11 +0100)
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.

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>
scripts/contrib/patchreview.py

index b22cc07f0a5f99acb1cdb91865263db1d5d1b33e..43de105adc2df3bb08622b1b773a33e9d2924914 100755 (executable)
@@ -207,10 +207,11 @@ if __name__ == "__main__":
     args.add_argument("-v", "--verbose", action="store_true", help="show per-patch results")
     args.add_argument("-g", "--histogram", action="store_true", help="show patch histogram")
     args.add_argument("-j", "--json", help="update JSON")
+    args.add_argument("-p", "--pattern", nargs=1, action="extend", default=["recipes-*/**/*.patch", "recipes-*/**/*.diff"], help="pattern to search recipes patch")
     args.add_argument("directory", help="directory to scan")
     args = args.parse_args()
 
-    patches = subprocess.check_output(("git", "-C", args.directory, "ls-files", "recipes-*/**/*.patch", "recipes-*/**/*.diff")).decode("utf-8").split()
+    patches = subprocess.check_output(("git", "-C", args.directory, "ls-files") + tuple(args.pattern)).decode("utf-8").split()
     results = patchreview(args.directory, patches)
     analyse(results, want_blame=args.blame, verbose=args.verbose)