mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +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):
|
||||
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')
|
||||
|
|
Loading…
Reference in a new issue