diff --git a/slpkg/init.py b/slpkg/init.py index f14994f2..93557574 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -794,13 +794,13 @@ class Update: def check_exists_repositories(repo): """Checking if repositories exists by PACKAGES.TXT file """ - pkg_list = "" + pkg_list = "PACKAGES.TXT" if repo == "sbo": pkg_list = "SLACKBUILDS.TXT" - if check_for_local_repos(repo) is True: + elif check_for_local_repos(repo) is True: pkg_list = "PACKAGES.TXT" if not os.path.isfile(f"{_meta_.lib_path}{repo}_repo/{pkg_list}"): - return repo + return False def check_for_local_repos(repo): diff --git a/slpkg/main.py b/slpkg/main.py index c2dbacd2..af803b51 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -88,11 +88,7 @@ class ArgParse(BlackList): "clean" ] - # checking if repositories exists - enabled_repos = _meta_.repositories - if len(self.args) > 1: - repo = check_exists_repositories(args[1]) - if len(self.args) > 1 and self.args[0] in [ + options = [ "-c", "--check", "-l", "--list", "-c", "--check", @@ -101,7 +97,15 @@ class ArgParse(BlackList): "-p", "--desc", "-F", "--FIND", "-f", "--find" - ] and self.args[1] == repo and repo in enabled_repos: + ] + + # checking if repositories exists + enabled_repos = _meta_.repositories + if len(self.args) > 1: + repo = self.args[1] + check = check_exists_repositories(repo) + if (len(self.args) > 1 and self.args[0] in options + and check is False and repo in enabled_repos): print("\n Please update the packages lists. Run 'slpkg update'.\n" " This command should be used to synchronize the packages\n" " lists from the repositories that are enabled.\n")