Check if the script exists

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-11-06 20:32:19 +02:00
parent 5f092d0835
commit 222ae7d0c6

View file

@ -126,14 +126,16 @@ class Slackbuilds:
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)
if os.path.isfile(sbo_script):
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. '''