From 5585de30ceb15d717ae6054901adea288bf0b28b Mon Sep 17 00:00:00 2001 From: taoky Date: Tue, 6 Aug 2024 22:09:36 +0800 Subject: [PATCH] Change --not-remove-not-in-local to --remove-not-in-local --- .gitignore | 1 + README.md | 2 +- shadowmire.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4323fb7..8518ffb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ venv/ packages/ json/ config.toml +remote_excluded.json diff --git a/README.md b/README.md index b36409b..996398b 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ If you already have a pypi repo, use `genlocal` first to generate a local db: Verify command could be used if you believe that something is wrong (inconsistent). It would: -1. remove packages NOT in local db +1. remove packages NOT in local db (skip by default, it would only print package names without `--remove-not-in-local`) 2. remove packages NOT in remote (with consideration of `--exclude`) 3. make sure all local indexes are valid, and (if --sync-packages) have valid local package files diff --git a/shadowmire.py b/shadowmire.py index 15e8784..ba90288 100755 --- a/shadowmire.py +++ b/shadowmire.py @@ -1008,7 +1008,7 @@ 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") +@click.option("--remove-not-in-local", is_flag=True, help="Do step 1 instead of skipping") @click.option( "--compare-size", is_flag=True, @@ -1020,7 +1020,7 @@ def verify( shadowmire_upstream: Optional[str], exclude: tuple[str], prerelease_exclude: tuple[str], - no_remove_not_in_local: bool, + remove_not_in_local: bool, compare_size: bool, ) -> None: basedir: Path = ctx.obj["basedir"] @@ -1036,7 +1036,7 @@ def verify( logger.info("%s packages NOT in local db", len(not_in_local)) for package_name in not_in_local: logger.debug("package %s not in local db", package_name) - if not no_remove_not_in_local: + if remove_not_in_local: syncer.do_remove(package_name) logger.info("remove packages NOT in remote")