From 2bdb9355cf85171e0f481bcd99b08518cada42b5 Mon Sep 17 00:00:00 2001 From: taoky Date: Tue, 6 Aug 2024 21:08:54 +0800 Subject: [PATCH] Add --no-remove-not-in-local for verify --- shadowmire.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shadowmire.py b/shadowmire.py index ccf3f51..0204146 100755 --- a/shadowmire.py +++ b/shadowmire.py @@ -975,12 +975,16 @@ def genlocal(ctx: click.Context) -> None: ) @click.pass_context @sync_shared_args +@click.option( + "--no-remove-not-in-local", is_flag=True, help="Skip step 1" +) def verify( ctx: click.Context, sync_packages: bool, shadowmire_upstream: Optional[str], exclude: tuple[str], prerelease_exclude: tuple[str], + no_remove_not_in_local: bool, ) -> None: basedir: Path = ctx.obj["basedir"] local_db: LocalVersionKV = ctx.obj["local_db"] @@ -993,7 +997,8 @@ def verify( simple_dirs = set([i.name for i in (basedir / "simple").iterdir() if i.is_dir()]) for package_name in simple_dirs - local_names: logger.debug("package %s not in local db", package_name) - syncer.do_remove(package_name) + if not no_remove_not_in_local: + syncer.do_remove(package_name) logger.info("remove packages NOT in remote") local = local_db.dump(skip_invalid=False)