Fixed build for ponce

This commit is contained in:
Dimitris Zlatanidis 2023-03-13 20:07:03 +02:00
parent 0985354a49
commit fa636ac0e5

View file

@ -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':