Updated for utilities

This commit is contained in:
Dimitris Zlatanidis 2022-06-18 00:27:11 +03:00
parent 8b49133be2
commit e70685aac9

View file

@ -24,6 +24,7 @@ class Slackbuilds:
flags: list
install: bool
session: str = Session
utils: str = Utilities()
build_path: str = Metadata.build_path
sbo_url: str = Metadata.sbo_url
build_path: str = Metadata.build_path
@ -54,7 +55,7 @@ class Slackbuilds:
view = ViewMessage()
if self.install:
view.install_packages(self.sbos_order)
view.install_packages(self.sbos_order, self.slackbuilds)
else:
view.build_packages(self.sbos_order)
@ -80,7 +81,6 @@ class Slackbuilds:
def download_slackbuilds_and_build(self):
''' Downloads files and sources and starting the build. '''
wget = Wget()
utils = Utilities()
for sbo in self.sbos_order:
file = f'{sbo}{self.tar_suffix}'
@ -93,7 +93,7 @@ class Slackbuilds:
wget.download(self.tmp_slpkg, url)
utils.untar_archive(self.tmp_slpkg, file, self.build_path)
self.utils.untar_archive(self.tmp_slpkg, file, self.build_path)
sources = SBoQueries(sbo).sources()
self.download_sources(sbo, sources)
@ -131,7 +131,8 @@ class Slackbuilds:
def install_package(self, package):
''' Install the packages that before created in the tmp directory. '''
execute = self.installpkg
if '--reinstall' in self.flags:
if ('--reinstall' in self.flags or
self.utils.is_installed(package[:-4])):
execute = self.reinstall
command = f'{execute} {self.tmp_path}/{package}'
subprocess.call(command, shell=True)
@ -140,8 +141,7 @@ class Slackbuilds:
''' Creating a list with all the finished packages for
installation.
'''
utils = Utilities()
build_tag = utils.build_tag(self.build_path, name)
build_tag = self.utils.build_tag(self.build_path, name)
version = SBoQueries(name).version()
return (f'{name}-{version}-{self.os_arch}-{build_tag[0]}'
f'{self.repo_tag}{self.pkg_suffix}')