diff --git a/ChangeLog.txt b/ChangeLog.txt index 311902d8..4f05dae0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,10 @@ +4.2.4 - 30/10/2022 +Added: +- Patching SBo TAG from the configuration file +- Download the SlackBuild script in the view command +Updated: +- The cli help menu + 4.2.3 - 28/10/2022 Updated: - Creating all necessary paths from the config file diff --git a/README.rst b/README.rst index f5233117..1b64176f 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Install from the official third-party `SBo repository Build only the packages. install Build and install the packages. - download Download only the packages. + download Download only the scripts and sources. remove Remove installed packages. find Find installed packages. view View packages from the repository. @@ -64,7 +64,7 @@ Usage --yes Answer Yes to all questions. --jobs Set it for multicore systems. --resolve-off Turns off dependency resolving. - --reinstall Use this option if you want to upgrade. + --reinstall Upgrade packages of the same version. --skip-installed Skip installed packages. -h, --help Show this message and exit. @@ -96,6 +96,6 @@ If you feel satisfied with this project and want to thanks me make a donation. Copyright --------- -- Copyright 2014.2.32 © Dimitris Zlatanidis. +- Copyright 2014-2022 © Dimitris Zlatanidis. - Slackware® is a Registered Trademark of Patrick Volkerding. - Linux is a Registered Trademark of Linus Torvalds. diff --git a/man/slpkg.1 b/man/slpkg.1 index 74932573..06c553dc 100644 --- a/man/slpkg.1 +++ b/man/slpkg.1 @@ -75,8 +75,7 @@ Answer Yes to all questions. .P --jobs .RS -Acceleration of SlackBuild scripts. When the --jobs flag is set, slpkg automatically detects the number of processors and enters it into the MAKEFLAGS variable. Some SlackBuilds fail when -MAKEFLAGS is declared or the number of processors (-j) is greater than one. +Acceleration of SlackBuild scripts. When the --jobs flag is set, slpkg automatically detects the number of processors and enters it into the MAKEFLAGS variable. Some SlackBuilds fail when MAKEFLAGS is declared or the number of processors (-j) is greater than one. .RE .P --resolve-off diff --git a/setup.cfg b/setup.cfg index 595abb43..2af65d32 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = slpkg -version = 4.2.3 +version = 4.2.4 license_file = LICENSE author = Dimitris Zlatanidis author_email = d.zlatanidis@gmail.com diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index 7f3407d8..c729bbe3 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -28,6 +28,7 @@ class Slackbuilds: session: str = Session utils: str = Utilities() build_path: str = Configs.build_path + sbo_repo_tag: str = Configs.sbo_repo_tag sbo_repo_url: str = Configs.sbo_repo_url build_path: str = Configs.build_path tmp_slpkg: str = Configs.tmp_slpkg @@ -107,6 +108,8 @@ class Slackbuilds: self.utils.untar_archive(self.tmp_slpkg, file, self.build_path) + self.patch_sbo_tag(sbo) + sources = SBoQueries(sbo).sources() self.download_sources(sbo, sources) @@ -120,6 +123,18 @@ class Slackbuilds: if '--resolve-off' not in self.flags: self.logging_installed_dependencies(sbo) + def patch_sbo_tag(self, sbo): + ''' Patching SBo TAG from the configuration file. ''' + sbo_script = f'{self.build_path}/{sbo}/{sbo}.SlackBuild' + with open(sbo_script, 'r', encoding='utf-8') as f: + lines = f.readlines() + + with open(sbo_script, 'w') as script: + for line in lines: + if line.startswith('TAG=$'): + line = f'TAG=${{TAG:-{self.sbo_repo_tag}}}\n' + script.write(line) + def logging_installed_dependencies(self, name: str): ''' Logging installed dependencies and used for remove. ''' exist = self.session.query(LogsDependencies.name).filter( diff --git a/slpkg/version.py b/slpkg/version.py index 8af1e7c9..3cb4c146 100644 --- a/slpkg/version.py +++ b/slpkg/version.py @@ -10,7 +10,7 @@ from slpkg.configs import Configs @dataclass class Version: prog_name: str = Configs.prog_name - version_info: tuple = (4, 2, 3) + version_info: tuple = (4, 2, 4) version: str = '{0}.{1}.{2}'.format(*version_info) license: str = 'MIT License' author: str = 'dslackw' diff --git a/slpkg/view_package.py b/slpkg/view_package.py index 0d9efeea..55fceae1 100644 --- a/slpkg/view_package.py +++ b/slpkg/view_package.py @@ -15,6 +15,7 @@ class ViewPackage: session: str = Session colors: dict = Configs.colour sbo_repo_url: str = Configs.sbo_repo_url + sbo_tar_suffix: str = Configs.sbo_tar_suffix def package(self, packages): http = urllib3.PoolManager() @@ -45,8 +46,9 @@ class ViewPackage: print(f'Name: {GREEN}{info[0]}{ENDC}\n' f'Version: {GREEN}{info[1]}{ENDC}\n' f'Requires: {GREEN}{info[2]}{ENDC}\n' - f'Download: {BLUE}{info[3]}{ENDC}\n' - f'Download_x86_64: {BLUE}{info[4]}{ENDC}\n' + f'Download SlackBuild: {BLUE}{self.sbo_repo_url}/{info[9]}/{info[0]}{self.sbo_tar_suffix}{ENDC}\n' + f'Download sources: {BLUE}{info[3]}{ENDC}\n' + f'Download_x86_64 sources: {BLUE}{info[4]}{ENDC}\n' f'Md5sum: {YELLOW}{info[5]}{ENDC}\n' f'Md5sum_x86_64: {YELLOW}{info[6]}{ENDC}\n' f'Files: {GREEN}{info[7]}{ENDC}\n' diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 5cf78c30..0c6091c6 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -23,7 +23,7 @@ def usage(status: int): f' {CYAN}upgrade{ENDC} Upgrade all the packages.', f' {CYAN}build{ENDC} Build only the packages.', f' {CYAN}install{ENDC} Build and install the packages.', - f' {CYAN}download{ENDC} Download only the packages.', + f' {CYAN}download{ENDC} Download only the scripts and sources.', f' {CYAN}remove{ENDC} Remove installed packages.', f' {CYAN}find{ENDC} Find installed packages.', f' {CYAN}view{ENDC} View packages from the repository.', @@ -34,7 +34,7 @@ def usage(status: int): f' {YELLOW}--yes{ENDC} Answer Yes to all questions.', f' {YELLOW}--jobs{ENDC} Set it for multicore systems.', f' {YELLOW}--resolve-off{ENDC} Turns off dependency resolving.', - f' {YELLOW}--reinstall{ENDC} Use this option if you want to upgrade.', + f' {YELLOW}--reinstall{ENDC} Upgrade packages of the same version.', f' {YELLOW}--skip-installed{ENDC} Skip installed packages.\n', ' -h, --help Show this message and exit.', ' -v, --version Print version and exit.\n',