diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index b87213f7..512c8bc8 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -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')