From efff260ba984bc0cfceea1d20ac5c1cdd1480e63 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 26 Jun 2022 18:59:46 +0300 Subject: [PATCH 1/3] Bugfixed /tmp permissions after installation --- ChangeLog.txt | 4 ++++ README.rst | 4 ++-- setup.py | 3 +-- slpkg/configs.py | 4 ++++ slpkg/version.py | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 19b9c6c4..20efb787 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +4.1.3 - 26/06/2022 +Bugfixed: +- /tmp permissions after installation + 4.1.2 - 24/06/2022 Bugfixed: - Installing noarch packages diff --git a/README.rst b/README.rst index faa3a40b..cace843e 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Install from the official third-party `SBo repository Date: Sun, 26 Jun 2022 22:55:19 +0300 Subject: [PATCH 2/3] Updated find installation package in /tmp --- ChangeLog.txt | 2 ++ slpkg/slackbuild.py | 11 ++++++++--- slpkg/utilities.py | 23 ----------------------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 20efb787..53ee34ce 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -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: diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index 7bbbf5ac..a3dcdc2e 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -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. ''' diff --git a/slpkg/utilities.py b/slpkg/utilities.py index c5d67031..e5e41aa5 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -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. ''' From 321eb7e10257da3d68d197f1db7073d4451ef96b Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 27 Jun 2022 15:55:05 +0300 Subject: [PATCH 3/3] Updated tests --- slpkg/slackbuild.py | 4 ++-- tests/test_configs.py | 2 +- tests/test_utilities.py | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index a3dcdc2e..46387001 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -105,7 +105,7 @@ class Slackbuilds: sources = SBoQueries(sbo).sources() self.download_sources(sbo, sources) - self.execute_the_script(self.build_path, sbo) + self.build_the_script(self.build_path, sbo) if self.install: @@ -158,7 +158,7 @@ class Slackbuilds: return max(packages) - def execute_the_script(self, path: str, name: str): + def build_the_script(self, path: str, name: str): ''' Run the .SlackBuild script. ''' folder = f'{path}/{name}/' slackbuild = f'./{name}.SlackBuild' diff --git a/tests/test_configs.py b/tests/test_configs.py index 51aa9c00..0f35d22c 100644 --- a/tests/test_configs.py +++ b/tests/test_configs.py @@ -13,7 +13,7 @@ class TestConfigs(unittest.TestCase): self.os_arch = Configs.os_arch def test_repo_version(self): - self.assertEqual('15.0', self.repo_version) + self.assertEqual(15.0, self.repo_version) def test_sbo_txt(self): self.assertEqual('SLACKBUILDS.TXT', self.sbo_txt) diff --git a/tests/test_utilities.py b/tests/test_utilities.py index 44a27c37..fe98b492 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -9,12 +9,9 @@ class TestUtilities(unittest.TestCase): self.utils = Utilities() self.build_path = Configs.build_path - def test_build_tag(self): - self.assertEqual(['2'], self.utils.build_tag(self.build_path, - 'fish')) - def test_ins_installed(self): - self.assertEqual(True, self.utils.is_installed('fish-3.4.0')) + self.assertEqual('fish-3.4.0-x86_64-2_SBo', self.utils.is_installed( + 'fish-3.4.0')) if __name__ == '__main__':