mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated for arguments
This commit is contained in:
parent
f4d5c63b33
commit
d46721b43e
1 changed files with 60 additions and 61 deletions
|
@ -77,100 +77,99 @@ class CheckUpdates(Configs):
|
||||||
return self.compare
|
return self.compare
|
||||||
|
|
||||||
def slack_repository(self) -> None:
|
def slack_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slack_repo_path, self.repos.slack_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.slack_repo_path, self.repos.slack_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slack_repo_mirror[0]}{self.repos.slack_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.slack_repo_mirror[0]}{self.repos.slack_repo_changelog}'
|
||||||
self.compare[self.repos.slack_repo_name] = self.compare_dates()
|
self.compare[self.repos.slack_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def slack_extra_repository(self) -> None:
|
def slack_extra_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slack_extra_repo_path, self.repos.slack_extra_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.slack_extra_repo_path, self.repos.slack_extra_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slack_extra_repo_mirror[0]}{self.repos.slack_extra_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.slack_extra_repo_mirror[0]}{self.repos.slack_extra_repo_changelog}'
|
||||||
self.compare[self.repos.slack_extra_repo_name] = self.compare_dates()
|
self.compare[self.repos.slack_extra_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def slack_patches_repository(self) -> None:
|
def slack_patches_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slack_patches_repo_path, self.repos.slack_patches_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.slack_patches_repo_path, self.repos.slack_patches_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slack_patches_repo_mirror[0]}{self.repos.slack_patches_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.slack_patches_repo_mirror[0]}{self.repos.slack_patches_repo_changelog}'
|
||||||
self.compare[self.repos.slack_patches_repo_name] = self.compare_dates()
|
self.compare[self.repos.slack_patches_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def alien_repository(self) -> None:
|
def alien_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.alien_repo_path, self.repos.alien_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.alien_repo_path, self.repos.alien_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.alien_repo_mirror[0]}{self.repos.alien_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.alien_repo_mirror[0]}{self.repos.alien_repo_changelog}'
|
||||||
self.compare[self.repos.alien_repo_name] = self.compare_dates()
|
self.compare[self.repos.alien_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def multilib_repository(self) -> None:
|
def multilib_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.multilib_repo_path, self.repos.multilib_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.multilib_repo_path, self.repos.multilib_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.multilib_repo_mirror[0]}{self.repos.multilib_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.multilib_repo_mirror[0]}{self.repos.multilib_repo_changelog}'
|
||||||
self.compare[self.repos.multilib_repo_name] = self.compare_dates()
|
self.compare[self.repos.multilib_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def restricted_repository(self) -> None:
|
def restricted_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.restricted_repo_path, self.repos.restricted_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.restricted_repo_path, self.repos.restricted_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.restricted_repo_mirror[0]}{self.repos.restricted_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.restricted_repo_mirror[0]}{self.repos.restricted_repo_changelog}'
|
||||||
self.compare[self.repos.restricted_repo_name] = self.compare_dates()
|
self.compare[self.repos.restricted_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def gnome_repository(self) -> None:
|
def gnome_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.gnome_repo_path, self.repos.gnome_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.gnome_repo_path, self.repos.gnome_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.gnome_repo_mirror[0]}{self.repos.gnome_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.gnome_repo_mirror[0]}{self.repos.gnome_repo_changelog}'
|
||||||
self.compare[self.repos.gnome_repo_name] = self.compare_dates()
|
self.compare[self.repos.gnome_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def msb_repository(self) -> None:
|
def msb_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.msb_repo_path, self.repos.msb_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.msb_repo_path, self.repos.msb_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.msb_repo_mirror[0]}{self.repos.msb_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.msb_repo_mirror[0]}{self.repos.msb_repo_changelog}'
|
||||||
self.compare[self.repos.msb_repo_name] = self.compare_dates()
|
self.compare[self.repos.msb_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def csb_repository(self) -> None:
|
def csb_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.csb_repo_mirror[0]}{self.repos.csb_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.csb_repo_mirror[0]}{self.repos.csb_repo_changelog}'
|
||||||
self.compare[self.repos.csb_repo_name] = self.compare_dates()
|
self.compare[self.repos.csb_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def conraid_repository(self) -> None:
|
def conraid_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.conraid_repo_path, self.repos.conraid_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.conraid_repo_path, self.repos.conraid_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.conraid_repo_mirror[0]}{self.repos.conraid_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.conraid_repo_mirror[0]}{self.repos.conraid_repo_changelog}'
|
||||||
self.compare[self.repos.conraid_repo_name] = self.compare_dates()
|
self.compare[self.repos.conraid_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def slackonly_repository(self) -> None:
|
def slackonly_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slackonly_repo_path, self.repos.slackonly_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.slackonly_repo_path, self.repos.slackonly_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slackonly_repo_mirror[0]}{self.repos.slackonly_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.slackonly_repo_mirror[0]}{self.repos.slackonly_repo_changelog}'
|
||||||
self.compare[self.repos.slackonly_repo_name] = self.compare_dates()
|
self.compare[self.repos.slackonly_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def salixos_repository(self) -> None:
|
def salixos_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.salixos_repo_path, self.repos.salixos_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.salixos_repo_path, self.repos.salixos_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.salixos_repo_mirror[0]}{self.repos.salixos_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.salixos_repo_mirror[0]}{self.repos.salixos_repo_changelog}'
|
||||||
self.compare[self.repos.salixos_repo_name] = self.compare_dates()
|
self.compare[self.repos.salixos_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def salixos_extra_repository(self) -> None:
|
def salixos_extra_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.salixos_extra_repo_path, self.repos.salixos_extra_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.salixos_extra_repo_path, self.repos.salixos_extra_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.salixos_extra_repo_mirror[0]}{self.repos.salixos_extra_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.salixos_extra_repo_mirror[0]}{self.repos.salixos_extra_repo_changelog}'
|
||||||
self.compare[self.repos.salixos_extra_repo_name] = self.compare_dates()
|
self.compare[self.repos.salixos_extra_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def salixos_patches_repository(self) -> None:
|
def salixos_patches_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.salixos_patches_repo_path, self.repos.salixos_patches_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.salixos_patches_repo_path, self.repos.salixos_patches_repo_changelog)
|
||||||
self.repo_chg_txt: str = (f'{self.repos.salixos_patches_repo_mirror[0]}'
|
repo_chg_txt: str = f'{self.repos.salixos_patches_repo_mirror[0]}{self.repos.salixos_patches_repo_changelog}'
|
||||||
f'{self.repos.salixos_patches_repo_changelog}')
|
self.compare[self.repos.salixos_patches_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
self.compare[self.repos.salixos_patches_repo_name] = self.compare_dates()
|
|
||||||
|
|
||||||
def slackel_repository(self) -> None:
|
def slackel_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slackel_repo_path, self.repos.slackel_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.slackel_repo_path, self.repos.slackel_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slackel_repo_mirror[0]}{self.repos.slackel_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.slackel_repo_mirror[0]}{self.repos.slackel_repo_changelog}'
|
||||||
self.compare[self.repos.slackel_repo_name] = self.compare_dates()
|
self.compare[self.repos.slackel_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def slint_repository(self) -> None:
|
def slint_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slint_repo_path, self.repos.slint_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.slint_repo_path, self.repos.slint_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slint_repo_mirror[0]}{self.repos.slint_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.slint_repo_mirror[0]}{self.repos.slint_repo_changelog}'
|
||||||
self.compare[self.repos.slint_repo_name] = self.compare_dates()
|
self.compare[self.repos.slint_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def sbo_repository(self) -> None:
|
def sbo_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.sbo_repo_path, self.repos.sbo_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.sbo_repo_path, self.repos.sbo_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.sbo_repo_mirror[0]}{self.repos.sbo_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.sbo_repo_mirror[0]}{self.repos.sbo_repo_changelog}'
|
||||||
self.compare[self.repos.sbo_repo_name] = self.compare_dates()
|
self.compare[self.repos.sbo_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def ponce_repository(self) -> None:
|
def ponce_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.ponce_repo_path, self.repos.ponce_repo_changelog)
|
local_chg_txt: Path = Path(self.repos.ponce_repo_path, self.repos.ponce_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.ponce_repo_mirror[0]}{self.repos.ponce_repo_changelog}'
|
repo_chg_txt: str = f'{self.repos.ponce_repo_mirror[0]}{self.repos.ponce_repo_changelog}'
|
||||||
self.compare[self.repos.ponce_repo_name] = self.compare_dates()
|
self.compare[self.repos.ponce_repo_name] = self.compare_dates(local_chg_txt, repo_chg_txt)
|
||||||
|
|
||||||
def compare_dates(self) -> bool:
|
def compare_dates(self, local_chg_txt: Path, repo_chg_txt: str) -> bool:
|
||||||
local_size: int = 0
|
local_size: int = 0
|
||||||
|
|
||||||
if self.repo_chg_txt.startswith('file'):
|
if repo_chg_txt.startswith('file'):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -189,16 +188,16 @@ class CheckUpdates(Configs):
|
||||||
|
|
||||||
http = SOCKSProxyManager(f'{self.proxy_address}', headers=proxy_default_headers)
|
http = SOCKSProxyManager(f'{self.proxy_address}', headers=proxy_default_headers)
|
||||||
|
|
||||||
repo = http.request('GET', self.repo_chg_txt)
|
repo = http.request('GET', repo_chg_txt)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
if self.local_chg_txt.is_file():
|
if local_chg_txt.is_file():
|
||||||
local_size: int = int(os.stat(self.local_chg_txt).st_size)
|
local_size: int = int(os.stat(local_chg_txt).st_size)
|
||||||
|
|
||||||
repo_size: int = int(repo.headers['Content-Length'])
|
repo_size: int = int(repo.headers['Content-Length'])
|
||||||
|
|
||||||
return repo_size != local_size
|
return local_size != repo_size
|
||||||
|
|
||||||
def view_message(self) -> None:
|
def view_message(self) -> None:
|
||||||
self.check()
|
self.check()
|
||||||
|
|
Loading…
Add table
Reference in a new issue