From 349c74b63fdb5aefa5941d4296899511d0619c9a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Mar 2023 22:53:19 +0200 Subject: [PATCH] Updated for lftp options --- configs/slpkg.toml | 4 ++-- slpkg/downloader.py | 21 ++------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/configs/slpkg.toml b/configs/slpkg.toml index 077f17c7..b55c500e 100644 --- a/configs/slpkg.toml +++ b/configs/slpkg.toml @@ -69,8 +69,8 @@ # Lftp downloader options. # 'LFTP_MIRROR_OPTIONS' are used for the ponce repository to download files # from a remote directory, and 'LFTP_GET_OPTIONS' are used to download the sources. - LFTP_MIRROR_OPTIONS = "--delete-first --parallel=10" - LFTP_GET_OPTIONS = "-e" + LFTP_MIRROR_OPTIONS = "-c mirror --delete-first --parallel=10" + LFTP_GET_OPTIONS = "-c get -e" # If silent mode is true, it does not print the commands as they are executed. # Default is true. [true/false]. diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 6926a1e1..d8d8e370 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -53,7 +53,7 @@ class Downloader(Configs, Utilities): elif self.downloader == 'lftp': if 'ponce' in self.url: - self.output = subprocess.call(f"lftp -c 'mirror {self.lftp_mirror_options} {self.url} {self.path} ;exit'", + self.output = subprocess.call(f"lftp {self.lftp_mirror_options} {self.url} {self.path}", shell=True, stderr=self.stderr, stdout=self.stdout) # Create /path/name.Slackbuild slackbuild = Path(self.path, f'{str(self.path).split("/")[-1]}.SlackBuild') @@ -61,7 +61,7 @@ class Downloader(Configs, Utilities): if slackbuild.is_file(): os.chmod(slackbuild, 0o775) else: - self.output = subprocess.call(f"lftp -c 'get {self.lftp_get_options} {self.url} -o {self.path} ;exit'", + self.output = subprocess.call(f"lftp {self.lftp_get_options} {self.url} -o {self.path}", shell=True, stderr=self.stderr, stdout=self.stdout) else: @@ -70,23 +70,6 @@ class Downloader(Configs, Utilities): if self.output != 0: raise SystemExit(self.output) - # def lftp(self) -> NoReturn: - # """ Downloads scripts from ponce repository. - # - # PONCE URL: https://cgit.ponce.cc/slackbuilds/plain/ - # """ - # self.output = subprocess.call(f"lftp -c 'mirror {self.lftp_options} {self.url} {self.path} ;exit'", - # shell=True, stderr=self.stderr, stdout=self.stdout) - # - # # Create /path/name.Slackbuild - # slackbuild = Path(self.path, f'{str(self.path).split("/")[-1]}.SlackBuild') - # - # if slackbuild.is_file(): - # os.chmod(slackbuild, 0o775) - # - # if self.output != 0: - # raise SystemExit(self.output) - def check_if_downloaded(self) -> NoReturn: """ Checks if the file downloaded. """ if 'ponce' not in self.url: