mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-09 08:46:07 +01:00
Updated check repositories
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
1447c6c2f1
commit
d972a665fd
2 changed files with 13 additions and 9 deletions
|
@ -794,13 +794,13 @@ class Update:
|
||||||
def check_exists_repositories(repo):
|
def check_exists_repositories(repo):
|
||||||
"""Checking if repositories exists by PACKAGES.TXT file
|
"""Checking if repositories exists by PACKAGES.TXT file
|
||||||
"""
|
"""
|
||||||
pkg_list = ""
|
pkg_list = "PACKAGES.TXT"
|
||||||
if repo == "sbo":
|
if repo == "sbo":
|
||||||
pkg_list = "SLACKBUILDS.TXT"
|
pkg_list = "SLACKBUILDS.TXT"
|
||||||
if check_for_local_repos(repo) is True:
|
elif check_for_local_repos(repo) is True:
|
||||||
pkg_list = "PACKAGES.TXT"
|
pkg_list = "PACKAGES.TXT"
|
||||||
if not os.path.isfile(f"{_meta_.lib_path}{repo}_repo/{pkg_list}"):
|
if not os.path.isfile(f"{_meta_.lib_path}{repo}_repo/{pkg_list}"):
|
||||||
return repo
|
return False
|
||||||
|
|
||||||
|
|
||||||
def check_for_local_repos(repo):
|
def check_for_local_repos(repo):
|
||||||
|
|
|
@ -88,11 +88,7 @@ class ArgParse(BlackList):
|
||||||
"clean"
|
"clean"
|
||||||
]
|
]
|
||||||
|
|
||||||
# checking if repositories exists
|
options = [
|
||||||
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 [
|
|
||||||
"-c", "--check",
|
"-c", "--check",
|
||||||
"-l", "--list",
|
"-l", "--list",
|
||||||
"-c", "--check",
|
"-c", "--check",
|
||||||
|
@ -101,7 +97,15 @@ class ArgParse(BlackList):
|
||||||
"-p", "--desc",
|
"-p", "--desc",
|
||||||
"-F", "--FIND",
|
"-F", "--FIND",
|
||||||
"-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"
|
print("\n Please update the packages lists. Run 'slpkg update'.\n"
|
||||||
" This command should be used to synchronize the packages\n"
|
" This command should be used to synchronize the packages\n"
|
||||||
" lists from the repositories that are enabled.\n")
|
" lists from the repositories that are enabled.\n")
|
||||||
|
|
Loading…
Add table
Reference in a new issue