From 2985c2c01b74b0aae1dc4cc0c60d982a3edba99d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 9 May 2024 22:35:10 +0300 Subject: [PATCH] Fixed for repositories Signed-off-by: Dimitris Zlatanidis --- configs/repositories.toml | 6 ++++-- slpkg/repositories.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configs/repositories.toml b/configs/repositories.toml index f9a7bdd3..f25b8e08 100644 --- a/configs/repositories.toml +++ b/configs/repositories.toml @@ -36,12 +36,14 @@ REPOSITORY = "sbo" [NEW_PACKAGES] # Configure the repositories that you want new packages to be added -# when upgrading installed packages. Example ["slack", "gnome"]. +# when upgrading installed packages. Only useful for repositories that +# are fully installed on the system. Example ["slack", "gnome"]. REPOSITORIES = [] [REMOVE_PACKAGES] # Configure the repositories that you want to remove installed packages -# that no longer exist in the repository. Example ["slack", "gnome"]. +# that no longer exist in the repository. Only useful for repositories +# that are fully installed on the system. Example ["slack", "gnome"]. REPOSITORIES = [] [SBO] diff --git a/slpkg/repositories.py b/slpkg/repositories.py index 0c357ef9..2ba157b1 100644 --- a/slpkg/repositories.py +++ b/slpkg/repositories.py @@ -31,7 +31,7 @@ class Repositories: # pylint: disable=[R0902] repos_config = {} repositories = {} - repos_toml = {} # type: ignore[var-annotated] + repos_toml = {} data_json: str = 'data.json' repos_information: Path = Path(repositories_path, 'repos_information.json') @@ -444,7 +444,9 @@ class Repositories: # pylint: disable=[R0902] defaults_repos = list(repositories.keys()) diff_repos = list(set(all_repos) - set(defaults_repos)) - diff_repos.remove('default') + items_to_remove = ('default', 'new_packages', 'remove_packages') + for item in items_to_remove: + diff_repos.remove(item) if diff_repos: for repo, data in repos_config.items():