Change --not-remove-not-in-local to --remove-not-in-local

This commit is contained in:
taoky 2024-08-06 22:09:36 +08:00
parent baef090078
commit 5585de30ce
3 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ venv/
packages/ packages/
json/ json/
config.toml config.toml
remote_excluded.json

View File

@ -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: 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`) 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 3. make sure all local indexes are valid, and (if --sync-packages) have valid local package files

View File

@ -1008,7 +1008,7 @@ def genlocal(ctx: click.Context) -> None:
) )
@click.pass_context @click.pass_context
@sync_shared_args @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( @click.option(
"--compare-size", "--compare-size",
is_flag=True, is_flag=True,
@ -1020,7 +1020,7 @@ def verify(
shadowmire_upstream: Optional[str], shadowmire_upstream: Optional[str],
exclude: tuple[str], exclude: tuple[str],
prerelease_exclude: tuple[str], prerelease_exclude: tuple[str],
no_remove_not_in_local: bool, remove_not_in_local: bool,
compare_size: bool, compare_size: bool,
) -> None: ) -> None:
basedir: Path = ctx.obj["basedir"] basedir: Path = ctx.obj["basedir"]
@ -1036,7 +1036,7 @@ def verify(
logger.info("%s packages NOT in local db", len(not_in_local)) logger.info("%s packages NOT in local db", len(not_in_local))
for package_name in not_in_local: for package_name in not_in_local:
logger.debug("package %s not in local db", package_name) 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) syncer.do_remove(package_name)
logger.info("remove packages NOT in remote") logger.info("remove packages NOT in remote")