Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2022-10-31 19:05:12 +02:00
commit 065bcfe64f
8 changed files with 36 additions and 13 deletions

View file

@ -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

View file

@ -30,8 +30,8 @@ Install from the official third-party `SBo repository <https://slackbuilds.org/r
.. code-block:: bash
$ tar xvf slpkg-4.2.3.tar.gz
$ cd slpkg-4.2.3
$ tar xvf slpkg-4.2.4.tar.gz
$ cd slpkg-4.2.4
$ ./install.sh
@ -52,7 +52,7 @@ Usage
upgrade Upgrade all the packages.
build <packages> Build only the packages.
install <packages> Build and install the packages.
download <packages> Download only the packages.
download <packages> Download only the scripts and sources.
remove <packages> Remove installed packages.
find <packages> Find installed packages.
view <packages> 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.

View file

@ -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

View file

@ -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

View file

@ -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(

View file

@ -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'

View file

@ -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'

View file

@ -23,7 +23,7 @@ def usage(status: int):
f' {CYAN}upgrade{ENDC} Upgrade all the packages.',
f' {CYAN}build{ENDC} <packages> Build only the packages.',
f' {CYAN}install{ENDC} <packages> Build and install the packages.',
f' {CYAN}download{ENDC} <packages> Download only the packages.',
f' {CYAN}download{ENDC} <packages> Download only the scripts and sources.',
f' {CYAN}remove{ENDC} <packages> Remove installed packages.',
f' {CYAN}find{ENDC} <packages> Find installed packages.',
f' {CYAN}view{ENDC} <packages> 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',