]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sstate-cache-management: add dry-run argument
authorJose Quaresma <quaresma.jose@gmail.com>
Tue, 1 Apr 2025 16:59:12 +0000 (17:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 Apr 2025 10:05:48 +0000 (11:05 +0100)
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/sstate-cache-management.py

index d3f600bd28f63ab4ff48d6acb714c847fb9be7a2..303b8f13a3496dd111361cba4704ca9202b79b19 100755 (executable)
@@ -267,6 +267,10 @@ def parse_arguments():
     #     help="Remove both the symbol link and the destination file, default: no.",
     # )
 
+    parser.add_argument(
+        "-n", "--dry-run", action="store_true", help="Don't execute, just go through the motions."
+    )
+
     parser.add_argument(
         "-y",
         "--yes",
@@ -314,6 +318,9 @@ def main():
     if args.debug >= 1:
         print("\n".join([str(p.path) for p in remove]))
     print(f"{len(remove)} out of {len(paths)} files will be removed!")
+    if args.dry_run:
+        return 0
+
     if not args.yes:
         print("Do you want to continue (y/n)?")
         confirm = input() in ("y", "Y")