diff options
author | Jose Quaresma <quaresma.jose@gmail.com> | 2025-04-01 17:59:12 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-03 11:06:20 +0100 |
commit | 603ec78ec40202f13959de800a10fd536b4bda57 (patch) | |
tree | f5cf31724339288a09cb7a9e9b9325822c7dac08 /scripts/sstate-cache-management.py | |
parent | 34c1fcbce619bce682f9abc6283d0ddfad37ba4e (diff) | |
download | poky-603ec78ec40202f13959de800a10fd536b4bda57.tar.gz |
sstate-cache-management: add dry-run argument
(From OE-Core rev: 98be0514b9dcb77b7520f5b6a9edef7a7a7859ac)
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/sstate-cache-management.py')
-rwxr-xr-x | scripts/sstate-cache-management.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/sstate-cache-management.py b/scripts/sstate-cache-management.py index d3f600bd28..303b8f13a3 100755 --- a/scripts/sstate-cache-management.py +++ b/scripts/sstate-cache-management.py | |||
@@ -268,6 +268,10 @@ def parse_arguments(): | |||
268 | # ) | 268 | # ) |
269 | 269 | ||
270 | parser.add_argument( | 270 | parser.add_argument( |
271 | "-n", "--dry-run", action="store_true", help="Don't execute, just go through the motions." | ||
272 | ) | ||
273 | |||
274 | parser.add_argument( | ||
271 | "-y", | 275 | "-y", |
272 | "--yes", | 276 | "--yes", |
273 | action="store_true", | 277 | action="store_true", |
@@ -314,6 +318,9 @@ def main(): | |||
314 | if args.debug >= 1: | 318 | if args.debug >= 1: |
315 | print("\n".join([str(p.path) for p in remove])) | 319 | print("\n".join([str(p.path) for p in remove])) |
316 | print(f"{len(remove)} out of {len(paths)} files will be removed!") | 320 | print(f"{len(remove)} out of {len(paths)} files will be removed!") |
321 | if args.dry_run: | ||
322 | return 0 | ||
323 | |||
317 | if not args.yes: | 324 | if not args.yes: |
318 | print("Do you want to continue (y/n)?") | 325 | print("Do you want to continue (y/n)?") |
319 | confirm = input() in ("y", "Y") | 326 | confirm = input() in ("y", "Y") |