mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated checks
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
abdc4bbf83
commit
a46313ea61
1 changed files with 3 additions and 6 deletions
|
@ -23,18 +23,15 @@ class CheckUpdates:
|
||||||
|
|
||||||
if os.path.isfile(local_chg_txt):
|
if os.path.isfile(local_chg_txt):
|
||||||
with open(local_chg_txt, 'r', encoding='utf-8') as f:
|
with open(local_chg_txt, 'r', encoding='utf-8') as f:
|
||||||
ldate = f.readline().strip()
|
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}')
|
||||||
|
|
||||||
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)
|
if parser.parse(repo_date) > parser.parse(local_date):
|
||||||
local_date = parser.parse(ldate)
|
|
||||||
|
|
||||||
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')
|
||||||
|
|
Loading…
Add table
Reference in a new issue