From 6e03e29c6a59c5f127e90b9b95db5ce05f7978b6 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 11 May 2023 19:28:16 +0300 Subject: [PATCH] Updated for naming --- slpkg/sbos/slackbuild.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/slpkg/sbos/slackbuild.py b/slpkg/sbos/slackbuild.py index a8e25b52..b900103a 100644 --- a/slpkg/sbos/slackbuild.py +++ b/slpkg/sbos/slackbuild.py @@ -24,7 +24,6 @@ from slpkg.logging_deps import LoggingDeps from slpkg.repositories import Repositories from slpkg.sbos.dependencies import Requires from slpkg.logging_config import LoggingConfig -from slpkg.models.models import session as Session class Slackbuilds(Configs): @@ -38,7 +37,6 @@ class Slackbuilds(Configs): self.flags: list = flags self.mode: str = mode - self.session = Session self.errors = Errors() self.repos = Repositories() self.utils = Utilities() @@ -102,15 +100,15 @@ class Slackbuilds(Configs): def creating_dependencies_list(self) -> None: if not self.option_for_resolve_off: - for sbo in self.slackbuilds: - deps: tuple = Requires(self.data, sbo).resolve() + for slackbuild in self.slackbuilds: + dependencies: tuple = Requires(self.data, slackbuild).resolve() - for dep in deps: + for dependency in dependencies: # Skip installed package when the option --skip-installed is applied. - if self.option_for_skip_installed and self.utils.is_package_installed(dep): + if self.option_for_skip_installed and self.utils.is_package_installed(dependency): continue - self.dependencies.append(dep) + self.dependencies.append(dependency) def remove_duplicate_from_dependencies_list(self) -> None: if self.dependencies: @@ -176,8 +174,8 @@ class Slackbuilds(Configs): def download_the_sources(self) -> None: if self.sources: - for pkg, sbo_sources in self.sources.items(): - down_urls = Downloader(Path(self.build_path, pkg), sbo_sources, self.flags) + for package, sbo_sources in self.sources.items(): + down_urls = Downloader(Path(self.build_path, package), sbo_sources, self.flags) down_urls.download() print() @@ -225,24 +223,24 @@ class Slackbuilds(Configs): line: str = f'TAG=${{TAG:-{self.repo_tag}}}\n' script.write(line) - def install_package(self, package_name: str) -> None: - package: str = self.find_package_for_install(package_name) - self.set_slackware_command(package_name) + def install_package(self, name: str) -> None: + package: str = self.find_package_for_install(name) + self.set_slackware_command(name) message: str = f'{self.cyan}Installing{self.endc}' - self.process_message: str = f"package '{package_name}' to install" + self.process_message: str = f"package '{name}' to install" if self.mode == 'upgrade': message: str = f'{self.cyan}Upgrade{self.endc}' - self.process_message: str = f"package '{package_name}' to upgrade" + self.process_message: str = f"package '{name}' to upgrade" command: str = f'{self.slackware_command} {self.tmp_path}/{package}' self.multi_process(command, package, message) - def set_slackware_command(self, package_name: str) -> None: + def set_slackware_command(self, name: str) -> None: self.slackware_command: str = self.installpkg - if self.option_for_reinstall and self.utils.is_package_installed(package_name): + if self.option_for_reinstall and self.utils.is_package_installed(name): self.slackware_command: str = self.reinstall def find_package_for_install(self, name: str) -> str: @@ -307,7 +305,7 @@ class Slackbuilds(Configs): else: self.utils.process(command, self.stderr, self.stdout) - def choose_package_dependencies(self): + def choose_package_dependencies(self) -> None: if self.dependencies: height: int = 10 width: int = 70