mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Fixed for KeyboardInterrupt
This commit is contained in:
parent
afab65bfdd
commit
b8e7977236
2 changed files with 16 additions and 10 deletions
|
@ -5,6 +5,7 @@ Updated:
|
|||
- Wget options, removed -N timestamping
|
||||
Fixed:
|
||||
- Summary for upgrade packages
|
||||
- Downloader for KeyboardInterrupt
|
||||
|
||||
BugFixed:
|
||||
- Default build path /tmp/slpkg/build
|
||||
|
|
|
@ -48,21 +48,26 @@ class Downloader(Configs, Utilities):
|
|||
|
||||
def tools(self, url: str) -> None:
|
||||
""" Downloader tools wget, curl and lftp. """
|
||||
output: int = 0
|
||||
filename: str = url.split('/')[-1]
|
||||
|
||||
if self.downloader == 'wget':
|
||||
output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} '
|
||||
f'"{url}"', shell=True)
|
||||
try:
|
||||
if self.downloader == 'wget':
|
||||
output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} '
|
||||
f'"{url}"', shell=True)
|
||||
|
||||
elif self.downloader == 'curl':
|
||||
output = subprocess.call(f'{self.downloader} {self.curl_options} "{url}" --output '
|
||||
f'{self.path}/{filename}', shell=True)
|
||||
elif self.downloader == 'curl':
|
||||
output = subprocess.call(f'{self.downloader} {self.curl_options} "{url}" --output '
|
||||
f'{self.path}/{filename}', shell=True)
|
||||
|
||||
elif self.downloader == 'lftp':
|
||||
output = subprocess.call(f'lftp {self.lftp_get_options} {url} -o {self.path}', shell=True)
|
||||
elif self.downloader == 'lftp':
|
||||
output = subprocess.call(f'lftp {self.lftp_get_options} {url} -o {self.path}', shell=True)
|
||||
|
||||
else:
|
||||
raise SystemExit(f"{self.red}Error:{self.endc} Downloader '{self.downloader}' not supported.\n")
|
||||
else:
|
||||
raise SystemExit(f"{self.red}Error:{self.endc} Downloader '{self.downloader}' not supported.\n")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit(1)
|
||||
|
||||
if output != 0:
|
||||
raise SystemExit(output)
|
||||
|
|
Loading…
Reference in a new issue