From e97cc468a6f31060cbc9a0bfb097b125c9615349 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 1 Apr 2023 16:56:47 +0300 Subject: [PATCH] Added csb repository --- configs/repositories.toml | 75 +++++++++++++++++++-------------- slpkg/check_updates.py | 5 +++ slpkg/install_data.py | 85 ++++++++++++++++++++++++++++++++++++++ slpkg/repositories.py | 70 +++++++++++++++++++------------ slpkg/update_repository.py | 33 +++++++++++++++ 5 files changed, 210 insertions(+), 58 deletions(-) diff --git a/configs/repositories.toml b/configs/repositories.toml index bc75065f..cf9410ed 100644 --- a/configs/repositories.toml +++ b/configs/repositories.toml @@ -12,7 +12,7 @@ [REPOSITORIES] - # Repository for slackware 15.0 stable. + # Repository for Slackware x86_64 15.0 stable. SBO_REPO_NAME = "sbo" SBO_REPO_MIRROR = "https://slackbuilds.org/slackbuilds/15.0/" SBO_REPO_SLACKBUILDS = "SLACKBUILDS.TXT" @@ -20,115 +20,126 @@ SBO_REPO_TAR_SUFFIX = ".tar.gz" SBO_REPO_TAG = "_SBo" - # Repository for slackware -current. - PONCE_REPO_NAME = "ponce" + # Repository for Slackware x86_64 -current. PONCE_REPO = false + PONCE_REPO_NAME = "ponce" PONCE_REPO_MIRROR = "https://cgit.ponce.cc/slackbuilds/plain/" PONCE_REPO_SLACKBUILDS = "SLACKBUILDS.TXT" PONCE_REPO_CHANGELOG = "ChangeLog.txt" PONCE_REPO_TAG = "_SBo" - # Repository for slackware 15.0 stable. - # Mirror for -current: http://slackware.uk/people/alien/sbrepos/current/x86_64/ - ALIEN_REPO_NAME = "alien" + # Repository for Slackware x86_64 15.0 stable. + # Repository for Slackware x86_64 -current: http://slackware.uk/people/alien/sbrepos/current/x86_64/ ALIEN_REPO = false + ALIEN_REPO_NAME = "alien" ALIEN_REPO_MIRROR = "http://slackware.uk/people/alien/sbrepos/15.0/x86_64/" ALIEN_REPO_CHANGELOG_MIRROR = "http://slackware.uk/people/alien/sbrepos/" ALIEN_REPO_PACKAGES = "PACKAGES.TXT" ALIEN_REPO_CHECKSUMS = "CHECKSUMS.md5" ALIEN_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - # Mirror for -current: https://slackware.nl/people/alien/multilib/current/ - MULTILIB_REPO_NAME = "multilib" + # Repository for Slackware x86_64 15.0 stable. + # Repository for Slackware x86_64 -current: https://slackware.nl/people/alien/multilib/current/ MULTILIB_REPO = false + MULTILIB_REPO_NAME = "multilib" MULTILIB_REPO_MIRROR = "https://slackware.nl/people/alien/multilib/15.0/" MULTILIB_REPO_CHANGELOG_MIRROR = "https://slackware.nl/people/alien/multilib/" MULTILIB_REPO_PACKAGES = "PACKAGES.TXT" MULTILIB_REPO_CHECKSUMS = "CHECKSUMS.md5" MULTILIB_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - # Mirror for -current: https://slackware.nl/people/alien/restricted_sbrepos/current/x86_64/ - RESTRICTED_REPO_NAME = "restricted" + # Repository for Slackware x86_64 15.0 stable. + # Repository for Slackware x86_64 -current: https://slackware.nl/people/alien/restricted_sbrepos/current/x86_64/ RESTRICTED_REPO = false + RESTRICTED_REPO_NAME = "restricted" RESTRICTED_REPO_MIRROR = "https://slackware.nl/people/alien/restricted_sbrepos/15.0/x86_64/" RESTRICTED_REPO_CHANGELOG_MIRROR = "https://slackware.nl/people/alien/restricted_sbrepos/" RESTRICTED_REPO_PACKAGES = "PACKAGES.TXT" RESTRICTED_REPO_CHECKSUMS = "CHECKSUMS.md5" RESTRICTED_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware -current. - GNOME_REPO_NAME = "gnome" + # Repository for Slackware x86_64 -current. GNOME_REPO = false + GNOME_REPO_NAME = "gnome" GNOME_REPO_MIRROR = "https://reddoglinux.ddns.net/linux/gnome/43.x/x86_64/" GNOME_REPO_PACKAGES = "PACKAGES.TXT" GNOME_REPO_CHECKSUMS = "CHECKSUMS.md5" GNOME_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - MSB_REPO_NAME = "msb" + # Repository for Slackware x86_64 15.0 stable. + # Repository for Slackware x86_64 -current: http://slackware.uk/msb/current/1.26/x86_64/ MSB_REPO = false + MSB_REPO_NAME = "msb" MSB_REPO_MIRROR = "https://slackware.uk/msb/15.0/1.26/x86_64/" MSB_REPO_CHANGELOG_MIRROR = 'https://slackware.uk/msb/' MSB_REPO_PACKAGES = "PACKAGES.TXT" MSB_REPO_CHECKSUMS = "CHECKSUMS.md5" MSB_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware -current. - CONRAID_REPO_NAME = "conraid" + # Repository for Slackware x86_64 15.0 stable. + # Mirror for Slackware x86_64 -current: https://slackware.uk/csb/current/x86_64/ + CSB_REPO = false + CSB_REPO_NAME = "csb" + CSB_REPO_MIRROR = "https://slackware.uk/csb/15.0/x86_64/" + CSB_REPO_CHANGELOG_MIRROR = 'https://slackware.uk/csb/' + CSB_REPO_PACKAGES = "PACKAGES.TXT" + CSB_REPO_CHECKSUMS = "CHECKSUMS.md5" + CSB_REPO_CHANGELOG = "ChangeLog.txt" + + # Repository for Slackware x86_64 -current. CONRAID_REPO = false + CONRAID_REPO_NAME = "conraid" CONRAID_REPO_MIRROR = "https://slack.conraid.net/repository/slackware64-current/" CONRAID_REPO_PACKAGES = "PACKAGES.TXT" CONRAID_REPO_CHECKSUMS = "CHECKSUMS.md5" CONRAID_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - # Mirror for -current: https://packages.slackonly.com/pub/packages/current-x86_64/ - SLACKONLY_REPO_NAME = "slackonly" + # Repository for Slackware x86_64 15.0 stable. + # Mirror for Slackware x86_64 -current: https://packages.slackonly.com/pub/packages/current-x86_64/ SLACKONLY_REPO = false + SLACKONLY_REPO_NAME = "slackonly" SLACKONLY_REPO_MIRROR = "https://packages.slackonly.com/pub/packages/15.0-x86_64/" SLACKONLY_REPO_PACKAGES = "PACKAGES.TXT" SLACKONLY_REPO_CHECKSUMS = "CHECKSUMS.md5" SLACKONLY_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - # Mirror for -current: https://ponce.cc/slackware/slackware64-current/packages/ - PONCE_BIN_REPO_NAME = "ponce_bin" + # Repository for Slackware x86_64 15.0 stable. + # Mirror for Slackware x86_64 -current: https://ponce.cc/slackware/slackware64-current/packages/ PONCE_BIN_REPO = false + PONCE_BIN_REPO_NAME = "ponce_bin" PONCE_BIN_REPO_MIRROR = "https://ponce.cc/slackware/slackware64-15.0/packages/" PONCE_BIN_REPO_PACKAGES = "PACKAGES.TXT" PONCE_BIN_REPO_CHECKSUMS = "CHECKSUMS.md5" PONCE_BIN_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - SALIXOS_REPO_NAME = "salixos" + # Repository for Slackware x86_64 15.0 stable. SALIXOS_REPO = false + SALIXOS_REPO_NAME = "salixos" SALIXOS_REPO_MIRROR = "https://download.salixos.org/x86_64/slackware-15.0/" SALIXOS_REPO_PACKAGES = "PACKAGES.TXT" SALIXOS_REPO_CHECKSUMS = "CHECKSUMS.md5" SALIXOS_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - SALIXOS_EXTRA_REPO_NAME = "salixos_extra" + # Repository for Slackware x86_64 15.0 stable. SALIXOS_EXTRA_REPO = false + SALIXOS_EXTRA_REPO_NAME = "salixos_extra" SALIXOS_EXTRA_REPO_MIRROR = "https://download.salixos.org/x86_64/slackware-15.0/" SALIXOS_EXTRA_REPO_PACKAGES_MIRROR = 'https://download.salixos.org/x86_64/slackware-15.0/extra/' SALIXOS_EXTRA_REPO_PACKAGES = "PACKAGES.TXT" SALIXOS_EXTRA_REPO_CHECKSUMS = "CHECKSUMS.md5" SALIXOS_EXTRA_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware -current. - SLACKEL_REPO_NAME = "slackel" + # Repository for Slackware x86_64 -current. SLACKEL_REPO = false + SLACKEL_REPO_NAME = "slackel" SLACKEL_REPO_MIRROR = "http://www.slackel.gr/repo/x86_64/slackware-current/" SLACKEL_REPO_PACKAGES = "PACKAGES.TXT" SLACKEL_REPO_CHECKSUMS = "CHECKSUMS.md5" SLACKEL_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - SLINT_REPO_NAME = "slint" + # Repository for Slackware x86_64 15.0 stable. SLINT_REPO = false + SLINT_REPO_NAME = "slint" SLINT_REPO_MIRROR = "https://slackware.uk/slint/x86_64/slint-15.0/" SLINT_REPO_PACKAGES = "PACKAGES.TXT" SLINT_REPO_CHECKSUMS = "CHECKSUMS.md5" diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index 40200276..ff02cf08 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -66,6 +66,11 @@ class CheckUpdates(Configs): self.repo_chg_txt: str = f'{self.repos.msb_repo_changelog_mirror}{self.repos.msb_repo_changelog}' compare[self.repos.msb_repo_name] = self.compare_dates() + if self.repos.csb_repo and self.repo == self.repos.csb_repo_name or self.repo == '*': + self.local_chg_txt: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_changelog) + self.repo_chg_txt: str = f'{self.repos.csb_repo_changelog_mirror}{self.repos.csb_repo_changelog}' + compare[self.repos.csb_repo_name] = self.compare_dates() + if self.repos.conraid_repo and self.repo == self.repos.conraid_repo_name or self.repo == '*': self.local_chg_txt: Path = Path(self.repos.conraid_repo_path, self.repos.conraid_repo_changelog) self.repo_chg_txt: str = f'{self.repos.conraid_repo_mirror}{self.repos.conraid_repo_changelog}' diff --git a/slpkg/install_data.py b/slpkg/install_data.py index cd744c9d..5060f796 100644 --- a/slpkg/install_data.py +++ b/slpkg/install_data.py @@ -521,6 +521,91 @@ class InstallData(Configs): self.session.commit() + def install_csb_data(self) -> None: + """ Install the data for csb repository. """ + checksums_dict: dict = {} + pkg_tag = [ + 'PACKAGE NAME:', + 'PACKAGE LOCATION:', + 'PACKAGE SIZE (compressed):', + 'PACKAGE SIZE (uncompressed):', + 'PACKAGE DESCRIPTION:' + ] + path_packages: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_packages) + path_checksums: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_checksums) + path_changelog: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_changelog) + packages_txt: list = self.utils.read_file(path_packages) + checksums_md5: list = self.utils.read_file(path_checksums) + + for line in checksums_md5: + line = line.strip() + + if line.endswith(('.txz', '.tgz')): + file: str = line.split('./')[1].split('/')[-1].strip() + checksum: str = line.split('./')[0].strip() + checksums_dict[file] = checksum + + cache: list = [] # init cache + + print('Creating the database... ', end='', flush=True) + + for line in packages_txt: + + if line.startswith(pkg_tag[0]): + package_name = line.replace(pkg_tag[0], '').strip() + split_package: list = self.utils.split_binary_pkg(package_name) + cache.append(split_package[0]) # package name + cache.append(split_package[1]) # package version + cache.append(package_name) + cache.append(self.repos.csb_repo_mirror) + try: + cache.append(checksums_dict[package_name]) + except KeyError: + cache.append('error checksum') + + if line.startswith(pkg_tag[1]): + package_location = line.replace(pkg_tag[1], '').strip() + cache.append(package_location[2:]) # Do not install (./) dot + + if line.startswith(pkg_tag[2]): + package_size_comp = line.replace(pkg_tag[2], '').strip() + cache.append(f'{package_size_comp}B') + + if line.startswith(pkg_tag[3]): + package_size_uncomp = line.replace(pkg_tag[3], '').strip() + cache.append(f'{package_size_uncomp}B') + + if line.startswith(pkg_tag[4]): + package_description = line.replace(pkg_tag[4], '').strip() + cache.append(package_description) + + if len(cache) == 9: + data: str = BinariesTable( + repo=self.repos.csb_repo_name, + name=cache[0], + version=cache[1], + package=cache[2], + mirror=cache[3], + checksum=cache[4], + location=cache[5], + size_comp=cache[6], + size_uncomp=cache[7], + description=cache[8], + required='' + ) + + self.session.add(data) + + cache: list = [] # reset cache + + last_updated: str = self.last_updated(path_changelog) + date: str = LastRepoUpdated(repo=self.repos.csb_repo_name, date=last_updated) + self.session.add(date) + + print(f'{self.byellow}Done{self.endc}') + + self.session.commit() + def install_conraid_data(self) -> None: """ Install the data for conraid repository. """ checksums_dict: dict = {} diff --git a/slpkg/repositories.py b/slpkg/repositories.py index 8a8d5dd1..fc585d60 100644 --- a/slpkg/repositories.py +++ b/slpkg/repositories.py @@ -33,16 +33,16 @@ class Repositories: sbo_repo_tar_suffix: str = '.tar.gz' sbo_repo_tag: str = '_SBo' - ponce_repo_name: str = 'ponce' ponce_repo: bool = False + ponce_repo_name: str = 'ponce' ponce_repo_path: Path = Path(config.lib_path, 'repositories', ponce_repo_name) ponce_repo_mirror: str = 'https://cgit.ponce.cc/slackbuilds/plain/' ponce_repo_slackbuilds: str = 'SLACKBUILDS.TXT' ponce_repo_changelog: str = 'ChangeLog.txt' ponce_repo_tag: str = '_SBo' - alien_repo_name: str = 'alien' alien_repo: bool = False + alien_repo_name: str = 'alien' alien_repo_path: Path = Path(config.lib_path, 'repositories', alien_repo_name) alien_repo_mirror: str = 'http://slackware.uk/people/alien/sbrepos/15.0/x86_64/' alien_repo_changelog_mirror: str = 'http://slackware.uk/people/alien/sbrepos/' @@ -50,8 +50,8 @@ class Repositories: alien_repo_checksums: str = 'CHECKSUMS.md5' alien_repo_changelog: str = 'ChangeLog.txt' - multilib_repo_name: str = 'multilib' multilib_repo: bool = False + multilib_repo_name: str = 'multilib' multilib_repo_path: Path = Path(config.lib_path, 'repositories', multilib_repo_name) multilib_repo_mirror: str = 'https://slackware.nl/people/alien/multilib/15.0/' multilib_repo_changelog_mirror: str = 'https://slackware.nl/people/alien/multilib/' @@ -59,8 +59,8 @@ class Repositories: multilib_repo_checksums: str = 'CHECKSUMS.md5' multilib_repo_changelog: str = 'ChangeLog.txt' - restricted_repo_name: str = 'restricted' restricted_repo: bool = False + restricted_repo_name: str = 'restricted' restricted_repo_path: Path = Path(config.lib_path, 'repositories', restricted_repo_name) restricted_repo_mirror: str = 'https://slackware.nl/people/alien/restricted_sbrepos/15.0/x86_64/' restricted_repo_changelog_mirror: str = 'https://slackware.nl/people/alien/restricted_sbrepos/' @@ -68,16 +68,16 @@ class Repositories: restricted_repo_checksums: str = 'CHECKSUMS.md5' restricted_repo_changelog: str = 'ChangeLog.txt' - gnome_repo_name: str = 'gnome' gnome_repo: bool = False + gnome_repo_name: str = 'gnome' gnome_repo_path: Path = Path(config.lib_path, 'repositories', gnome_repo_name) gnome_repo_mirror: str = 'https://reddoglinux.ddns.net/linux/gnome/43.x/x86_64/' gnome_repo_packages: str = 'PACKAGES.TXT' gnome_repo_checksums: str = 'CHECKSUMS.md5' gnome_repo_changelog: str = 'ChangeLog.txt' - msb_repo_name: str = 'msb' msb_repo: bool = False + msb_repo_name: str = 'msb' msb_repo_path: Path = Path(config.lib_path, 'repositories', msb_repo_name) msb_repo_mirror: str = 'https://slackware.uk/msb/15.0/1.26/x86_64/' msb_repo_changelog_mirror: str = 'https://slackware.uk/msb/' @@ -85,40 +85,49 @@ class Repositories: msb_repo_checksums: str = 'CHECKSUMS.md5' msb_repo_changelog: str = 'ChangeLog.txt' - conraid_repo_name: str = 'conraid' + csb_repo: bool = False + csb_repo_name: str = 'csb' + csb_repo_path: Path = Path(config.lib_path, 'repositories', csb_repo_name) + csb_repo_mirror: str = 'https://slackware.uk/csb/15.0/x86_64/' + csb_repo_changelog_mirror: str = 'https://slackware.uk/csb/' + csb_repo_packages: str = 'PACKAGES.TXT' + csb_repo_checksums: str = 'CHECKSUMS.md5' + csb_repo_changelog: str = 'ChangeLog.txt' + conraid_repo: bool = False + conraid_repo_name: str = 'conraid' conraid_repo_path: Path = Path(config.lib_path, 'repositories', conraid_repo_name) conraid_repo_mirror: str = 'https://reddoglinux.ddns.net/linux/conraid_43.x/x86_64/' conraid_repo_packages: str = 'PACKAGES.TXT' conraid_repo_checksums: str = 'CHECKSUMS.md5' conraid_repo_changelog: str = 'ChangeLog.txt' - slackonly_repo_name: str = 'slackonly' slackonly_repo: bool = False + slackonly_repo_name: str = 'slackonly' slackonly_repo_path: Path = Path(config.lib_path, 'repositories', slackonly_repo_name) slackonly_repo_mirror: str = 'https://packages.slackonly.com/pub/packages/15.0-x86_64/' slackonly_repo_packages: str = 'PACKAGES.TXT' slackonly_repo_checksums: str = 'CHECKSUMS.md5' slackonly_repo_changelog: str = 'ChangeLog.txt' - ponce_bin_repo_name: str = 'ponce_bin' ponce_bin_repo: bool = False + ponce_bin_repo_name: str = 'ponce_bin' ponce_bin_repo_path: Path = Path(config.lib_path, 'repositories', ponce_bin_repo_name) ponce_bin_repo_mirror: str = 'https://ponce.cc/slackware/slackware64-15.0/packages/' ponce_bin_repo_packages: str = 'PACKAGES.TXT' ponce_bin_repo_checksums: str = 'CHECKSUMS.md5' ponce_bin_repo_changelog: str = 'ChangeLog.txt' - salixos_repo_name: str = 'salixos' salixos_repo: bool = False + salixos_repo_name: str = 'salixos' salixos_repo_path: Path = Path(config.lib_path, 'repositories', salixos_repo_name) salixos_repo_mirror: str = 'https://download.salixos.org/x86_64/slackware-15.0/' salixos_repo_packages: str = 'PACKAGES.TXT' salixos_repo_checksums: str = 'CHECKSUMS.md5' salixos_repo_changelog: str = 'ChangeLog.txt' - salixos_extra_repo_name: str = 'salixos_extra' salixos_extra_repo: bool = False + salixos_extra_repo_name: str = 'salixos_extra' salixos_extra_repo_path: Path = Path(config.lib_path, 'repositories', salixos_extra_repo_name) salixos_extra_repo_mirror: str = 'https://download.salixos.org/x86_64/slackware-15.0/' salixos_extra_repo_packages_mirror: str = 'https://download.salixos.org/x86_64/slackware-15.0/extra/' @@ -126,16 +135,16 @@ class Repositories: salixos_extra_repo_checksums: str = 'CHECKSUMS.md5' salixos_extra_repo_changelog: str = 'ChangeLog.txt' - slackel_repo_name: str = 'slackel' slackel_repo: bool = False + slackel_repo_name: str = 'slackel' slackel_repo_path: Path = Path(config.lib_path, 'repositories', slackel_repo_name) slackel_repo_mirror: str = 'http://www.slackel.gr/repo/x86_64/slackware-current/' slackel_repo_packages: str = 'PACKAGES.TXT' slackel_repo_checksums: str = 'CHECKSUMS.md5' slackel_repo_changelog: str = 'ChangeLog.txt' - slint_repo_name: str = 'slint' slint_repo: bool = False + slint_repo_name: str = 'slint' slint_repo_path: Path = Path(config.lib_path, 'repositories', slint_repo_name) slint_repo_mirror: str = 'https://slackware.uk/slint/x86_64/slint-15.0/' slint_repo_packages: str = 'PACKAGES.TXT' @@ -160,97 +169,105 @@ class Repositories: sbo_repo_tar_suffix: str = repos['SBO_REPO_TAR_SUFFIX'] sbo_repo_tag: str = repos['SBO_REPO_TAG'] - ponce_repo_name: str = repos['PONCE_REPO_NAME'] ponce_repo: bool = repos['PONCE_REPO'] + ponce_repo_name: str = repos['PONCE_REPO_NAME'] ponce_repo_mirror: str = repos['PONCE_REPO_MIRROR'] ponce_repo_slackbuilds: str = repos['PONCE_REPO_SLACKBUILDS'] ponce_repo_changelog: str = repos['PONCE_REPO_CHANGELOG'] ponce_repo_tag: str = repos['PONCE_REPO_TAG'] - alien_repo_name: str = repos['ALIEN_REPO_NAME'] alien_repo: bool = repos['ALIEN_REPO'] + alien_repo_name: str = repos['ALIEN_REPO_NAME'] alien_repo_mirror: str = repos['ALIEN_REPO_MIRROR'] alien_repo_changelog_mirror: str = repos['ALIEN_REPO_CHANGELOG_MIRROR'] alien_repo_packages: str = repos['ALIEN_REPO_PACKAGES'] alien_repo_checksums: str = repos['ALIEN_REPO_CHECKSUMS'] alien_repo_changelog: str = repos['ALIEN_REPO_CHANGELOG'] - multilib_repo_name: str = repos['MULTILIB_REPO_NAME'] multilib_repo: bool = repos['MULTILIB_REPO'] + multilib_repo_name: str = repos['MULTILIB_REPO_NAME'] multilib_repo_mirror: str = repos['MULTILIB_REPO_MIRROR'] multilib_repo_changelog_mirror: str = repos['MULTILIB_REPO_CHANGELOG_MIRROR'] multilib_repo_packages: str = repos['MULTILIB_REPO_PACKAGES'] multilib_repo_checksums: str = repos['MULTILIB_REPO_CHECKSUMS'] multilib_repo_changelog: str = repos['MULTILIB_REPO_CHANGELOG'] - restricted_repo_name: str = repos['RESTRICTED_REPO_NAME'] restricted_repo: bool = repos['RESTRICTED_REPO'] + restricted_repo_name: str = repos['RESTRICTED_REPO_NAME'] restricted_repo_mirror: str = repos['RESTRICTED_REPO_MIRROR'] restricted_repo_changelog_mirror: str = repos['RESTRICTED_REPO_CHANGELOG_MIRROR'] restricted_repo_packages: str = repos['RESTRICTED_REPO_PACKAGES'] restricted_repo_checksums: str = repos['RESTRICTED_REPO_CHECKSUMS'] restricted_repo_changelog: str = repos['RESTRICTED_REPO_CHANGELOG'] - gnome_repo_name: str = repos['GNOME_REPO_NAME'] gnome_repo: bool = repos['GNOME_REPO'] + gnome_repo_name: str = repos['GNOME_REPO_NAME'] gnome_repo_mirror: str = repos['GNOME_REPO_MIRROR'] gnome_repo_packages: str = repos['GNOME_REPO_PACKAGES'] gnome_repo_checksums: str = repos['GNOME_REPO_CHECKSUMS'] gnome_repo_changelog: str = repos['GNOME_REPO_CHANGELOG'] - msb_repo_name: str = repos['MSB_REPO_NAME'] msb_repo: bool = repos['MSB_REPO'] + msb_repo_name: str = repos['MSB_REPO_NAME'] msb_repo_mirror: str = repos['MSB_REPO_MIRROR'] msb_repo_changelog_mirror: str = repos['MSB_REPO_CHANGELOG_MIRROR'] msb_repo_packages: str = repos['MSB_REPO_PACKAGES'] msb_repo_checksums: str = repos['MSB_REPO_CHECKSUMS'] msb_repo_changelog: str = repos['MSB_REPO_CHANGELOG'] - conraid_repo_name: str = repos['CONRAID_REPO_NAME'] + csb_repo: bool = repos['CSB_REPO'] + csb_repo_name: str = repos['CSB_REPO_NAME'] + csb_repo_mirror: str = repos['CSB_REPO_MIRROR'] + csb_repo_changelog_mirror: str = repos['CSB_REPO_CHANGELOG_MIRROR'] + csb_repo_packages: str = repos['CSB_REPO_PACKAGES'] + csb_repo_checksums: str = repos['CSB_REPO_CHECKSUMS'] + csb_repo_changelog: str = repos['CSB_REPO_CHANGELOG'] + conraid_repo: bool = repos['CONRAID_REPO'] + conraid_repo_name: str = repos['CONRAID_REPO_NAME'] conraid_repo_mirror: str = repos['CONRAID_REPO_MIRROR'] conraid_repo_packages: str = repos['CONRAID_REPO_PACKAGES'] conraid_repo_checksums: str = repos['CONRAID_REPO_CHECKSUMS'] conraid_repo_changelog: str = repos['CONRAID_REPO_CHANGELOG'] - slackonly_repo_name: str = repos['SLACKONLY_REPO_NAME'] slackonly_repo: bool = repos['SLACKONLY_REPO'] + slackonly_repo_name: str = repos['SLACKONLY_REPO_NAME'] slackonly_repo_mirror: str = repos['SLACKONLY_REPO_MIRROR'] slackonly_repo_packages: str = repos['SLACKONLY_REPO_PACKAGES'] slackonly_repo_checksums: str = repos['SLACKONLY_REPO_CHECKSUMS'] slackonly_repo_changelog: str = repos['SLACKONLY_REPO_CHANGELOG'] - ponce_bin_repo_name: str = repos['PONCE_BIN_REPO_NAME'] ponce_bin_repo: bool = repos['PONCE_BIN_REPO'] + ponce_bin_repo_name: str = repos['PONCE_BIN_REPO_NAME'] ponce_bin_repo_mirror: str = repos['PONCE_BIN_REPO_MIRROR'] ponce_bin_repo_packages: str = repos['PONCE_BIN_REPO_PACKAGES'] ponce_bin_repo_checksums: str = repos['PONCE_BIN_REPO_CHECKSUMS'] ponce_bin_repo_changelog: str = repos['PONCE_BIN_REPO_CHANGELOG'] - salixos_repo_name: str = repos['SALIXOS_REPO_NAME'] salixos_repo: bool = repos['SALIXOS_REPO'] + salixos_repo_name: str = repos['SALIXOS_REPO_NAME'] salixos_repo_mirror: str = repos['SALIXOS_REPO_MIRROR'] salixos_repo_packages: str = repos['SALIXOS_REPO_PACKAGES'] salixos_repo_checksums: str = repos['SALIXOS_REPO_CHECKSUMS'] salixos_repo_changelog: str = repos['SALIXOS_REPO_CHANGELOG'] - salixos_extra_repo_name: str = repos['SALIXOS_EXTRA_REPO_NAME'] salixos_extra_repo: bool = repos['SALIXOS_EXTRA_REPO'] + salixos_extra_repo_name: str = repos['SALIXOS_EXTRA_REPO_NAME'] salixos_extra_repo_mirror: str = repos['SALIXOS_EXTRA_REPO_MIRROR'] salixos_extra_repo_packages_mirror: str = repos['SALIXOS_EXTRA_REPO_PACKAGES_MIRROR'] salixos_extra_repo_packages: str = repos['SALIXOS_EXTRA_REPO_PACKAGES'] salixos_extra_repo_checksums: str = repos['SALIXOS_EXTRA_REPO_CHECKSUMS'] salixos_extra_repo_changelog: str = repos['SALIXOS_EXTRA_REPO_CHANGELOG'] - slackel_repo_name: str = repos['SLACKEL_REPO_NAME'] slackel_repo: bool = repos['SLACKEL_REPO'] + slackel_repo_name: str = repos['SLACKEL_REPO_NAME'] slackel_repo_mirror: str = repos['SLACKEL_REPO_MIRROR'] slackel_repo_packages: str = repos['SLACKEL_REPO_PACKAGES'] slackel_repo_checksums: str = repos['SLACKEL_REPO_CHECKSUMS'] slackel_repo_changelog: str = repos['SLACKEL_REPO_CHANGELOG'] - slint_repo_name: str = repos['SLINT_REPO_NAME'] slint_repo: bool = repos['SLINT_REPO'] + slint_repo_name: str = repos['SLINT_REPO_NAME'] slint_repo_mirror: str = repos['SLINT_REPO_MIRROR'] slint_repo_packages: str = repos['SLINT_REPO_PACKAGES'] slint_repo_checksums: str = repos['SLINT_REPO_CHECKSUMS'] @@ -278,6 +295,7 @@ class Repositories: restricted_repo_name: [restricted_repo, restricted_repo_path, restricted_repo_changelog], gnome_repo_name: [gnome_repo, gnome_repo_path, gnome_repo_changelog], msb_repo_name: [msb_repo, msb_repo_path, msb_repo_changelog], + csb_repo_name: [csb_repo, csb_repo_path, csb_repo_changelog], conraid_repo_name: [conraid_repo, conraid_repo_path, conraid_repo_changelog], slackonly_repo_name: [slackonly_repo, slackonly_repo_path, slackonly_repo_changelog], ponce_bin_repo_name: [ponce_bin_repo, ponce_bin_repo_path, ponce_bin_repo_changelog], diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 58d4e73a..a52d7c31 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -69,6 +69,9 @@ class UpdateRepository(Configs): if self.repo == self.repos.msb_repo_name or self.repo == '*': self.msb_repository() + if self.repo == self.repos.csb_repo_name or self.repo == '*': + self.csb_repository() + if self.repo == self.repos.conraid_repo_name or self.repo == '*': self.conraid_repository() @@ -229,6 +232,36 @@ class UpdateRepository(Configs): else: self.not_enabled_message(self.repos.msb_repo_name) + def csb_repository(self): + if self.repos.csb_repo: + urls: list = [] + print('Updating the packages list...\n') + print(f"Downloading the '{self.green}{self.repos.csb_repo_name}{self.endc}' " + f"repository, please wait...\n") + self.make_dirs(self.repos.csb_repo_name) + + urls.append(f'{self.repos.csb_repo_mirror}{self.repos.csb_repo_packages}') + urls.append(f'{self.repos.csb_repo_changelog_mirror}{self.repos.csb_repo_changelog}') + urls.append(f'{self.repos.csb_repo_mirror}{self.repos.csb_repo_checksums}') + + self.utils.remove_file_if_exists(self.repos.csb_repo_path, + self.repos.csb_repo_packages) + self.utils.remove_file_if_exists(self.repos.csb_repo_path, + self.repos.csb_repo_changelog) + self.utils.remove_file_if_exists(self.repos.csb_repo_path, + self.repos.csb_repo_checksums) + + down = Downloader(self.repos.csb_repo_path, urls, self.flags) + down.download() + print() + + self.delete_binaries_data(self.repos.csb_repo_name) + self.delete_last_updated(self.repos.csb_repo_name) + self.data.install_csb_data() + print() + else: + self.not_enabled_message(self.repos.csb_repo_name) + def conraid_repository(self): if self.repos.conraid_repo: urls: list = []