From ee8eaf5ae33b5c122f56d443a0ee18574de0d3df Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 17:49:27 +0300 Subject: [PATCH 01/10] Bugfix TypeError: exceptions must derive from BaseException Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 4 ++++ README.md | 2 +- slpkg/__metadata__.py | 2 +- slpkg/arguments.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4116600a..b4020ce4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +3.9.8 - 12/05/2022 +Bugfix: +- TypeError: exceptions must derive from BaseException + 3.9.7 - 09/05/2022 Fixed: - Stderr error output diff --git a/README.md b/README.md index d3efcf67..768a1d8f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# slpkg 3.9.7 +# slpkg 3.9.8 Slpkg is a powerful software package manager that installs, updates, and removes packages on [Slackware](http://www.slackware.com/) based systems. It automatically computes dependencies and diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 3ba3f081..29a6084a 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -81,7 +81,7 @@ class MetaData: __all__ = "slpkg" __author__ = "dslackw" - __version_info__ = (3, 9, 7) + __version_info__ = (3, 9, 8) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com" diff --git a/slpkg/arguments.py b/slpkg/arguments.py index 3c0846f6..3f5a5429 100644 --- a/slpkg/arguments.py +++ b/slpkg/arguments.py @@ -225,7 +225,7 @@ def usage(repo, stderr): else: error_repo = (f"slpkg: Error: Repository '{repo}' does not exist" "\n") - raise(f"\n {error_repo}") + raise SystemExit(f"\n{error_repo}") print(usage.__doc__) print("For more information try 'slpkg -h, --help' or view manpage\n") if stderr == 1: From 1c77eaa3f3679d7db0efd9b693eb86297c06e208 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 17:51:22 +0300 Subject: [PATCH 02/10] Fixed stderr error output Signed-off-by: Dimitris Zlatanidis --- slpkg/sbo/slackbuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 224e234f..37026309 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -166,7 +166,7 @@ class SBoInstall(BlackList, Utils): self.continue_to_install() else: self.msg.not_found(self.is_upgrade) - raise SystemExit(1) + raise SystemExit() def case_insensitive(self): """Matching packages distinguish between uppercase and From b4e30fc579f4de5f188b3b478c76e1ee755d90ba Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 17:55:32 +0300 Subject: [PATCH 03/10] Switch to bash Signed-off-by: Dimitris Zlatanidis --- slackbuild/slpkg.SlackBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 67e8a27b..2ac8511c 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for slpkg From 7a0c66807219063380c564881bfdb54328f59668 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 17:56:10 +0300 Subject: [PATCH 04/10] Switch to bash Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index b4020ce4..428cf02e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,8 @@ 3.9.8 - 12/05/2022 Bugfix: - TypeError: exceptions must derive from BaseException +Updated: +- Slackbuild script switch to bash shell 3.9.7 - 09/05/2022 Fixed: From 1ea79f0dfa2479226b76202d6c7a77c0a0763334 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 17:57:36 +0300 Subject: [PATCH 05/10] Installer switch to bash shell Signed-off-by: Dimitris Zlatanidis --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 3b263624..7851ab93 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # install.sh file is part of slpkg. From b2ae4748fe8c721cd13316803c579eee0e93d4a1 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 18:18:13 +0300 Subject: [PATCH 06/10] Fixed raise and clear the screen Signed-off-by: Dimitris Zlatanidis --- slpkg/sbo/network.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index f8f2b005..e18a16c0 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -300,7 +300,8 @@ class SBoNetwork(BlackList, Utils): status = False pkg = DialogUtil(data, text, title, backtitle, status).checklist() if pkg and len(pkg) > 1: - raise SystemExit("\nslpkg: Error: Choose only one package") + os.system("clear") + raise SystemExit("\nslpkg: Error: Choose only one package\n") if pkg is None: raise SystemExit(1) self.name = "".join(pkg) @@ -341,7 +342,8 @@ class SBoNetwork(BlackList, Utils): if self.FAULT: print() self.msg.template(78) - print(f"| Package {self.prgnam} {self.red} {self.FAULT} {self.endc}") + print(f"| Package {self.prgnam} {self.red} {self.FAULT} " + f"{self.endc}") self.msg.template(78) else: sources = [] From ba8193b90ac90bc865fdde8662e64c34ee489deb Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 19:22:25 +0300 Subject: [PATCH 07/10] Fixed stderr error output Signed-off-by: Dimitris Zlatanidis --- slpkg/auto_pkg.py | 3 +-- slpkg/dialog_box.py | 4 ++-- slpkg/upgrade_checklist.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/slpkg/auto_pkg.py b/slpkg/auto_pkg.py index cf2c884a..86b1310a 100644 --- a/slpkg/auto_pkg.py +++ b/slpkg/auto_pkg.py @@ -61,8 +61,7 @@ class Auto: try: self.choice = input(" > ") except EOFError: - print() - raise SystemExit() + raise SystemExit("\n") if self.choice in self.commands.keys(): print(f" \x1b[1A{self.cyan}{self.commands[self.choice]}" f"{self.endc}", end="\n\n") diff --git a/slpkg/dialog_box.py b/slpkg/dialog_box.py index ce9507bc..eb9a513a 100644 --- a/slpkg/dialog_box.py +++ b/slpkg/dialog_box.py @@ -43,8 +43,8 @@ class DialogUtil: def imp_dialog(self): try: from dialog import Dialog - except ImportError: - raise SystemExit() + except ImportError as er: + raise SystemExit(er) self.d = Dialog(dialog="dialog", autowidgetsize=True) def checklist(self): diff --git a/slpkg/upgrade_checklist.py b/slpkg/upgrade_checklist.py index 9127418b..daa2f8af 100644 --- a/slpkg/upgrade_checklist.py +++ b/slpkg/upgrade_checklist.py @@ -53,6 +53,6 @@ def choose_upg(packages): if name in packages: selected_packages.append(name) if not selected_packages: - raise SystemExit() + raise SystemExit(1) print() return selected_packages From 6255a130305ca3fae49a836afb2ca741b61323b0 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 20:02:52 +0300 Subject: [PATCH 08/10] Updated queues Signed-off-by: Dimitris Zlatanidis --- slpkg/sbo/queue.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/slpkg/sbo/queue.py b/slpkg/sbo/queue.py index b7caf30e..433be96a 100644 --- a/slpkg/sbo/queue.py +++ b/slpkg/sbo/queue.py @@ -82,16 +82,17 @@ class QueuePkgs(Utils): def listed(self): """Print packages from queue """ - print("Packages in the queue:\n") + print("Packages in the queue:") for pkg in self.packages(): print(f"{self.green}{pkg}{self.endc}") + print() def add(self, pkgs): """Add packages in queue if not exist """ queue_list = list(self.packages()) pkgs = list(OrderedDict.fromkeys(pkgs)) - print("Add packages in the queue:\n") + print("Add packages in the queue:") with open(self.queue_list, "a") as queue: for pkg in pkgs: find = sbo_search_pkg(pkg) @@ -100,24 +101,30 @@ class QueuePkgs(Utils): queue.write(pkg + "\n") else: print(f"{self.red}{pkg}{self.endc}") + print() def remove(self, pkgs): """Remove packages from queue """ - print("Remove packages from the queue:\n") + print("Remove packages from the queue:") with open(self.queue_list, "w") as queue: for line in self.queued.splitlines(): if line not in pkgs: queue.write(line + "\n") else: print(f"{self.red}{line}{self.endc}") + print() def build(self): """Build packages from queue """ + sources = [] packages = list(self.packages()) if packages: for pkg in packages: + if pkg not in SBoGrep(pkg).names(): + raise SystemExit(f"\nPackage '{pkg}' was not found in " + f"the SBo repository\n") if not os.path.exists(self.meta.build_path): os.mkdir(self.meta.build_path) if not os.path.exists(self._SOURCES): @@ -125,7 +132,6 @@ class QueuePkgs(Utils): sbo_url = sbo_search_pkg(pkg) sbo_dwn = SBoLink(sbo_url).tar_gz() source_dwn = SBoGrep(pkg).source().split() - sources = [] os.chdir(self.meta.build_path) script = sbo_dwn.split("/")[-1] Download(self.meta.build_path, sbo_dwn.split(), From 71e530d66dc214aba1dc885ec5c1f2a1f9d72337 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 20:07:07 +0300 Subject: [PATCH 09/10] Updated changelog Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 428cf02e..e5c94670 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,6 @@ 3.9.8 - 12/05/2022 Bugfix: -- TypeError: exceptions must derive from BaseException +- Flag (--repos=) TypeError: exceptions must derive from BaseException Updated: - Slackbuild script switch to bash shell From 86957fb9e655396704f1f8bfffac64e5dcb1c434 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 12 May 2022 20:15:12 +0300 Subject: [PATCH 10/10] Updated blacklist prints Signed-off-by: Dimitris Zlatanidis --- slpkg/blacklist.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/slpkg/blacklist.py b/slpkg/blacklist.py index 762b3cad..dcc8f751 100644 --- a/slpkg/blacklist.py +++ b/slpkg/blacklist.py @@ -67,30 +67,33 @@ class BlackList(Utils): def black_listed(self): """Print blacklist packages """ - print("Packages in the blacklist:\n") + print("Packages in the blacklist:") for black in list(self.black_filter()): if black: print(f"{self.green}{black}{self.endc}") + print() def black_add(self, pkgs): """Add blacklist packages if not exist """ blacklist = list(self.black_filter()) pkgs = set(pkgs) - print("Add packages in the blacklist:\n") + print("Add packages in the blacklist:") with open(self.blackfile, "a") as black_conf: for pkg in pkgs: if pkg not in blacklist: print(f"{self.green}{pkg}{self.endc}") black_conf.write(pkg + "\n") + print() def black_remove(self, pkgs): """Remove packages from blacklist """ - print("Remove packages from the blacklist:\n") + print("Remove packages from the blacklist:") with open(self.blackfile, "w") as remove: for line in self.black_conf.splitlines(): if line not in pkgs: remove.write(line + "\n") else: - print(f"{self.red}{line}{self.endc}") \ No newline at end of file + print(f"{self.red}{line}{self.endc}") + print()