mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-28 19:58:18 +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
|
- Wget options, removed -N timestamping
|
||||||
Fixed:
|
Fixed:
|
||||||
- Summary for upgrade packages
|
- Summary for upgrade packages
|
||||||
|
- Downloader for KeyboardInterrupt
|
||||||
|
|
||||||
BugFixed:
|
BugFixed:
|
||||||
- Default build path /tmp/slpkg/build
|
- Default build path /tmp/slpkg/build
|
||||||
|
|
|
@ -48,8 +48,10 @@ class Downloader(Configs, Utilities):
|
||||||
|
|
||||||
def tools(self, url: str) -> None:
|
def tools(self, url: str) -> None:
|
||||||
""" Downloader tools wget, curl and lftp. """
|
""" Downloader tools wget, curl and lftp. """
|
||||||
|
output: int = 0
|
||||||
filename: str = url.split('/')[-1]
|
filename: str = url.split('/')[-1]
|
||||||
|
|
||||||
|
try:
|
||||||
if self.downloader == 'wget':
|
if self.downloader == 'wget':
|
||||||
output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} '
|
output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} '
|
||||||
f'"{url}"', shell=True)
|
f'"{url}"', shell=True)
|
||||||
|
@ -64,6 +66,9 @@ class Downloader(Configs, Utilities):
|
||||||
else:
|
else:
|
||||||
raise SystemExit(f"{self.red}Error:{self.endc} Downloader '{self.downloader}' not supported.\n")
|
raise SystemExit(f"{self.red}Error:{self.endc} Downloader '{self.downloader}' not supported.\n")
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
if output != 0:
|
if output != 0:
|
||||||
raise SystemExit(output)
|
raise SystemExit(output)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue