From b62759849c84f3e326ccad87a350629fd73bd785 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 17:28:11 +0200 Subject: [PATCH 01/14] Fixed for directory --- slpkg/views/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slpkg/views/views.py b/slpkg/views/views.py index c9042fbc..62fbe309 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -34,7 +34,7 @@ class ViewMessage(Configs): self.grey: str = self.color['grey'] self.violet: str = self.color['violet'] self.endc: str = self.color['endc'] - self.download_only = None + self.download_only = self.tmp_slpkg self.installed_packages: list = [] self.flag_resolve_off: list = ['-o', '--resolve-off'] self.flag_reinstall: list = ['-r', '--reinstall'] From d13f5834f65022b2a935872fb46d202098916496 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 17:53:37 +0200 Subject: [PATCH 02/14] Updated for version 4.5.4 --- README.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a0e7c370..68c5f00a 100644 --- a/README.rst +++ b/README.rst @@ -31,8 +31,8 @@ Install from the official third-party `SBo repository `_ repository +- `ponce `_ repository + + Donate ------ From b7b461774d799d2260ed58715ba9c9dad9bca33a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 19:30:11 +0200 Subject: [PATCH 03/14] Updated unittest --- tests/test_queries.py | 8 ++++---- tests/test_utilities.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_queries.py b/tests/test_queries.py index 59bcae44..8e18c226 100644 --- a/tests/test_queries.py +++ b/tests/test_queries.py @@ -15,16 +15,16 @@ class TestSBoQueries(unittest.TestCase): def test_sources(self): self.assertEqual(['https://gitlab.com/dslackw/slpkg/-/archive' - '/4.3.7/slpkg-4.3.7.tar.gz'], self.query.sources()) + '/4.5.3/slpkg-4.5.3.tar.gz'], self.query.sources()) def test_requires(self): - self.assertEqual(['SQLAlchemy', 'python-toml'], self.query.requires()) + self.assertEqual(['SQLAlchemy', 'python3-pythondialog', 'python3-progress'], self.query.requires()) def test_version(self): - self.assertEqual('4.3.7', self.query.version()) + self.assertEqual('4.5.3', self.query.version()) def test_checksum(self): - self.assertListEqual(['5a55fd350004b3e49a060835a7ada3e9'], + self.assertListEqual(['d76c95208a4c1cc2d6121417885eb8a8'], self.query.checksum()) def test_files(self): diff --git a/tests/test_utilities.py b/tests/test_utilities.py index 9ef41f54..c6ff853e 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -10,7 +10,7 @@ class TestUtilities(unittest.TestCase): self.configs = Configs() self.file_pattern = f'*{self.configs.sbo_repo_tag}' self.build_path = Configs.build_path - self.package = 'fish-3.4.0-x86_64-2_SBo' + self.package = 'fish-3.6.0-x86_64-1_SBo' def test_ins_installed(self): self.assertEqual(self.package, self.utils.is_installed('fish', self.file_pattern)) @@ -19,13 +19,13 @@ class TestUtilities(unittest.TestCase): self.assertEqual('fish', self.utils.split_installed_pkg(self.package)[0]) def test_split_version(self): - self.assertEqual('3.4.0', self.utils.split_installed_pkg(self.package)[1]) + self.assertEqual('3.6.0', self.utils.split_installed_pkg(self.package)[1]) def test_split_arch(self): self.assertEqual('x86_64', self.utils.split_installed_pkg(self.package)[2]) def test_split_build(self): - self.assertEqual('2', self.utils.split_installed_pkg(self.package)[3]) + self.assertEqual('1', self.utils.split_installed_pkg(self.package)[3]) def test_split_tag(self): self.assertEqual('SBo', self.utils.split_installed_pkg(self.package)[4]) From d9f4cb44401d278ac03cabe93dfaa02b7a2ca220 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 19:35:26 +0200 Subject: [PATCH 04/14] Updated for cli --- README.rst | 22 +++++++++++----------- slpkg/views/cli_menu.py | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 68c5f00a..8f72c9e8 100644 --- a/README.rst +++ b/README.rst @@ -54,7 +54,7 @@ Usage .. code-block:: bash $ slpkg --help - USAGE: slpkg [OPTIONS] [COMMAND] + USAGE: slpkg [OPTIONS] [COMMAND] [packages...] DESCRIPTION: Package manager utility for Slackware. @@ -66,15 +66,15 @@ Usage -g, configs Edit the configuration file. -L, clean-logs Clean dependencies log tracking. -D, clean-tmp Deletes all the downloaded sources. - -b, build Build only the packages. - -i, install Build and install the packages. - -d, download Download only the scripts and sources. - -R, remove Remove installed packages. - -f, find Find installed packages. - -w, view View packages from the repository. - -s, search Search packages from the repository. - -e, dependees Show which packages depend. - -t, tracking Tracking the packages dependencies. + -b, build [packages...] Build only the packages. + -i, install [packages...] Build and install the packages. + -d, download [packages...] Download only the scripts and sources. + -R, remove [packages...] Remove installed packages. + -f, find [packages...] Find installed packages. + -w, view [packages...] View packages from the repository. + -s, search [packages...] Search packages from the repository. + -e, dependees [packages...] Show which packages depend. + -t, tracking [packages...] Tracking the packages dependencies. OPTIONS: -y, --yes Answer Yes to all questions. @@ -93,7 +93,7 @@ Usage -v, --version Print version and exit. If you need more information try to use slpkg manpage. - Extra help for the commands, use: 'slpkg help '. + Extra help for the commands, use: 'slpkg help [command]'. Edit the config file in the /etc/slpkg/slpkg.toml or 'slpkg configs'. diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 33e0aeec..e2ebacc4 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -72,7 +72,7 @@ class Usage(Configs): '\n -h, --help Show this message and exit.\n' ' -v, --version Print version and exit.\n' "\nIf you need more information try to use slpkg manpage.\n" - "Extra help for the commands, use: 'slpkg help '.\n" + "Extra help for the commands, use: 'slpkg help [command]'.\n" "Edit the config file in the /etc/slpkg/slpkg.toml or 'slpkg configs'.") print(args) From 8830889c45c9e9363ac4d17001cfe680631d0e22 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 19:36:58 +0200 Subject: [PATCH 05/14] Removed header --- slpkg/views/help_commands.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/slpkg/views/help_commands.py b/slpkg/views/help_commands.py index 00c19f93..c76cd38d 100644 --- a/slpkg/views/help_commands.py +++ b/slpkg/views/help_commands.py @@ -60,10 +60,7 @@ class Help(Configs): help_commands['-e']: dict = help_commands['dependees'] help_commands['-t']: dict = help_commands['tracking'] - print(f'Usage: {self.prog_name} [{self.yellow}OPTIONS{self.endc}] ' - f'[{self.cyan}COMMAND{self.endc}] [PACKAGES...]') - print(f"Try 'slpkg --help' for help.\n") - print(f'{self.bold}{self.green}Help: {self.endc}{help_commands[self.command]}\n') + print(f'\n{self.bold}{self.green}Help: {self.endc}{help_commands[self.command]}\n') print(f"{self.bold}COMMAND{self.endc}: {self.cyan}{self.command}{self.endc}") print(f"{self.bold}OPTIONS:{self.endc} {self.yellow}{', '.join(self.flags)}{self.endc}\n") - print('If you need more information try to use slpkg manpage.') + print('If you need more information try to use slpkg manpage.\n') From 0fccf85c39ccc7c84e9d5cf20014c8942b7cd7ac Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 19:58:36 +0200 Subject: [PATCH 06/14] Updated for suffix --- slpkg/downloader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 241034d8..db33fe44 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -43,6 +43,10 @@ class Downloader(Configs, Utilities): def transfer_tools(self) -> NoReturn: """ Wget downloader. """ + + if 'slackbuilds.org' in self.url: + self.filename = f'{self.url.split("/")[-1]}{self.sbo_tar_suffix}' + if self.downloader == 'wget': self.output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} ' f'"{self.url}"', shell=True, stderr=self.stderr, stdout=self.stdout) From d336580ebbf08b8039e3e312a2205c76cb6a5d3c Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:07:02 +0200 Subject: [PATCH 07/14] Updated for slackbuild name --- slpkg/slackbuild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index a640df57..4c04cc8a 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -257,6 +257,7 @@ class Slackbuilds(Configs): if self.utils.is_option(self.flag_jobs, self.flags): self.set_makeflags() + name = f'{name}.SlackBuild' message: str = f'{self.red}Build{self.endc}' self.process_message: str = f"package '{name}' to build" From 5b4037c6b2991795004fef1735c2db13c092bed4 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:09:01 +0200 Subject: [PATCH 08/14] Updated for comments --- slpkg/downloader.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index db33fe44..aef71131 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -42,7 +42,12 @@ class Downloader(Configs, Utilities): self.flag_no_silent: list = ['-n', '--no-silent'] def transfer_tools(self) -> NoReturn: - """ Wget downloader. """ + """ Downloader tools. + + wget, curl and lftp works with SBo repository. + + lftp works with the ponce repository only. + """ if 'slackbuilds.org' in self.url: self.filename = f'{self.url.split("/")[-1]}{self.sbo_tar_suffix}' From d4aa87ccd4c52d1f4a5b2d91091c22817d1a8204 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:09:58 +0200 Subject: [PATCH 09/14] Updated for code style --- slpkg/downloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index aef71131..0391c031 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -63,7 +63,7 @@ class Downloader(Configs, Utilities): if self.ponce_repo and 'ponce' in self.url: # Download files from a directory. - self.output = subprocess.call(f"lftp {self.lftp_mirror_options} {self.url} {self.path}", + self.output = subprocess.call(f'lftp {self.lftp_mirror_options} {self.url} {self.path}', shell=True, stderr=self.stderr, stdout=self.stdout) # Create /path/name.Slackbuild slackbuild = Path(self.path, f'{str(self.path).split("/")[-1]}.SlackBuild') @@ -72,7 +72,7 @@ class Downloader(Configs, Utilities): os.chmod(slackbuild, 0o775) else: # Download binaries files and the sources. - self.output = subprocess.call(f"lftp {self.lftp_get_options} {self.url} -o {self.path}", + self.output = subprocess.call(f'lftp {self.lftp_get_options} {self.url} -o {self.path}', shell=True, stderr=self.stderr, stdout=self.stdout) else: From 14a9ad4073f28da0278b047459a6dc6562470d73 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:10:40 +0200 Subject: [PATCH 10/14] Removed unused --- slpkg/downloader.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 0391c031..ac3b0ecd 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -127,9 +127,6 @@ class Downloader(Configs, Utilities): # Restore the terminal cursor print('\x1b[?25h', self.endc) else: - # if self.ponce_repo and 'ponce' in self.url: - # self.lftp() - # else: self.transfer_tools() self.check_if_downloaded() From 54bd1335bd0ed9f996841c2892327875ea215421 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:25:13 +0200 Subject: [PATCH 11/14] Removed for filename --- slpkg/downloader.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index ac3b0ecd..94e48f2e 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -49,9 +49,6 @@ class Downloader(Configs, Utilities): lftp works with the ponce repository only. """ - if 'slackbuilds.org' in self.url: - self.filename = f'{self.url.split("/")[-1]}{self.sbo_tar_suffix}' - if self.downloader == 'wget': self.output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} ' f'"{self.url}"', shell=True, stderr=self.stderr, stdout=self.stdout) From 282087e787107565df9f4847886593312653db02 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:30:40 +0200 Subject: [PATCH 12/14] Updated for code style --- slpkg/downloader.py | 1 - 1 file changed, 1 deletion(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 94e48f2e..8a3ec430 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -48,7 +48,6 @@ class Downloader(Configs, Utilities): lftp works with the ponce repository only. """ - if self.downloader == 'wget': self.output = subprocess.call(f'{self.downloader} {self.wget_options} --directory-prefix={self.path} ' f'"{self.url}"', shell=True, stderr=self.stderr, stdout=self.stdout) From 17e5a35047d707cea0fb71c7dd6edc06a9ace94a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:34:54 +0200 Subject: [PATCH 13/14] Added message --- slpkg/update_repository.py | 1 + 1 file changed, 1 insertion(+) diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 90704ccb..b1e81b04 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -34,6 +34,7 @@ class UpdateRepository(Configs): view.question() print('Updating the package list...\n') + print('Downloading some necessary files, please wait...\n') self.delete_file(self.sbo_repo_path, self.sbo_txt) self.delete_file(self.sbo_repo_path, self.sbo_chglog_txt) self.delete_file(self.slack_chglog_path, self.slack_chglog_txt) From ff77b7f6cd97d8b055b7afa8353b673521d17142 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Mar 2023 20:37:27 +0200 Subject: [PATCH 14/14] Updated the message --- slpkg/update_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index b1e81b04..12400409 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -33,7 +33,7 @@ class UpdateRepository(Configs): view.question() - print('Updating the package list...\n') + print('Updating the package list.\n') print('Downloading some necessary files, please wait...\n') self.delete_file(self.sbo_repo_path, self.sbo_txt) self.delete_file(self.sbo_repo_path, self.sbo_chglog_txt)