From c8b85971c97a5ac4fd6f18e32ef6bc3bbbe13cfa Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 29 Apr 2018 12:17:26 +0200 Subject: [PATCH] Fixed: aria2c downloading files Signed-off-by: Dimitris Zlatanidis --- conf/slpkg.conf | 4 ++-- slpkg/downloader.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/conf/slpkg.conf b/conf/slpkg.conf index a7fc8ba4..8c9d174e 100644 --- a/conf/slpkg.conf +++ b/conf/slpkg.conf @@ -98,8 +98,8 @@ DOWNDER=wget # Downloader [OPTION]. Pass downloader options, for curl use "-L -o" as # using to download in specific directory and support any redirects -# such as from sourceforge repository. No extra option need for aria2c -# by default to work. Http recommended "-d -c -o" options by default. +# such as from sourceforge repository. aria2c recommended "--allow-overwrite" +# options by default. Http recommended "-d -c -o" options by default. # Default for wget is "-c -N". DOWNDER_OPTIONS=-c -N diff --git a/slpkg/downloader.py b/slpkg/downloader.py index b5405405..9aafe118 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -65,11 +65,16 @@ class Download(object): dwn_count, len(self.url), self.meta.color["GREEN"], self.meta.color["ENDC"], self.file_name)) - if self.downder in ["wget", "aria2c"]: + if self.downder in ["wget"]: subprocess.call("{0} {1} {2}{3} {4}".format( self.downder, self.downder_options, self.dir_prefix, self.path, dwn), shell=True) + if self.downder in ["aria2c"]: + subprocess.call("{0} {1} {2}{3} {4}".format( + self.downder, self.downder_options, + self.dir_prefix, self.path[:-1], dwn), + shell=True) elif self.downder in ["curl", "http"]: subprocess.call("{0} {1} {2}{3} {4}".format( self.downder, self.downder_options,