Updated for lftp

This commit is contained in:
Dimitris Zlatanidis 2023-03-01 22:47:53 +02:00
parent 8fd405cd35
commit 519b6d3fbf
2 changed files with 6 additions and 8 deletions

View file

@ -50,6 +50,7 @@
DIALOG = true
# You can choose downloader between wget and curl.
# Ponce repository works only with 'lftp' downloader.
# Default is wget. [wget/curl/lftp].
DOWNLOADER = "wget"
@ -66,6 +67,8 @@
CURL_OPTIONS = ""
# Lftp downloader options.
# 'LFTP_MIRROR_OPTIONS' are used for the ponce repository to download files
# from a remote directory, and 'LFTP_GET_OPTIONS' are used to download the sources.
LFTP_MIRROR_OPTIONS = "--delete-first --parallel=10"
LFTP_GET_OPTIONS = "-e"
@ -80,6 +83,7 @@
# Set the 'PONCE_REPO = true' to switch with the ponce repository.
# Do not unset SBO_REPO_URL and SBO_TXT.
# NOTE: Ponce repository works only with 'lftp' downloader.
#########################################################################
# This is not going to fully support this repository, since it does not #
# provide its own SLACKBUILDS.TXT file. The only difference is that #

View file

@ -52,9 +52,7 @@ class Downloader(Configs, Utilities):
stdout=self.stdout)
elif self.downloader == 'lftp':
print('-------------->', self.url)
if self.url.endswith('/'):
if 'ponce' in self.url:
self.output = subprocess.call(f"lftp -c 'mirror {self.lftp_mirror_options} {self.url} {self.path} ;exit'",
shell=True, stderr=self.stderr, stdout=self.stdout)
# Create /path/name.Slackbuild
@ -91,7 +89,7 @@ class Downloader(Configs, Utilities):
def check_if_downloaded(self) -> NoReturn:
""" Checks if the file downloaded. """
if not self.ponce_repo and 'ponce' not in self.url:
if 'ponce' not in self.url:
url: str = unquote(self.url)
file: str = url.split('/')[-1]
path_file = Path(self.path, file)
@ -110,10 +108,6 @@ class Downloader(Configs, Utilities):
message: str = f'[{self.green}Downloading{self.endc}]'
# Starting multiprocessing
# if self.ponce_repo and 'ponce' in self.url:
# p1 = Process(target=self.lftp)
# else:
# p1 = Process(target=self.transfer_tools)
p1 = Process(target=self.transfer_tools)
p2 = Process(target=self.progress.bar, args=(message, self.filename))