diff --git a/README.rst b/README.rst index a0e7c370..8f72c9e8 100644 --- a/README.rst +++ b/README.rst @@ -31,8 +31,8 @@ Install from the official third-party `SBo repository + 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'. @@ -109,6 +109,16 @@ Configuration files /etc/slpkg/blacklist.toml Blacklist of packages + +Repositories +------------ + +Two repositories are supported, please read the config file. + +- `slackbuilds.org `_ repository +- `ponce `_ repository + + Donate ------ diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 241034d8..8a3ec430 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 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) @@ -54,7 +59,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') @@ -63,7 +68,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: @@ -118,9 +123,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() 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" diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 90704ccb..12400409 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -33,7 +33,8 @@ 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) self.delete_file(self.slack_chglog_path, self.slack_chglog_txt) 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) 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') 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'] 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])