Updated check repositories

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-05-08 17:38:02 +03:00
parent 1447c6c2f1
commit d972a665fd
2 changed files with 13 additions and 9 deletions

View file

@ -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):

View file

@ -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")