mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-25 09:58:41 +01:00
Removed lftp extra options
This commit is contained in:
parent
2113b81786
commit
924685b15f
4 changed files with 2 additions and 20 deletions
|
@ -124,12 +124,6 @@ LFTP_GET_OPTIONS = "-c get -e"
|
|||
# Ponce repositories or for the local repositories.
|
||||
LFTP_MIRROR_OPTIONS = "-c mirror --parallel=100 --only-newer --delete"
|
||||
|
||||
# Extra lftp options by repository, using a key = value pair.
|
||||
# Example, if you want to exclude some files or directories:
|
||||
# {"slack" = "-x source/ -x patches/", "sbo" = "-x '*.tar.gz*'"}
|
||||
# Be sure of the name, as set it in the /etc/slpkg/repositories.toml file.
|
||||
LFTP_MIRROR_EXTRA_OPTIONS = {}
|
||||
|
||||
# Python urllib3 settings used for checking between two changelog files.
|
||||
# Timeouts allow you to control how long (in seconds) requests are allowed
|
||||
# to run before being aborted. In simple cases, you can specify a timeout
|
||||
|
|
|
@ -50,7 +50,6 @@ class Configs:
|
|||
curl_options: str = ''
|
||||
lftp_get_options: str = '-c get -e'
|
||||
lftp_mirror_options: str = '-c mirror --parallel=100 --only-newer --delete'
|
||||
lftp_mirror_extra_options = {}
|
||||
ascii_characters: bool = True
|
||||
ask_question: bool = True
|
||||
parallel_downloads: bool = False
|
||||
|
@ -97,7 +96,6 @@ class Configs:
|
|||
curl_options: str = config['CURL_OPTIONS']
|
||||
lftp_get_options: str = config['LFTP_GET_OPTIONS']
|
||||
lftp_mirror_options: str = config['LFTP_MIRROR_OPTIONS']
|
||||
lftp_mirror_extra_options = config['LFTP_MIRROR_EXTRA_OPTIONS']
|
||||
ascii_characters: bool = config['ASCII_CHARACTERS']
|
||||
file_list_suffix: str = config['FILE_LIST_SUFFIX']
|
||||
parallel_downloads: bool = config['PARALLEL_DOWNLOADS']
|
||||
|
|
|
@ -133,7 +133,6 @@ class FormConfigs(Configs):
|
|||
'SPINNING_BAR =',
|
||||
'CASE_SENSITIVE =',
|
||||
'PROCESS_LOG =',
|
||||
'LFTP_MIRROR_EXTRA_OPTIONS =',
|
||||
'URLLIB_RETRIES =',
|
||||
'URLLIB_REDIRECT =',
|
||||
'URLLIB_TIMEOUT =',
|
||||
|
|
|
@ -34,7 +34,6 @@ class UpdateRepositories(Configs):
|
|||
self.download = Downloader(flags)
|
||||
|
||||
self.repos_for_update: dict = {}
|
||||
self.lftp_extra_options: str = ' '
|
||||
|
||||
self.option_for_repository: bool = self.utils.is_option(
|
||||
('-o', '--repository'), flags)
|
||||
|
@ -74,22 +73,16 @@ class UpdateRepositories(Configs):
|
|||
|
||||
if self.option_for_repository:
|
||||
self.view_downloading_message(self.repository)
|
||||
self.set_lftp_extra_options(self.repository)
|
||||
repositories[self.repository]()
|
||||
else:
|
||||
for repo, update in self.repos_for_update.items():
|
||||
if update:
|
||||
self.view_downloading_message(repo)
|
||||
self.set_lftp_extra_options(repo)
|
||||
repositories[repo]()
|
||||
|
||||
def view_downloading_message(self, repo: str) -> None:
|
||||
print(f"Syncing with the repository '{self.green}{repo}{self.endc}', please wait...\n")
|
||||
|
||||
def set_lftp_extra_options(self, repository: str) -> None:
|
||||
if self.lftp_mirror_extra_options.get(repository):
|
||||
self.lftp_extra_options: str = f' {self.lftp_mirror_extra_options[repository]} '
|
||||
|
||||
def slack_repository(self) -> None:
|
||||
urls: dict = {}
|
||||
self.utils.create_directory(self.repos.slack_repo_path)
|
||||
|
@ -402,8 +395,7 @@ class UpdateRepositories(Configs):
|
|||
self.utils.remove_file_if_exists(self.repos.ponce_repo_path, self.repos.ponce_repo_slackbuilds)
|
||||
self.utils.remove_file_if_exists(self.repos.ponce_repo_path, self.repos.ponce_repo_changelog)
|
||||
|
||||
lftp_command: str = (f'lftp {self.lftp_mirror_options}{self.lftp_extra_options}'
|
||||
f'{self.repos.ponce_repo_mirror[0]} {self.repos.ponce_repo_path}')
|
||||
lftp_command: str = f'lftp {self.lftp_mirror_options} {self.repos.ponce_repo_mirror[0]} {self.repos.ponce_repo_path}'
|
||||
|
||||
self.multi_process.process(lftp_command)
|
||||
|
||||
|
@ -418,8 +410,7 @@ class UpdateRepositories(Configs):
|
|||
self.utils.remove_file_if_exists(self.repos.sbo_repo_path, self.repos.sbo_repo_slackbuilds)
|
||||
self.utils.remove_file_if_exists(self.repos.sbo_repo_path, self.repos.sbo_repo_changelog)
|
||||
|
||||
lftp_command: str = (f'lftp {self.lftp_mirror_options}{self.lftp_extra_options}'
|
||||
f'{self.repos.sbo_repo_mirror[0]} {self.repos.sbo_repo_path}')
|
||||
lftp_command: str = f'lftp {self.lftp_mirror_options} {self.repos.sbo_repo_mirror[0]} {self.repos.sbo_repo_path}'
|
||||
|
||||
self.multi_process.process(lftp_command)
|
||||
|
||||
|
|
Loading…
Reference in a new issue