diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index 6887fbc6..764f1f78 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -40,6 +40,8 @@ class Packages(Configs): self.dependencies: list = [] self.install_order: list = [] self.binary_packages: list = [] + self.slackware_command: str = self.installpkg + self.progress_message: str = f'{self.cyan}Installing{self.endc}' self.option_for_reinstall: bool = self.utils.is_option( ['-r', '--reinstall'], flags) @@ -67,6 +69,8 @@ class Packages(Configs): start: float = time.time() self.crating_the_package_urls_list() self.checksum_binary_packages() + self.set_slackware_command() + self.set_progress_message() self.install_packages() elapsed_time: float = time.time() - start @@ -149,21 +153,21 @@ class Packages(Configs): def install_packages(self) -> None: for package in self.binary_packages: - progress_message: str = f'{self.cyan}Installing{self.endc}' - slack_command: str = self.installpkg - - if (self.option_for_reinstall or self.utils.is_package_installed(package) - or self.mode == 'upgrade'): - progress_message: str = f'{self.cyan}Upgrading{self.endc}' - slack_command: str = self.reinstall - - command: str = f'{slack_command} {self.tmp_slpkg}/{package}' - self.multi_proc.process(command, package, progress_message) + command: str = f'{self.slackware_command} {self.tmp_slpkg}/{package}' + self.multi_proc.process(command, package, self.progress_message) if not self.option_for_resolve_off: name: str = self.utils.split_package(Path(package).stem)['name'] self.logs_deps.logging(name) + def set_progress_message(self): + if self.mode == 'upgrade' or self.option_for_reinstall: + self.progress_message: str = f'{self.cyan}Upgrading{self.endc}' + + def set_slackware_command(self) -> None: + if self.mode == 'upgrade' or self.option_for_reinstall: + self.slackware_command: str = self.reinstall + def choose_package_dependencies(self) -> None: if self.dependencies: height: int = 10