From 1e506912b7e516a45db1ffa344691e8ad2c598e5 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 5 Dec 2023 20:46:32 +0200 Subject: [PATCH] Added lftp option --- ChangeLog.txt | 4 ++++ configs/slpkg.toml | 8 ++++++-- slpkg/configs.py | 2 ++ slpkg/update_repositories.py | 8 ++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1b719461..fbee6103 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,9 @@ ## slpkg - ChangeLog +### 4.9.4 - 04/12/2023 +- Added: + * lftp_exclude extra option to it's ignore some not useful files + ### 4.9.3 - 28/11/2023 - Updated: * [Tracking] Returns the complete list of dependencies of a package diff --git a/configs/slpkg.toml b/configs/slpkg.toml index 8d196df6..1893133a 100644 --- a/configs/slpkg.toml +++ b/configs/slpkg.toml @@ -1,6 +1,6 @@ # This is the general configuration file of slpkg: # /etc/slpkg/slpkg.toml -# Date: 24/04/2023, Version: 4.8.3 +# Date: 04/12/2023, Version: 4.9.4 [CONFIGS] @@ -107,8 +107,12 @@ CURL_OPTIONS = "" # Lftp donwloader options. LFTP_GET_OPTIONS = "-c get -e" -# Lftp mirror options are used to synchronize with the repositories. +# Lftp mirror options are used to synchronize with the SBo and Ponce repositories +# or for the locals repositories. LFTP_MIRROR_OPTIONS = "-c mirror --parallel=100 --only-newer" +# Addition extra option for lftp command to exclude some not useful files +# from SBo repository. +LFTP_EXCLUDE = "-X SLACKBUILDS.TXT.gz -X CHECKSUMS.md5.asc -X 'TAGS.txt*' -X '*.tar.gz*'" # If you are going to use a proxy server, try to fill in these variables. # Choose between http or socks proxy type. diff --git a/slpkg/configs.py b/slpkg/configs.py index ff4b5a9d..d17851a0 100644 --- a/slpkg/configs.py +++ b/slpkg/configs.py @@ -39,6 +39,7 @@ class Configs: curl_options: str = '' lftp_get_options: str = '-c get -e' lftp_mirror_options: str = '-c mirror --parallel=100 --only-newer' + lftp_exclude: str = "-X SLACKBUILDS.TXT.gz -X CHECKSUMS.md5.asc -X 'TAGS.txt*' -X '*.tar.gz*'" silent_mode: bool = True ascii_characters: bool = True ask_question: bool = True @@ -78,6 +79,7 @@ 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_exclude: str = config['LFTP_EXCLUDE'] silent_mode: bool = config['SILENT_MODE'] ascii_characters: bool = config['ASCII_CHARACTERS'] file_list_suffix: str = config['FILE_LIST_SUFFIX'] diff --git a/slpkg/update_repositories.py b/slpkg/update_repositories.py index d11e41cc..fb621a09 100644 --- a/slpkg/update_repositories.py +++ b/slpkg/update_repositories.py @@ -632,8 +632,8 @@ 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.repos.ponce_repo_mirror[0]} ' - f'{self.repos.ponce_repo_path}') + lftp_command: str = (f'lftp {self.lftp_mirror_options} {self.lftp_exclude} ' + f'{self.repos.ponce_repo_mirror[0]} {self.repos.ponce_repo_path}') self.utils.process(lftp_command) @@ -651,8 +651,8 @@ 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.repos.sbo_repo_mirror[0]} ' - f'{self.repos.sbo_repo_path}') + lftp_command: str = (f'lftp {self.lftp_mirror_options} {self.lftp_exclude} ' + f'{self.repos.sbo_repo_mirror[0]} {self.repos.sbo_repo_path}') self.utils.process(lftp_command)