mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Refactor chglog
This commit is contained in:
parent
5609134b7f
commit
727b90fcea
3 changed files with 6 additions and 6 deletions
|
@ -19,11 +19,11 @@ class CheckUpdates:
|
||||||
print(end='\rChecking for news in the Changelog.txt file... ')
|
print(end='\rChecking for news in the Changelog.txt file... ')
|
||||||
local_date = 0
|
local_date = 0
|
||||||
local_chg_txt = (f'{self.configs.sbo_repo_path}/'
|
local_chg_txt = (f'{self.configs.sbo_repo_path}/'
|
||||||
f'{self.configs.chglog_txt}')
|
f'{self.configs.sbo_chglog_txt}')
|
||||||
|
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
repo = http.request(
|
repo = http.request(
|
||||||
'GET', f'{self.configs.sbo_repo_url}/{self.configs.chglog_txt}')
|
'GET', f'{self.configs.sbo_repo_url}/{self.configs.sbo_chglog_txt}')
|
||||||
|
|
||||||
if os.path.isfile(local_chg_txt):
|
if os.path.isfile(local_chg_txt):
|
||||||
local_date = int(os.stat(local_chg_txt).st_size)
|
local_date = int(os.stat(local_chg_txt).st_size)
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Configs:
|
||||||
# SBo repository configs
|
# SBo repository configs
|
||||||
sbo_repo_url: str = 'http://slackbuilds.org/slackbuilds/15.0'
|
sbo_repo_url: str = 'http://slackbuilds.org/slackbuilds/15.0'
|
||||||
sbo_txt: str = 'SLACKBUILDS.TXT'
|
sbo_txt: str = 'SLACKBUILDS.TXT'
|
||||||
chglog_txt: str = 'ChangeLog.txt'
|
sbo_chglog_txt: str = 'ChangeLog.txt'
|
||||||
sbo_tar_suffix: str = '.tar.gz'
|
sbo_tar_suffix: str = '.tar.gz'
|
||||||
sbo_repo_tag: str = '_SBo'
|
sbo_repo_tag: str = '_SBo'
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class Configs:
|
||||||
# SBo repository details
|
# SBo repository details
|
||||||
sbo_repo_url: str = config['sbo_repo_url']
|
sbo_repo_url: str = config['sbo_repo_url']
|
||||||
sbo_txt: str = config['sbo_txt']
|
sbo_txt: str = config['sbo_txt']
|
||||||
chglog_txt: str = config['chglog_txt']
|
sbo_chglog_txt: str = config['sbo_chglog_txt']
|
||||||
sbo_tar_suffix: str = config['sbo_tar_suffix']
|
sbo_tar_suffix: str = config['sbo_tar_suffix']
|
||||||
sbo_repo_tag: str = config['sbo_repo_tag']
|
sbo_repo_tag: str = config['sbo_repo_tag']
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,11 @@ class UpdateRepository:
|
||||||
|
|
||||||
print('Updating the package list...\n')
|
print('Updating the package list...\n')
|
||||||
self.delete_file(self.configs.sbo_repo_path, self.configs.sbo_txt)
|
self.delete_file(self.configs.sbo_repo_path, self.configs.sbo_txt)
|
||||||
self.delete_file(self.configs.sbo_repo_path, self.configs.chglog_txt)
|
self.delete_file(self.configs.sbo_repo_path, self.configs.sbo_chglog_txt)
|
||||||
self.delete_sbo_data()
|
self.delete_sbo_data()
|
||||||
|
|
||||||
slackbuilds_txt = f'{self.configs.sbo_repo_url}/{self.configs.sbo_txt}'
|
slackbuilds_txt = f'{self.configs.sbo_repo_url}/{self.configs.sbo_txt}'
|
||||||
changelog_txt = f'{self.configs.sbo_repo_url}/{self.configs.chglog_txt}'
|
changelog_txt = f'{self.configs.sbo_repo_url}/{self.configs.sbo_chglog_txt}'
|
||||||
|
|
||||||
wget = Wget()
|
wget = Wget()
|
||||||
wget.download(self.configs.sbo_repo_path, slackbuilds_txt)
|
wget.download(self.configs.sbo_repo_path, slackbuilds_txt)
|
||||||
|
|
Loading…
Reference in a new issue