From fa636ac0e5d6a972a025e9764aeec9a0e34bb8e0 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 13 Mar 2023 20:07:03 +0200 Subject: [PATCH] Fixed build for ponce --- slpkg/slackbuild.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index c858e249..19eb5b83 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -89,6 +89,15 @@ class Slackbuilds(Configs): for deps in self.sbos.values(): for dep in deps: + # Checks if dependency exists in the ponce repository. + # Sometimes the dependency reference is in the .info file, + # but there is not exist in the repository as a folder. + if self.ponce_repo: + location: str = SBoQueries(dep).location() + path_ponce_repo_package = Path(self.ponce_repo_path, location, dep) + if not path_ponce_repo_package.is_dir(): + continue + # Checks if the package was installed and skipped. if (self.utils.is_option(self.flag_skip_installed, self.flags) and self.utils.is_package_installed(dep, self.file_pattern)): @@ -124,7 +133,7 @@ class Slackbuilds(Configs): self.view_message.question() - def is_for_skipped(self, sbo) -> Literal[True]: + def is_not_for_skipped(self, sbo) -> Literal[True]: """ Condition to check if slackbuild is for skipped. """ return (not self.utils.is_package_installed(sbo, self.file_pattern) or self.utils.is_package_upgradeable(sbo, self.file_pattern) or @@ -137,11 +146,10 @@ class Slackbuilds(Configs): for sbo in self.install_order: - if self.is_for_skipped(sbo): + if self.is_not_for_skipped(sbo): file: str = f'{sbo}{self.sbo_tar_suffix}' - self.utils.remove_file_if_exists(self.build_path, file) self.utils.remove_folder_if_exists(self.build_path, sbo) location: str = SBoQueries(sbo).location() @@ -154,17 +162,13 @@ class Slackbuilds(Configs): shutil.copytree(path_ponce_repo_package, f'{self.build_path}{sbo}') slackbuild = Path(path_build_package, f'{sbo}.SlackBuild') os.chmod(slackbuild, 0o775) - else: - print(f"[{self.bred}Error{self.endc}]: package " - f"'{self.cyan}{sbo}{self.endc}' not found in the repository.") - self.view_message.question() - self.install_order.remove(sbo) - continue + else: + self.utils.remove_file_if_exists(self.build_path, file) sbo_url: str = f'{self.sbo_repo_url}{location}/{file}' sbos_urls.append(sbo_url) - sources_urls += SBoQueries(sbo).sources() + sources_urls += SBoQueries(sbo).sources() urls: list = sources_urls # Combine sbos and sources. @@ -199,7 +203,6 @@ class Slackbuilds(Configs): def checksum_downloads(self) -> None: """ Checking the correct checksums. """ for sbo in self.install_order: - path = Path(self.build_path, sbo) checksums = SBoQueries(sbo).checksum() sources = SBoQueries(sbo).sources() @@ -212,8 +215,7 @@ class Slackbuilds(Configs): """ Build the slackbuilds and install. """ for sbo in self.install_order: - if self.is_for_skipped(sbo): - + if self.is_not_for_skipped(sbo): self.build_the_script(self.build_path, sbo) if not self.mode == 'build':