From 91a7c2edfb731e8f6ed65a6c122b32fa270d896a Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 7 Sep 2019 12:07:22 +0800 Subject: [PATCH] repo: remove archived packages when a pkg is removed from repo --- repo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repo.py b/repo.py index 3980417..53d45f9 100755 --- a/repo.py +++ b/repo.py @@ -317,6 +317,12 @@ def _remove(pkgnames, target_archs=[a for a in ARCHS if a != 'any']): logger.info("repo-remove: %s", repo_remove(remove_pkgs)) else: logger.warning(f'Nothing to remove in {arch}') + archive_dir = Path('archive') + for fpath in archive_dir.iterdir(): + nosigname = fpath.name[:-4] if fpath.name.endswith('.sig') else fpath.name + if nosigname.endswith(PKG_SUFFIX) and \ + get_pkg_details_from_name(nosigname).pkgname in pkgnames: + throw_away(fpath) logger.info('finished remove') return True