mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Added lftp
This commit is contained in:
parent
32b5bc967a
commit
872d6696ae
4 changed files with 14 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
|||
4.5.9 - 10/03/2023
|
||||
BugFixed:
|
||||
- Default build path /tmp/slpkg/build
|
||||
Added:
|
||||
- lftp as source file downloader
|
||||
|
||||
4.5.8 - 09/03/2023
|
||||
Updated:
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
# Slackware command to remove packages.
|
||||
REMOVEPKG = "removepkg"
|
||||
|
||||
# You can choose downloader between wget and curl.
|
||||
# Default is wget. [wget/curl].
|
||||
# You can choose a downloader among wget, curl lftp.
|
||||
# Default is wget. [wget/curl/lftp].
|
||||
DOWNLOADER = "wget"
|
||||
# Wget downloader options.
|
||||
# -c, --continue: resume getting a partially-downloaded file.
|
||||
|
@ -68,5 +68,7 @@
|
|||
WGET_OPTIONS = "-c -N -q --show-progress"
|
||||
# Curl downloader options.
|
||||
CURL_OPTIONS = ""
|
||||
# Lftp downloader options are used to synchronize with the ponce repository.
|
||||
# Lftp donwloader options.
|
||||
LFTP_GET_OPTIONS = "-c get -e"
|
||||
# Lftp mirror options are used to synchronize with the ponce repository.
|
||||
LFTP_MIRROR_OPTIONS = "-c mirror --parallel=100 --only-newer"
|
||||
|
|
|
@ -103,6 +103,8 @@ class Configs:
|
|||
# Curl options.
|
||||
curl_options: str = ''
|
||||
|
||||
lftp_get_options: str = '-c get -e'
|
||||
|
||||
# Lftp options'
|
||||
lftp_mirror_options: str = '-c mirror --parallel=10 --only-newer'
|
||||
|
||||
|
@ -177,6 +179,8 @@ class Configs:
|
|||
# Curl options.
|
||||
curl_options: str = config['CURL_OPTIONS']
|
||||
|
||||
lftp_get_options: str = config['LFTP_GET_OPTIONS']
|
||||
|
||||
# Lftp options.
|
||||
lftp_mirror_options: str = config['LFTP_MIRROR_OPTIONS']
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@ class Downloader(Configs, Utilities):
|
|||
self.output = subprocess.call(f'{self.downloader} {self.curl_options} "{self.url}" --output '
|
||||
f'{self.path}/{self.filename}', shell=True, stderr=self.stderr,
|
||||
stdout=self.stdout)
|
||||
elif self.downloader == 'lftp':
|
||||
self.output = subprocess.call(f'lftp {self.lftp_get_options} {self.url} -o {self.path}',
|
||||
shell=True, stderr=self.stderr, stdout=self.stdout)
|
||||
else:
|
||||
raise SystemExit(f"{self.red}Error:{self.endc} Downloader '{self.downloader}' not supported.\n")
|
||||
|
||||
|
|
Loading…
Reference in a new issue