diff --git a/ChangeLog.txt b/ChangeLog.txt index 456376db..e1b5d529 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +4.2.7 - 05/11/2022 +Added: +- python3-dateutil dependency to fix check ChangeLogs dates + 4.2.6 - 03/11/2022 Fixed: - Check for the file ChangeLog.txt diff --git a/README.rst b/README.rst index 6aaca32a..6e16347e 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,7 @@ Requirements SQLAlchemy>=1.4.36 PyYAML>=6.0 + python-dateutil>=2.8.2 Install ------- diff --git a/requirements.txt b/requirements.txt index 5db7bd95..8bd19d54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ SQLAlchemy>=1.4.36 PyYAML>=6.0 - +python-dateutil>=2.8.2 diff --git a/setup.cfg b/setup.cfg index 166f87e1..3e4486c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,7 @@ python_requires = >=3.7 install_requires = SQLAlchemy >= 1.4.36 PyYAML >= 6.0 + python-dateutil >= 2.8.2 include_package_data = True [options.packages.find] diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index 1b267544..b87213f7 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -4,6 +4,7 @@ import os import urllib3 +from dateutil import parser from dataclasses import dataclass from slpkg.configs import Configs @@ -22,13 +23,16 @@ class CheckUpdates: if os.path.isfile(local_chg_txt): with open(local_chg_txt, 'r', encoding='utf-8') as f: - local_date = f.readline().strip() + ldate = f.readline().strip() http = urllib3.PoolManager() repo = http.request( 'GET', f'{self.sbo_repo_url}/{self.chglog_txt}') - repo_date = repo.data.decode().split('\\')[0][:len(local_date)].strip() + rdate = repo.data.decode().split('\\')[0][:len(ldate)].strip() + + repo_date = parser.parse(rdate) + local_date = parser.parse(ldate) if repo_date > local_date: print('\nThere are new updates available.\n')