Updated for lftp options

This commit is contained in:
Dimitris Zlatanidis 2023-03-01 22:53:19 +02:00
parent 519b6d3fbf
commit 349c74b63f
2 changed files with 4 additions and 21 deletions

View file

@ -69,8 +69,8 @@
# 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"
LFTP_MIRROR_OPTIONS = "-c mirror --delete-first --parallel=10"
LFTP_GET_OPTIONS = "-c get -e"
# If silent mode is true, it does not print the commands as they are executed.
# Default is true. [true/false].

View file

@ -53,7 +53,7 @@ class Downloader(Configs, Utilities):
elif self.downloader == 'lftp':
if 'ponce' in self.url:
self.output = subprocess.call(f"lftp -c 'mirror {self.lftp_mirror_options} {self.url} {self.path} ;exit'",
self.output = subprocess.call(f"lftp {self.lftp_mirror_options} {self.url} {self.path}",
shell=True, stderr=self.stderr, stdout=self.stdout)
# Create /path/name.Slackbuild
slackbuild = Path(self.path, f'{str(self.path).split("/")[-1]}.SlackBuild')
@ -61,7 +61,7 @@ class Downloader(Configs, Utilities):
if slackbuild.is_file():
os.chmod(slackbuild, 0o775)
else:
self.output = subprocess.call(f"lftp -c 'get {self.lftp_get_options} {self.url} -o {self.path} ;exit'",
self.output = subprocess.call(f"lftp {self.lftp_get_options} {self.url} -o {self.path}",
shell=True, stderr=self.stderr, stdout=self.stdout)
else:
@ -70,23 +70,6 @@ class Downloader(Configs, Utilities):
if self.output != 0:
raise SystemExit(self.output)
# def lftp(self) -> NoReturn:
# """ Downloads scripts from ponce repository.
#
# PONCE URL: https://cgit.ponce.cc/slackbuilds/plain/
# """
# self.output = subprocess.call(f"lftp -c 'mirror {self.lftp_options} {self.url} {self.path} ;exit'",
# shell=True, stderr=self.stderr, stdout=self.stdout)
#
# # Create /path/name.Slackbuild
# slackbuild = Path(self.path, f'{str(self.path).split("/")[-1]}.SlackBuild')
#
# if slackbuild.is_file():
# os.chmod(slackbuild, 0o775)
#
# if self.output != 0:
# raise SystemExit(self.output)
def check_if_downloaded(self) -> NoReturn:
""" Checks if the file downloaded. """
if 'ponce' not in self.url: