mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Updated for binary repo option
This commit is contained in:
parent
d2ae4788e9
commit
3ca6fad9e1
3 changed files with 16 additions and 3 deletions
|
@ -17,6 +17,7 @@ class BinQueries(Configs):
|
|||
self.repo: str = repo
|
||||
self.session = Session
|
||||
self.repos = Repositories()
|
||||
self.bin_repo: list = []
|
||||
|
||||
if self.repo is None or self.repo == '*':
|
||||
self.bin_repo: list = self.repos.enabled_repositories
|
||||
|
|
|
@ -79,7 +79,7 @@ class Argparse(Configs):
|
|||
self.flag_short_parallel: str = '-P'
|
||||
self.flag_binary: str = '--binary'
|
||||
self.flag_short_binary: str = '-B'
|
||||
self.flag_bin_repository: str = '--repository='
|
||||
self.flag_bin_repository: str = '--bin-repo='
|
||||
self.flag_short_bin_repository: str = '-O='
|
||||
self.flag_directory: str = '--directory='
|
||||
self.flag_short_directory: str = '-z='
|
||||
|
@ -279,6 +279,18 @@ class Argparse(Configs):
|
|||
|
||||
self.check = Check(self.flags)
|
||||
self.check.is_blacklist(self.args[1:])
|
||||
self.check_for_repositories()
|
||||
|
||||
def check_for_repositories(self):
|
||||
""" Checks combination for binaries use repositories only and if repository exists. """
|
||||
if (self.utils.is_option([self.flag_bin_repository, self.flag_short_bin_repository], self.flags) and not
|
||||
self.utils.is_option([self.flag_binary, self.flag_short_binary], self.flags)):
|
||||
print(f"{self.prog_name}: invalid combination '{', '.join(self.flags)}'")
|
||||
self.usage.help_minimal()
|
||||
|
||||
if self.binary_repo and self.binary_repo not in self.repos.binaries_repositories_dict.keys():
|
||||
print(f"{self.prog_name}: invalid binary repository '{self.binary_repo}'")
|
||||
self.usage.help_minimal()
|
||||
|
||||
def invalid_options(self) -> None:
|
||||
""" Checks for invalid options. """
|
||||
|
|
|
@ -40,7 +40,7 @@ class Usage(Configs):
|
|||
f' slpkg [{self.yellow}OPTIONS{self.endc}] [-y, --yes, -j, --jobs, -o, --resolve-off, -r, --reinstall]\n'
|
||||
f' slpkg [{self.yellow}OPTIONS{self.endc}] [-k, --skip-installed, -E, --full-reverse, -S, --search]\n'
|
||||
f' slpkg [{self.yellow}OPTIONS{self.endc}] [-n, --no-silent, -p, --pkg-version, -G, --generate-only]\n'
|
||||
f' slpkg [{self.yellow}OPTIONS{self.endc}] [-P, --parallel, -B, --binary, -O, --repository=[REPO]]\n'
|
||||
f' slpkg [{self.yellow}OPTIONS{self.endc}] [-P, --parallel, -B, --binary, -O, --bin-repo=[REPO]]\n'
|
||||
f' slpkg [{self.yellow}OPTIONS{self.endc}] [-z, --directory=[PATH]]\n'
|
||||
" \nIf you need more information please try 'slpkg --help'.")
|
||||
|
||||
|
@ -83,7 +83,7 @@ class Usage(Configs):
|
|||
f' {self.yellow}-G, --generate-only{self.endc} Generates only the SLACKBUILDS.TXT file.\n'
|
||||
f' {self.yellow}-P, --parallel{self.endc} Download files in parallel.\n'
|
||||
f' {self.yellow}-B, --binary{self.endc} Switch with binaries repositories.\n'
|
||||
f' {self.yellow}-O, --repository={self.endc}[REPO] Set the binary repository.\n'
|
||||
f' {self.yellow}-O, --bin-repo={self.endc}[REPO] Set the binary repository.\n'
|
||||
f' {self.yellow}-z, --directory={self.endc}[PATH] Download files to a specific path.\n'
|
||||
'\n -h, --help Show this message and exit.\n'
|
||||
' -v, --version Print version and exit.\n'
|
||||
|
|
Loading…
Reference in a new issue