Updated checks

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-11-05 19:39:00 +02:00
parent abdc4bbf83
commit a46313ea61

View file

@ -23,18 +23,15 @@ class CheckUpdates:
if os.path.isfile(local_chg_txt):
with open(local_chg_txt, 'r', encoding='utf-8') as f:
ldate = f.readline().strip()
local_date = f.readline().strip()
http = urllib3.PoolManager()
repo = http.request(
'GET', f'{self.sbo_repo_url}/{self.chglog_txt}')
rdate = repo.data.decode().split('\\')[0][:len(ldate)].strip()
repo_date = repo.data.decode().split('\\')[0][:len(local_date)].strip()
repo_date = parser.parse(rdate)
local_date = parser.parse(ldate)
if repo_date > local_date:
if parser.parse(repo_date) > parser.parse(local_date):
print('\nThere are new updates available.\n')
else:
print('\nNo updated packages since the last check.\n')