From 235519f9915b4f676ac32cfc85bb1c53d061c456 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 30 May 2023 22:40:59 +0300 Subject: [PATCH] Updated for download --- slpkg/update_repository.py | 81 +++++++++++++++----------------------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index b2c2e337..0ed3392c 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -113,9 +113,7 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.slack_repo_mirror[0]}{self.repos.slack_repo_packages}' checksums: str = f'{self.repos.slack_repo_mirror[0]}{self.repos.slack_repo_checksums}' - urls[changelog] = self.repos.slack_repo_path - urls[packages] = self.repos.slack_repo_path - urls[checksums] = self.repos.slack_repo_path + urls[self.repos.slack_repo_name] = ((changelog, packages, checksums), self.repos.slack_repo_path) self.download.download(urls) print() @@ -134,9 +132,9 @@ class UpdateRepository(Configs): self.utils.remove_file_if_exists(self.repos.slack_extra_repo_path, self.repos.slack_extra_repo_checksums) changelog: str = f'{self.repos.slack_extra_repo_mirror[0]}{self.repos.slack_extra_repo_changelog}' - urls[changelog] = self.repos.slack_extra_repo_path if self.repos.slack_extra_repo_local[0].startswith('file'): + urls[self.repos.slack_extra_repo_name] = ((changelog,), self.repos.slack_extra_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.slack_extra_repo_mirror)} ' f'{self.repos.slack_extra_repo_path}' @@ -145,9 +143,8 @@ class UpdateRepository(Configs): else: packages: str = f'{"".join(self.repos.slack_extra_repo_mirror)}{self.repos.slack_extra_repo_packages}' checksums: str = f'{"".join(self.repos.slack_extra_repo_mirror)}{self.repos.slack_extra_repo_checksums}' - - urls[packages] = self.repos.slack_extra_repo_path - urls[checksums] = self.repos.slack_extra_repo_path + urls[self.repos.slack_extra_repo_name] = ((changelog, packages, checksums), + self.repos.slack_extra_repo_path) self.download.download(urls) print() @@ -169,9 +166,9 @@ class UpdateRepository(Configs): self.repos.slack_patches_repo_checksums) changelog: str = f'{self.repos.slack_patches_repo_mirror[0]}{self.repos.slack_patches_repo_changelog}' - urls[changelog] = self.repos.slack_patches_repo_path if self.repos.slack_patches_repo_local[0].startswith('file'): + urls[self.repos.slack_patches_repo_name] = ((changelog,), self.repos.slack_patches_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.slack_patches_repo_mirror)} ' f'{self.repos.slack_patches_repo_path}' @@ -183,8 +180,8 @@ class UpdateRepository(Configs): checksums: str = (f'{"".join(self.repos.slack_patches_repo_mirror)}' f'{self.repos.slack_patches_repo_checksums}') - urls[packages] = self.repos.slack_patches_repo_path - urls[checksums] = self.repos.slack_patches_repo_path + urls[self.repos.slack_patches_repo_name] = ((changelog, packages, checksums), + self.repos.slack_patches_repo_path) self.download.download(urls) print() @@ -203,9 +200,9 @@ class UpdateRepository(Configs): self.utils.remove_file_if_exists(self.repos.alien_repo_path, self.repos.alien_repo_checksums) changelog: str = f'{self.repos.alien_repo_mirror[0]}{self.repos.alien_repo_changelog}' - urls[changelog] = self.repos.alien_repo_path if self.repos.alien_repo_local[0].startswith('file'): + urls[self.repos.alien_repo_name] = ((changelog,), self.repos.alien_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.alien_repo_mirror)} ' f'{self.repos.alien_repo_path}' @@ -215,8 +212,8 @@ class UpdateRepository(Configs): packages: str = f'{"".join(self.repos.alien_repo_mirror)}{self.repos.alien_repo_packages}' checksums: str = f'{"".join(self.repos.alien_repo_mirror)}{self.repos.alien_repo_checksums}' - urls[packages] = self.repos.alien_repo_path - urls[checksums] = self.repos.alien_repo_path + urls[self.repos.alien_repo_name] = ((changelog, packages, checksums), + self.repos.alien_repo_path) self.download.download(urls) print() @@ -235,9 +232,9 @@ class UpdateRepository(Configs): self.utils.remove_file_if_exists(self.repos.multilib_repo_path, self.repos.multilib_repo_checksums) changelog: str = f'{self.repos.multilib_repo_mirror[0]}{self.repos.multilib_repo_changelog}' - urls[changelog] = self.repos.multilib_repo_path if self.repos.multilib_repo_local[0].startswith('file'): + urls[self.repos.multilib_repo_name] = ((changelog,), self.repos.multilib_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.multilib_repo_mirror)} ' f'{self.repos.multilib_repo_path}' @@ -247,8 +244,8 @@ class UpdateRepository(Configs): packages: str = f'{"".join(self.repos.multilib_repo_mirror)}{self.repos.multilib_repo_packages}' checksums: str = f'{"".join(self.repos.multilib_repo_mirror)}{self.repos.multilib_repo_checksums}' - urls[packages] = self.repos.multilib_repo_path - urls[checksums] = self.repos.multilib_repo_path + urls[self.repos.multilib_repo_name] = ((changelog, packages, checksums), + self.repos.multilib_repo_path) self.download.download(urls) print() @@ -267,9 +264,9 @@ class UpdateRepository(Configs): self.utils.remove_file_if_exists(self.repos.restricted_repo_path, self.repos.restricted_repo_checksums) changelog: str = f'{self.repos.restricted_repo_mirror[0]}{self.repos.restricted_repo_changelog}' - urls[changelog] = self.repos.restricted_repo_path if self.repos.restricted_repo_local[0].startswith('file'): + urls[self.repos.restricted_repo_name] = ((changelog,), self.repos.restricted_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.restricted_repo_mirror)} ' f'{self.repos.restricted_repo_path}' @@ -279,8 +276,8 @@ class UpdateRepository(Configs): packages: str = f'{"".join(self.repos.restricted_repo_mirror)}{self.repos.restricted_repo_packages}' checksums: str = f'{"".join(self.repos.restricted_repo_mirror)}{self.repos.restricted_repo_checksums}' - urls[packages] = self.repos.restricted_repo_path - urls[checksums] = self.repos.restricted_repo_path + urls[self.repos.restricted_repo_name] = ((changelog, packages, checksums), + self.repos.restricted_repo_path) self.download.download(urls) print() @@ -309,9 +306,7 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.gnome_repo_mirror[0]}{self.repos.gnome_repo_packages}' checksums: str = f'{self.repos.gnome_repo_mirror[0]}{self.repos.gnome_repo_checksums}' - urls[changelog] = self.repos.gnome_repo_path - urls[packages] = self.repos.gnome_repo_path - urls[checksums] = self.repos.gnome_repo_path + urls[self.repos.gnome_repo_name] = ((changelog, packages, checksums), self.repos.gnome_repo_path) self.download.download(urls) print() @@ -330,9 +325,9 @@ class UpdateRepository(Configs): self.utils.remove_file_if_exists(self.repos.msb_repo_path, self.repos.msb_repo_checksums) changelog: str = f'{self.repos.msb_repo_mirror[0]}{self.repos.msb_repo_changelog}' - urls[changelog] = self.repos.msb_repo_path if self.repos.msb_repo_local[0].startswith('file'): + urls[self.repos.msb_repo_name] = ((changelog,), self.repos.msb_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.msb_repo_mirror)} ' f'{self.repos.msb_repo_path}' @@ -342,8 +337,7 @@ class UpdateRepository(Configs): packages: str = f'{"".join(self.repos.msb_repo_mirror)}{self.repos.msb_repo_packages}' checksums: str = f'{"".join(self.repos.msb_repo_mirror)}{self.repos.msb_repo_checksums}' - urls[packages] = self.repos.msb_repo_path - urls[checksums] = self.repos.msb_repo_path + urls[self.repos.msb_repo_name] = ((changelog, packages, checksums), self.repos.msb_repo_path) self.download.download(urls) print() @@ -372,9 +366,7 @@ class UpdateRepository(Configs): packages: str = f'{"".join(self.repos.csb_repo_mirror)}{self.repos.csb_repo_packages}' checksums: str = f'{"".join(self.repos.csb_repo_mirror)}{self.repos.csb_repo_checksums}' - urls[changelog] = self.repos.csb_repo_path - urls[packages] = self.repos.csb_repo_path - urls[checksums] = self.repos.csb_repo_path + urls[self.repos.csb_repo_name] = ((changelog, packages, checksums), self.repos.csb_repo_path) self.download.download(urls) print() @@ -403,9 +395,7 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.conraid_repo_mirror[0]}{self.repos.conraid_repo_packages}' checksums: str = f'{self.repos.conraid_repo_mirror[0]}{self.repos.conraid_repo_checksums}' - urls[changelog] = self.repos.conraid_repo_path - urls[packages] = self.repos.conraid_repo_path - urls[checksums] = self.repos.conraid_repo_path + urls[self.repos.conraid_repo_name] = ((changelog, packages, checksums), self.repos.conraid_repo_path) self.download.download(urls) print() @@ -434,9 +424,8 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.slackonly_repo_mirror[0]}{self.repos.slackonly_repo_packages}' checksums: str = f'{self.repos.slackonly_repo_mirror[0]}{self.repos.slackonly_repo_checksums}' - urls[changelog] = self.repos.slackonly_repo_path - urls[packages] = self.repos.slackonly_repo_path - urls[checksums] = self.repos.slackonly_repo_path + urls[self.repos.slackonly_repo_name] = ((changelog, packages, checksums), + self.repos.slackonly_repo_path) self.download.download(urls) print() @@ -465,9 +454,7 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.salixos_repo_mirror[0]}{self.repos.salixos_repo_packages}' checksums: str = f'{self.repos.salixos_repo_mirror[0]}{self.repos.salixos_repo_checksums}' - urls[changelog] = self.repos.salixos_repo_path - urls[packages] = self.repos.salixos_repo_path - urls[checksums] = self.repos.salixos_repo_path + urls[self.repos.salixos_repo_name] = ((changelog, packages, checksums), self.repos.salixos_repo_path) self.download.download(urls) print() @@ -489,9 +476,9 @@ class UpdateRepository(Configs): self.repos.salixos_extra_repo_checksums) changelog: str = f'{self.repos.salixos_extra_repo_mirror[0]}{self.repos.salixos_extra_repo_changelog}' - urls[changelog] = self.repos.salixos_extra_repo_path if self.repos.salixos_extra_repo_local[0].startswith('file'): + urls[self.repos.salixos_extra_repo_name] = ((changelog,), self.repos.salixos_extra_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.salixos_extra_repo_mirror)} ' f'{self.repos.salixos_extra_repo_path}' @@ -503,8 +490,8 @@ class UpdateRepository(Configs): checksums: str = (f'{"".join(self.repos.salixos_extra_repo_mirror)}' f'{self.repos.salixos_extra_repo_checksums}') - urls[packages] = self.repos.salixos_extra_repo_path - urls[checksums] = self.repos.salixos_extra_repo_path + urls[self.repos.salixos_extra_repo_name] = ((changelog, packages, checksums), + self.repos.salixos_extra_repo_path) self.download.download(urls) print() @@ -526,9 +513,9 @@ class UpdateRepository(Configs): self.repos.salixos_patches_repo_checksums) changelog: str = f'{self.repos.salixos_patches_repo_mirror[0]}{self.repos.salixos_patches_repo_changelog}' - urls[changelog] = self.repos.salixos_patches_repo_path if self.repos.salixos_patches_repo_local[0].startswith('file'): + urls[self.repos.salixos_patches_repo_name] = ((changelog,), self.repos.salixos_patches_repo_path) lftp_command: str = ( f'lftp {self.lftp_mirror_options} {"".join(self.repos.salixos_patches_repo_mirror)} ' f'{self.repos.salixos_patches_repo_path}' @@ -540,8 +527,8 @@ class UpdateRepository(Configs): checksums: str = (f'{"".join(self.repos.salixos_patches_repo_mirror)}' f'{self.repos.salixos_patches_repo_checksums}') - urls[packages] = self.repos.salixos_patches_repo_path - urls[checksums] = self.repos.salixos_patches_repo_path + urls[self.repos.salixos_patches_repo_name] = ((changelog, packages, checksums), + self.repos.salixos_patches_repo_path) self.download.download(urls) print() @@ -570,9 +557,7 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.slackel_repo_mirror[0]}{self.repos.slackel_repo_packages}' checksums: str = f'{self.repos.slackel_repo_mirror[0]}{self.repos.slackel_repo_checksums}' - urls[changelog] = self.repos.slackel_repo_path - urls[packages] = self.repos.slackel_repo_path - urls[checksums] = self.repos.slackel_repo_path + urls[self.repos.slackel_repo_name] = ((changelog, packages, checksums), self.repos.slackel_repo_path) self.download.download(urls) print() @@ -601,9 +586,7 @@ class UpdateRepository(Configs): packages: str = f'{self.repos.slint_repo_mirror[0]}{self.repos.slint_repo_packages}' checksums: str = f'{self.repos.slint_repo_mirror[0]}{self.repos.slint_repo_checksums}' - urls[changelog] = self.repos.slint_repo_path - urls[packages] = self.repos.slint_repo_path - urls[checksums] = self.repos.slint_repo_path + urls[self.repos.slint_repo_name] = ((changelog, packages, checksums), self.repos.slint_repo_path) self.download.download(urls) print()