Fixed for KeyboardInterrupt

This commit is contained in:
Dimitris Zlatanidis 2023-03-15 11:28:30 +02:00
parent afab65bfdd
commit b8e7977236
2 changed files with 16 additions and 10 deletions

View file

@ -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

View file

@ -48,8 +48,10 @@ class Downloader(Configs, Utilities):
def tools(self, url: str) -> None:
""" Downloader tools wget, curl and lftp. """
output: int = 0
filename: str = url.split('/')[-1]
try:
if self.downloader == 'wget':
output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} '
f'"{url}"', shell=True)
@ -64,6 +66,9 @@ class Downloader(Configs, Utilities):
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)