mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Updated compare changelogs
This commit is contained in:
parent
d19cc04882
commit
3f52013234
1 changed files with 7 additions and 7 deletions
|
@ -94,6 +94,7 @@ class CheckUpdates(Configs):
|
|||
|
||||
def compare_the_changelogs(self, local_chg_txt: Path, repo_chg_txt: str) -> bool:
|
||||
local_size: int = 0
|
||||
repo_size: int = 0
|
||||
|
||||
if self.proxy_address.startswith('http'):
|
||||
self.set_http_proxy_server()
|
||||
|
@ -101,20 +102,19 @@ class CheckUpdates(Configs):
|
|||
if self.proxy_address.startswith('socks'):
|
||||
self.set_socks_proxy_server()
|
||||
|
||||
if local_chg_txt.is_file():
|
||||
local_size: int = int(os.stat(local_chg_txt).st_size)
|
||||
|
||||
try:
|
||||
repo = self.http.request('GET', repo_chg_txt)
|
||||
repo_size: int = int(repo.headers.get('content-length', 0))
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit(1)
|
||||
except HTTPError:
|
||||
self.error_connect_message(repo_chg_txt)
|
||||
repo_size: int = 0
|
||||
else:
|
||||
repo_size: int = int(repo.headers.get('content-length', 0))
|
||||
if repo_size == 0:
|
||||
self.error_connect_message(repo_chg_txt)
|
||||
|
||||
if local_chg_txt.is_file():
|
||||
local_size: int = int(os.stat(local_chg_txt).st_size)
|
||||
if repo_size == 0:
|
||||
repo_size: int = local_size
|
||||
|
||||
logger = logging.getLogger(LoggingConfig.date_time)
|
||||
logger.info(f'{self.__class__.__name__}: '
|
||||
|
|
Loading…
Reference in a new issue