diff --git a/slpkg/update_repositories.py b/slpkg/update_repositories.py index 211d53b8..8cb5072f 100644 --- a/slpkg/update_repositories.py +++ b/slpkg/update_repositories.py @@ -105,14 +105,7 @@ class UpdateRepositories(Configs): # pylint: disable=[R0902] repo (str): Repository name. """ urls: dict = {} - - self.utils.create_directory(self.repos.repositories[repo]['path']) - self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], - self.repos.repositories[repo]['changelog_txt']) - self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], - self.repos.repositories[repo]['packages_txt']) - self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], - self.repos.repositories[repo]['checksums_md5']) + self.import_gpg_key(mirror=self.repos.repositories[repo]['mirror_changelog']) changelog: str = (f"{self.repos.repositories[repo]['mirror_changelog']}" f"{self.repos.repositories[repo]['changelog_txt']}") @@ -123,7 +116,14 @@ class UpdateRepositories(Configs): # pylint: disable=[R0902] urls[repo] = ((changelog, packages, checksums), self.repos.repositories[repo]['path']) - self.import_gpg_key(mirror=self.repos.repositories[repo]['mirror_changelog']) + self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], + self.repos.repositories[repo]['changelog_txt']) + self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], + self.repos.repositories[repo]['packages_txt']) + self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], + self.repos.repositories[repo]['checksums_md5']) + + self.utils.create_directory(self.repos.repositories[repo]['path']) self.download.download(urls) @@ -135,18 +135,19 @@ class UpdateRepositories(Configs): # pylint: disable=[R0902] Args: repo (str): Repository name. """ - self.utils.create_directory(self.repos.repositories[repo]['path']) + self.import_gpg_key(mirror='https://www.slackbuilds.org/') + self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], self.repos.repositories[repo]['slackbuilds_txt']) self.utils.remove_file_if_exists(self.repos.repositories[repo]['path'], self.repos.repositories[repo]['changelog_txt']) + self.utils.create_directory(self.repos.repositories[repo]['path']) + lftp_command: str = (f"lftp {self.lftp_mirror_options} " f"{self.repos.repositories[repo]['mirror_packages']} " f"{self.repos.repositories[repo]['path']}") - self.import_gpg_key(mirror='https://www.slackbuilds.org/') - self.multi_process.process(lftp_command) # It checks if there is a SLACKBUILDS.TXT file, otherwise it's going to create one.