Updated find installation package in /tmp

This commit is contained in:
Dimitris Zlatanidis 2022-06-26 22:55:19 +03:00
parent efff260ba9
commit fcaa619aab
3 changed files with 10 additions and 26 deletions

View file

@ -1,6 +1,8 @@
4.1.3 - 26/06/2022
Bugfixed:
- /tmp permissions after installation
Updated:
- find installation binary file in /tmp folder
4.1.2 - 24/06/2022
Bugfixed:

View file

@ -147,11 +147,16 @@ class Slackbuilds:
''' Creating a list with all the finished packages for
installation.
'''
build_tag, arch = self.utils.read_dot_slackbuild(self.build_path, name)
version = SBoQueries(name).version()
return (f'{name}-{version}-{arch}-{build_tag[0]}'
f'{self.repo_tag}{self.pkg_suffix}')
packages = []
pkg = f'{name}-{version}'
for package in os.listdir(self.tmp_path):
if pkg in package:
packages.append(package)
return max(packages)
def execute_the_script(self, path: str, name: str):
''' Run the .SlackBuild script. '''

View file

@ -3,7 +3,6 @@
import os
import re
import shutil
import tarfile
@ -15,28 +14,6 @@ from slpkg.configs import Configs
@dataclass
class Utilities:
log_packages: str = Configs.log_packages
os_arch: str = Configs.os_arch
def read_dot_slackbuild(self, path: str, name: str):
''' Opens the .SlackBuild file and reads the BUILD TAG and ARCH. '''
folder = f'{path}/{name}'
slackbuild = f'{name}.SlackBuild'
if os.path.isfile(f'{folder}/{slackbuild}'):
with open(f'{folder}/{slackbuild}', 'r', encoding='utf-8') as sbo:
lines = sbo.read().splitlines()
build_tag = arch = ''
for line in lines:
if line.startswith('BUILD'):
build_tag = re.findall(r'\d+', line)
if line.startswith('ARCH'):
arch = line.replace('ARCH=', '')
if not arch:
arch = self.os_arch
return build_tag, arch
def untar_archive(self, path: str, archive: str, ext_path: str):
''' Untar the file to the build folder. '''