mirror of
https://github.com/taoky/shadowmire.git
synced 2025-07-08 09:12:43 +00:00
Add --no-remove-not-in-local for verify
This commit is contained in:
parent
fcb8f8bfee
commit
2bdb9355cf
@ -975,12 +975,16 @@ 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"
|
||||||
|
)
|
||||||
def verify(
|
def verify(
|
||||||
ctx: click.Context,
|
ctx: click.Context,
|
||||||
sync_packages: bool,
|
sync_packages: bool,
|
||||||
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,
|
||||||
) -> None:
|
) -> None:
|
||||||
basedir: Path = ctx.obj["basedir"]
|
basedir: Path = ctx.obj["basedir"]
|
||||||
local_db: LocalVersionKV = ctx.obj["local_db"]
|
local_db: LocalVersionKV = ctx.obj["local_db"]
|
||||||
@ -993,6 +997,7 @@ def verify(
|
|||||||
simple_dirs = set([i.name for i in (basedir / "simple").iterdir() if i.is_dir()])
|
simple_dirs = set([i.name for i in (basedir / "simple").iterdir() if i.is_dir()])
|
||||||
for package_name in simple_dirs - local_names:
|
for package_name in simple_dirs - local_names:
|
||||||
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:
|
||||||
syncer.do_remove(package_name)
|
syncer.do_remove(package_name)
|
||||||
|
|
||||||
logger.info("remove packages NOT in remote")
|
logger.info("remove packages NOT in remote")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user