From 20c4b2a9a82388e5ec684543f675d8004de7df1c Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 24 Jun 2022 21:16:10 +0300 Subject: [PATCH 1/3] Bugfixed install noarch packages --- ChangeLog.txt | 4 ++++ slpkg/slackbuild.py | 8 ++++++-- slpkg/utilities.py | 12 ++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 023dff0f..19b9c6c4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +4.1.2 - 24/06/2022 +Bugfixed: +- Installing noarch packages + 4.1.1 - 23/06/2022 Updated: - Cli menu view with colors diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index 25e56fc5..a390ec1c 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -148,9 +148,13 @@ class Slackbuilds: ''' Creating a list with all the finished packages for installation. ''' - build_tag = self.utils.build_tag(self.build_path, name) + build_tag, arch = self.utils.read_dot_slackbuild(self.build_path, name) version = SBoQueries(name).version() - return (f'{name}-{version}-{self.os_arch}-{build_tag[0]}' + + if not arch: + arch = self.os_arch + + return (f'{name}-{version}-{arch}-{build_tag[0]}' f'{self.repo_tag}{self.pkg_suffix}') def execute_the_script(self, path: str, name: str): diff --git a/slpkg/utilities.py b/slpkg/utilities.py index ef8bcbea..d148e5e5 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -16,18 +16,22 @@ from slpkg.configs import Configs class Utilities: log_packages: str = Configs.log_packages - def build_tag(self, path: str, name: str): - ''' Opens the .SlackBuild file and reads the BUILD TAG. ''' + 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.readlines() + lines = sbo.read().splitlines() + build_tag = arch = '' for line in lines: if line.startswith('BUILD'): - return re.findall(r'\d+', line) + build_tag = re.findall(r'\d+', line) + if line.startswith('ARCH'): + arch = line.replace('ARCH=', '') + return build_tag, arch def untar_archive(self, path: str, archive: str, ext_path: str): ''' Untar the file to the build folder. ''' From 9cfa46f7e8f7cf88d5de2b469b8c558fbc83d24f Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 24 Jun 2022 22:44:26 +0300 Subject: [PATCH 2/3] Updated for version 4.1.2 --- README.rst | 4 ++-- slpkg/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ef1b682d..faa3a40b 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Install from the official third-party `SBo repository Date: Fri, 24 Jun 2022 22:48:33 +0300 Subject: [PATCH 3/3] Updated install by arch --- slpkg/slackbuild.py | 4 ---- slpkg/utilities.py | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index a390ec1c..7bbbf5ac 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -33,7 +33,6 @@ class Slackbuilds: tmp_slpkg: str = Configs.tmp_slpkg tmp_path: str = Configs.tmp_path tar_suffix: str = Configs.tar_suffix - os_arch: str = Configs.os_arch repo_tag: str = Configs.repo_tag pkg_suffix: str = Configs.pkg_suffix installpkg: str = Configs.installpkg @@ -151,9 +150,6 @@ class Slackbuilds: build_tag, arch = self.utils.read_dot_slackbuild(self.build_path, name) version = SBoQueries(name).version() - if not arch: - arch = self.os_arch - return (f'{name}-{version}-{arch}-{build_tag[0]}' f'{self.repo_tag}{self.pkg_suffix}') diff --git a/slpkg/utilities.py b/slpkg/utilities.py index d148e5e5..c5d67031 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -15,6 +15,7 @@ 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. ''' @@ -31,6 +32,10 @@ class Utilities: 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):