Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2022-11-20 18:42:33 +02:00
commit f8420857c0
8 changed files with 31 additions and 9 deletions

View file

@ -1,3 +1,11 @@
4.2.9 - 19/11/2022
Bugfixed:
- slpkg upgrade fails when a package is blacklisted #149
Updated:
- Moved '%README%' to the blacklist
Added:
- Maintainer info in view command #150
4.2.8 - 06/11/2022
Updated:
- Check the SBo script exists before patching the tag

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.8.tar.gz
$ cd slpkg-4.2.8
$ tar xvf slpkg-4.2.9.tar.gz
$ cd slpkg-4.2.9
$ ./install.sh

View file

@ -1,4 +1,4 @@
blacklist:
# Add packages and separate them with commas.
packages: []
packages: ["%README%",]

View file

@ -1,6 +1,6 @@
[metadata]
name = slpkg
version = 4.2.8
version = 4.2.9
license_file = LICENSE
author = Dimitris Zlatanidis
author_email = d.zlatanidis@gmail.com

View file

@ -17,7 +17,7 @@ class Requires:
requires = SBoQueries(self.name).requires()
for req in requires:
if req and req != '%README%':
if req:
sub = SBoQueries(req).requires()
for s in sub:
requires.append(s)

View file

@ -7,6 +7,7 @@ from distutils.version import LooseVersion
from slpkg.configs import Configs
from slpkg.queries import SBoQueries
from slpkg.blacklist import Blacklist
@dataclass
@ -19,10 +20,11 @@ class Upgrade:
print("Do not forget to run 'slpkg update' before.")
repo_packages = SBoQueries('').names()
black = Blacklist().get()
for pkg in os.listdir(self.log_packages):
if pkg.endswith(self.sbo_repo_tag):
inst_pkg_name = '-'.join(pkg.split('-')[:-3])
inst_pkg_name = '-'.join(pkg.split('-')[:-3])
if pkg.endswith(self.sbo_repo_tag) and inst_pkg_name not in black:
if inst_pkg_name in repo_packages:
installed_ver = pkg.replace(f'{inst_pkg_name}-',

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, 8)
version_info: tuple = (4, 2, 9)
version: str = '{0}.{1}.{2}'.format(*version_info)
license: str = 'MIT License'
author: str = 'dslackw'

View file

@ -43,6 +43,16 @@ class ViewPackage:
readme = http.request(
'GET', f'{self.sbo_repo_url}/{info[9]}/{info[0]}/README')
info_file = http.request(
'GET', f'{self.sbo_repo_url}/{info[9]}/{info[0]}/{info[0]}.info')
maintainer, email = '', ''
for line in info_file.data.decode().splitlines():
if line.startswith('MAINTAINER'):
maintainer = line[12:-1].strip()
if line.startswith('EMAIL'):
email = line[7:-1].strip()
print(f'Name: {GREEN}{info[0]}{ENDC}\n'
f'Version: {GREEN}{info[1]}{ENDC}\n'
f'Requires: {GREEN}{info[2]}{ENDC}\n'
@ -54,4 +64,6 @@ class ViewPackage:
f'Files: {GREEN}{info[7]}{ENDC}\n'
f'Description: {GREEN}{info[8]}{ENDC}\n'
f'SBo url: {BLUE}{self.sbo_repo_url}/{info[9]}/{info[0]}{ENDC}\n'
f'README: {CYAN}{readme.data.decode()}{ENDC}')
f'Maintainer: {BLUE}{maintainer}{ENDC}\n'
f'Email: {BLUE}{email}{ENDC}\n'
f'\nREADME: {CYAN}{readme.data.decode()}{ENDC}')