Merge branch 'develop'

This commit is contained in:
Dimitris Zlatanidis 2022-11-06 20:21:42 +02:00
commit 74cc22116a
7 changed files with 16 additions and 14 deletions

View file

@ -1,3 +1,7 @@
4.2.7 - 05/11/2022
Fixed:
- Switch to check ChangeLogs.txt files by size
4.2.6 - 03/11/2022 4.2.6 - 03/11/2022
Fixed: Fixed:
- Check for the file ChangeLog.txt - Check for the file ChangeLog.txt

View file

@ -30,8 +30,8 @@ Install from the official third-party `SBo repository <https://slackbuilds.org/r
.. code-block:: bash .. code-block:: bash
$ tar xvf slpkg-4.2.6.tar.gz $ tar xvf slpkg-4.2.7.tar.gz
$ cd slpkg-4.2.6 $ cd slpkg-4.2.7
$ ./install.sh $ ./install.sh

View file

@ -1,3 +1,2 @@
SQLAlchemy>=1.4.36 SQLAlchemy>=1.4.36
PyYAML>=6.0 PyYAML>=6.0

View file

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

View file

@ -17,20 +17,19 @@ class CheckUpdates:
def updates(self): def updates(self):
local_date = '' local_date = 0
local_chg_txt = f'{self.sbo_repo_path}/{self.chglog_txt}' local_chg_txt = f'{self.sbo_repo_path}/{self.chglog_txt}'
if os.path.isfile(local_chg_txt):
with open(local_chg_txt, 'r', encoding='utf-8') as f:
local_date = f.readline().strip()
http = urllib3.PoolManager() http = urllib3.PoolManager()
repo = http.request( repo = http.request(
'GET', f'{self.sbo_repo_url}/{self.chglog_txt}') 'GET', f'{self.sbo_repo_url}/{self.chglog_txt}')
repo_date = repo.data.decode().split('\\')[0][:len(local_date)].strip() if os.path.isfile(local_chg_txt):
local_date = int(os.stat(local_chg_txt).st_size)
if repo_date > local_date: repo_date = int(repo.headers['Content-Length'])
if repo_date != local_date:
print('\nThere are new updates available.\n') print('\nThere are new updates available.\n')
else: else:
print('\nNo updated packages since the last check.\n') print('\nNo updated packages since the last check.\n')

View file

@ -25,8 +25,8 @@ class Upgrade:
inst_pkg_name = '-'.join(pkg.split('-')[:-3]) inst_pkg_name = '-'.join(pkg.split('-')[:-3])
if inst_pkg_name in repo_packages: if inst_pkg_name in repo_packages:
installed_ver = pkg.replace( installed_ver = pkg.replace(f'{inst_pkg_name}-',
inst_pkg_name + '-', '').split('-')[0] '').split('-')[0]
repo_ver = SBoQueries(inst_pkg_name).version() repo_ver = SBoQueries(inst_pkg_name).version()
if LooseVersion(repo_ver) > LooseVersion(installed_ver): if LooseVersion(repo_ver) > LooseVersion(installed_ver):

View file

@ -10,7 +10,7 @@ from slpkg.configs import Configs
@dataclass @dataclass
class Version: class Version:
prog_name: str = Configs.prog_name prog_name: str = Configs.prog_name
version_info: tuple = (4, 2, 6) version_info: tuple = (4, 2, 7)
version: str = '{0}.{1}.{2}'.format(*version_info) version: str = '{0}.{1}.{2}'.format(*version_info)
license: str = 'MIT License' license: str = 'MIT License'
author: str = 'dslackw' author: str = 'dslackw'