Added patching SBo TAG from the configuration file #147

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-10-30 21:20:05 +02:00
parent 8e0849b20d
commit 4d3c0a7778
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,7 @@
4.2.4 - 30/10/2022
Added:
- Patching SBo TAG from the configuration file
4.2.3 - 28/10/2022
Updated:
- Creating all necessary paths from the config file

View file

@ -28,6 +28,7 @@ class Slackbuilds:
session: str = Session
utils: str = Utilities()
build_path: str = Configs.build_path
sbo_repo_tag: str = Configs.sbo_repo_tag
sbo_repo_url: str = Configs.sbo_repo_url
build_path: str = Configs.build_path
tmp_slpkg: str = Configs.tmp_slpkg
@ -107,6 +108,8 @@ class Slackbuilds:
self.utils.untar_archive(self.tmp_slpkg, file, self.build_path)
self.patch_sbo_tag(sbo)
sources = SBoQueries(sbo).sources()
self.download_sources(sbo, sources)
@ -120,6 +123,18 @@ class Slackbuilds:
if '--resolve-off' not in self.flags:
self.logging_installed_dependencies(sbo)
def patch_sbo_tag(self, sbo):
''' Patching SBo TAG from the configuration file. '''
sbo_script = f'{self.build_path}/{sbo}/{sbo}.SlackBuild'
with open(sbo_script, 'r', encoding='utf-8') as f:
lines = f.readlines()
with open(sbo_script, 'w') as script:
for line in lines:
if line.startswith('TAG=$'):
line = f'TAG=${{TAG:-{self.sbo_repo_tag}}}\n'
script.write(line)
def logging_installed_dependencies(self, name: str):
''' Logging installed dependencies and used for remove. '''
exist = self.session.query(LogsDependencies.name).filter(