Merge "Enhance package deletion"
This commit is contained in:
commit
59c8b237a7
@ -146,9 +146,41 @@ class Repo:
|
||||
config = self.repo.joinpath("conf/distributions")
|
||||
|
||||
if utils.remove_component_from_config(config, component):
|
||||
utils.run_command(
|
||||
["reprepro", "-b", str(self.repo), "clearvanished"],
|
||||
check=True)
|
||||
dist_component = self.repo.joinpath(
|
||||
f"dists/bullseye/{component}")
|
||||
pool_component = self.repo.joinpath(f"pool/{component}")
|
||||
|
||||
try:
|
||||
utils.run_command(
|
||||
["rm", "-r", str(dist_component)],
|
||||
check=True)
|
||||
except Exception:
|
||||
self.logging.info(f"Could not remove {dist_component},"
|
||||
" skipping anyway\n")
|
||||
try:
|
||||
utils.run_command(
|
||||
["rm", "-r", str(pool_component)],
|
||||
check=True)
|
||||
except Exception:
|
||||
self.logging.info(f"Could not remove {pool_component},"
|
||||
" skipping anyway\n")
|
||||
try:
|
||||
utils.run_command(
|
||||
["reprepro", "-b", str(self.repo),
|
||||
"--delete", "clearvanished"],
|
||||
check=True)
|
||||
except Exception:
|
||||
self.logging.info("Could not run reprepro clearvanished,"
|
||||
" skipping anyway\n")
|
||||
try:
|
||||
utils.run_command(
|
||||
["reprepro", "-b", str(self.repo),
|
||||
"deleteunreferenced"],
|
||||
check=True)
|
||||
except Exception:
|
||||
self.logging.info("Could not run reprepro "
|
||||
"deleteunreferenced, skipping anyway\n")
|
||||
|
||||
self.logging.info(f"Removed component {component}\n")
|
||||
else:
|
||||
self.logging.error(f"Failed to remove component {component}\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user