From 4f22169992ffe18ec9d8156715677e0ae087f888 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 31 Mar 2023 21:56:47 +0300 Subject: [PATCH] Removed salixos_patches repo --- configs/repositories.toml | 9 ---- slpkg/check_updates.py | 8 --- slpkg/install_data.py | 100 ------------------------------------- slpkg/repo_info.py | 1 - slpkg/repositories.py | 20 -------- slpkg/update_repository.py | 33 ------------ 6 files changed, 171 deletions(-) diff --git a/configs/repositories.toml b/configs/repositories.toml index d8f5ae02..635feba4 100644 --- a/configs/repositories.toml +++ b/configs/repositories.toml @@ -109,15 +109,6 @@ SALIXOS_EXTRA_REPO_CHECKSUMS = "CHECKSUMS.md5" SALIXOS_EXTRA_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware 15.0 stable. - SALIXOS_PATCHES_REPO_NAME = "salixos_patches" - SALIXOS_PATCHES_REPO = false - SALIXOS_PATCHES_REPO_MIRROR = "https://download.salixos.org/x86_64/slackware-15.0/" - SALIXOS_PATCHES_REPO_PACKAGES_MIRROR = 'https://download.salixos.org/x86_64/slackware-15.0/patches/' - SALIXOS_PATCHES_REPO_PACKAGES = "PACKAGES.TXT" - SALIXOS_PATCHES_REPO_CHECKSUMS = "CHECKSUMS.md5" - SALIXOS_PATCHES_REPO_CHANGELOG = "ChangeLog.txt" - # Repository for slackware -current. SLACKEL_REPO_NAME = "slackel" SLACKEL_REPO = false diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index 8e635b8c..025e6424 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -88,14 +88,6 @@ class CheckUpdates(Configs): f'{self.repos.salixos_extra_repo_changelog}') compare[self.repos.salixos_extra_repo_name] = self.compare_dates() - if (self.repos.salixos_patches_repo and self.repo == self.repos.salixos_patches_repo_name - or self.repo == '*'): - self.local_chg_txt: Path = Path(self.repos.salixos_patches_repo_path, - self.repos.salixos_patches_repo_changelog) - self.repo_chg_txt: str = (f'{self.repos.salixos_patches_repo_mirror}' - f'{self.repos.salixos_patches_repo_changelog}') - compare[self.repos.salixos_patches_repo_name] = self.compare_dates() - if self.repos.slackel_repo and self.repo == self.repos.slackel_repo_name or self.repo == '*': self.local_chg_txt: Path = Path(self.repos.slackel_repo_path, self.repos.slackel_repo_changelog) self.repo_chg_txt: str = f'{self.repos.slackel_repo_mirror}{self.repos.slackel_repo_changelog}' diff --git a/slpkg/install_data.py b/slpkg/install_data.py index 9584154c..6198f2ad 100644 --- a/slpkg/install_data.py +++ b/slpkg/install_data.py @@ -899,106 +899,6 @@ class InstallData(Configs): self.session.commit() - def install_salixos_patches_data(self) -> None: - """ Install the data for salixos_patches repository. """ - checksums_dict: dict = {} - pkg_tag = [ - 'PACKAGE NAME:', - 'PACKAGE LOCATION:', - 'PACKAGE SIZE (compressed):', - 'PACKAGE SIZE (uncompressed):', - 'PACKAGE REQUIRED:', - 'PACKAGE DESCRIPTION:' - ] - path_packages: Path = Path(self.repos.salixos_patches_repo_path, self.repos.salixos_patches_repo_packages) - path_checksums: Path = Path(self.repos.salixos_patches_repo_path, self.repos.salixos_patches_repo_checksums) - path_changelog: Path = Path(self.repos.salixos_patches_repo_path, - self.repos.salixos_patches_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.salixos_patches_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]): - deps: list = [] - required = line.replace(pkg_tag[4], '').strip() - - for req in required.split(','): - dep = req.split('|') - if len(dep) > 1: - deps.append(dep[1]) - else: - deps += dep - - cache.append(' '.join(deps)) - - if line.startswith(pkg_tag[5]): - package_description = line.replace(pkg_tag[5], '').strip() - cache.append(package_description) - - if len(cache) == 10: - data: str = BinariesTable( - repo=self.repos.salixos_patches_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], - required=cache[8], - description=cache[9] - ) - - self.session.add(data) - - cache: list = [] # reset cache - - last_updated: str = self.last_updated(path_changelog) - date: str = LastRepoUpdated(repo=self.repos.salixos_patches_repo_name, date=last_updated) - self.session.add(date) - - print(f'{self.byellow}Done{self.endc}') - - self.session.commit() - def install_slackel_data(self) -> None: """ Install the data for slackel repository. """ checksums_dict: dict = {} diff --git a/slpkg/repo_info.py b/slpkg/repo_info.py index cc18190f..89539806 100644 --- a/slpkg/repo_info.py +++ b/slpkg/repo_info.py @@ -70,7 +70,6 @@ class RepoInfo(Configs): self.repos.ponce_bin_repo_name: BinQueries('', repo).count_packages(), self.repos.salixos_repo_name: BinQueries('', repo).count_packages(), self.repos.salixos_extra_repo_name: BinQueries('', repo).count_packages(), - self.repos.salixos_patches_repo_name: BinQueries('', repo).count_packages(), self.repos.slackel_repo_name: BinQueries('', repo).count_packages() } diff --git a/slpkg/repositories.py b/slpkg/repositories.py index 747ceebf..02cd5e91 100644 --- a/slpkg/repositories.py +++ b/slpkg/repositories.py @@ -117,15 +117,6 @@ class Repositories: salixos_extra_repo_checksums: str = 'CHECKSUMS.md5' salixos_extra_repo_changelog: str = 'ChangeLog.txt' - salixos_patches_repo_name: str = 'salixos_patches' - salixos_patches_repo: bool = False - salixos_patches_repo_path: Path = Path(config.lib_path, 'repositories', salixos_patches_repo_name) - salixos_patches_repo_mirror: str = 'https://download.salixos.org/x86_64/slackware-15.0/' - salixos_patches_repo_packages_mirror: str = 'https://download.salixos.org/x86_64/slackware-15.0/patches/' - salixos_patches_repo_packages: str = 'PACKAGES.TXT' - salixos_patches_repo_checksums: str = 'CHECKSUMS.md5' - salixos_patches_repo_changelog: str = 'ChangeLog.txt' - slackel_repo_name: str = 'slackel' slackel_repo: bool = False slackel_repo_path: Path = Path(config.lib_path, 'repositories', slackel_repo_name) @@ -226,14 +217,6 @@ class Repositories: salixos_extra_repo_checksums: str = repos['SALIXOS_EXTRA_REPO_CHECKSUMS'] salixos_extra_repo_changelog: str = repos['SALIXOS_EXTRA_REPO_CHANGELOG'] - salixos_patches_repo_name: str = repos['SALIXOS_PATCHES_REPO_NAME'] - salixos_patches_repo: bool = repos['SALIXOS_PATCHES_REPO'] - salixos_patches_repo_mirror: str = repos['SALIXOS_PATCHES_REPO_MIRROR'] - salixos_patches_repo_packages_mirror: str = repos['SALIXOS_PATCHES_REPO_PACKAGES_MIRROR'] - salixos_patches_repo_packages: str = repos['SALIXOS_PATCHES_REPO_PACKAGES'] - salixos_patches_repo_checksums: str = repos['SALIXOS_PATCHES_REPO_CHECKSUMS'] - salixos_patches_repo_changelog: str = repos['SALIXOS_PATCHES_REPO_CHANGELOG'] - slackel_repo_name: str = repos['SLACKEL_REPO_NAME'] slackel_repo: bool = repos['SLACKEL_REPO'] slackel_repo_mirror: str = repos['SLACKEL_REPO_MIRROR'] @@ -259,7 +242,6 @@ class Repositories: ponce_bin_repo_name: ponce_bin_repo, salixos_repo_name: salixos_repo, salixos_extra_repo_name: salixos_extra_repo, - salixos_patches_repo_name: salixos_patches_repo, slackel_repo_name: slackel_repo } @@ -286,7 +268,5 @@ class Repositories: ponce_bin_repo_name: [ponce_bin_repo, ponce_bin_repo_path, ponce_bin_repo_changelog], salixos_repo_name: [salixos_repo, salixos_repo_path, salixos_repo_changelog], salixos_extra_repo_name: [salixos_extra_repo_name, salixos_extra_repo_path, salixos_extra_repo_changelog], - salixos_patches_repo_name: [salixos_patches_repo_name, salixos_patches_repo_path, - salixos_patches_repo_changelog], slackel_repo_name: [slackel_repo, slackel_repo_path, slackel_repo_changelog] } diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 98924c65..b9cb15fe 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -81,9 +81,6 @@ class UpdateRepository(Configs): if self.repo == self.repos.salixos_extra_repo_name or self.repo == '*': self.salixos_extra_repository() - if self.repo == self.repos.salixos_patches_repo_name or self.repo == '*': - self.salixos_patches_repository() - if self.repo == self.repos.slackel_repo_name or self.repo == '*': self.slackel_repository() else: @@ -333,36 +330,6 @@ class UpdateRepository(Configs): else: self.not_enabled_message(self.repos.salixos_extra_repo_name) - def salixos_patches_repository(self): - if self.repos.salixos_patches_repo: - urls: list = [] - print('Updating the packages list...\n') - print(f"Downloading the '{self.green}{self.repos.salixos_patches_repo_name}{self.endc}' " - f"repository, please wait...\n") - self.make_dirs(self.repos.salixos_patches_repo_name) - - urls.append(f'{self.repos.salixos_patches_repo_packages_mirror}{self.repos.salixos_patches_repo_packages}') - urls.append(f'{self.repos.salixos_patches_repo_mirror}{self.repos.salixos_patches_repo_changelog}') - urls.append(f'{self.repos.salixos_patches_repo_mirror}{self.repos.salixos_patches_repo_checksums}') - - self.utils.remove_file_if_exists(self.repos.salixos_patches_repo_path, - self.repos.salixos_patches_repo_packages) - self.utils.remove_file_if_exists(self.repos.salixos_patches_repo_path, - self.repos.salixos_patches_repo_changelog) - self.utils.remove_file_if_exists(self.repos.salixos_patches_repo_path, - self.repos.salixos_patches_repo_checksums) - - down = Downloader(self.repos.salixos_patches_repo_path, urls, self.flags) - down.download() - print() - - self.delete_binaries_data(self.repos.salixos_patches_repo_name) - self.delete_last_updated(self.repos.salixos_patches_repo_name) - self.data.install_salixos_patches_data() - print() - else: - self.not_enabled_message(self.repos.salixos_patches_repo_name) - def slackel_repository(self): if self.repos.slackel_repo: urls: list = []