From f32344c610ebd0e98e38025d6d9cc54e7005b12a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 3 Nov 2022 19:42:19 +0200 Subject: [PATCH 1/3] Strip the repo date Signed-off-by: Dimitris Zlatanidis --- slpkg/check_updates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index a6004130..fef361a8 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -25,7 +25,8 @@ class CheckUpdates: repo = http.request( 'GET', f'{self.sbo_repo_url}/{self.chglog_txt}') - repo_date = repo.data.decode().split('\\')[0][:len(local_date)] + repo_date = repo.data.decode().split('\\')[0][:len(local_date)].strip() + if repo_date > local_date: print('\nThere are new updates available.\n') else: From dfb2376dc5ae016b9a10ef61e97845d09f3f3c54 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 3 Nov 2022 20:26:49 +0200 Subject: [PATCH 2/3] Check if the Changelog.txt file exists before Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 4 ++++ slpkg/check_updates.py | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index fe685aa5..ade4cc12 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +4.2.6 - 03/11/2022 +Fixed: +- If the file ChangeLog.txt exists before check + 4.2.5 - 01/11/2022 Added: - Command to check if there is news on ChangeLog.txt diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index fef361a8..1b267544 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- +import os import urllib3 from dataclasses import dataclass @@ -16,10 +17,12 @@ class CheckUpdates: def updates(self): + local_date = '' local_chg_txt = f'{self.sbo_repo_path}/{self.chglog_txt}' - with open(local_chg_txt, 'r', encoding='utf-8') as f: - local_date = f.readline().strip() + 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() repo = http.request( From 34a5de1c2499869e9316c423ec96aeab80ee3124 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 4 Nov 2022 18:42:55 +0200 Subject: [PATCH 3/3] Updated for version 4.2.6 Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 +- README.rst | 4 ++-- setup.cfg | 2 +- slpkg/version.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ade4cc12..456376db 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,6 @@ 4.2.6 - 03/11/2022 Fixed: -- If the file ChangeLog.txt exists before check +- Check for the file ChangeLog.txt 4.2.5 - 01/11/2022 Added: diff --git a/README.rst b/README.rst index a40a55e5..6aaca32a 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Install from the official third-party `SBo repository