Update configs for sbo repository

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-10-19 21:10:07 +03:00
parent d830324f86
commit 9d3729efb3
6 changed files with 15 additions and 15 deletions

View file

@ -17,7 +17,7 @@ configs:
database: database.slpkg
# SBo repository configs
sbo_url: http://slackbuilds.org/slackbuilds/15.0
sbo_repo_url: http://slackbuilds.org/slackbuilds/15.0
sbo_txt: SLACKBUILDS.TXT
sbo_tar_suffix: .tar.gz
sbo_repo_tag: _SBo

View file

@ -33,7 +33,7 @@ class Configs:
database: str = f'database.{prog_name}'
# SBo repository configs
sbo_url: str = 'http://slackbuilds.org/slackbuilds/15.0'
sbo_repo_url: str = 'http://slackbuilds.org/slackbuilds/15.0'
sbo_txt: str = 'SLACKBUILDS.TXT'
sbo_tar_suffix: str = '.tar.gz'
sbo_repo_tag: str = '_SBo'
@ -81,10 +81,10 @@ class Configs:
database: str = config['database']
# SBo repository details
sbo_url: str = config['sbo_url']
sbo_repo_url: str = config['sbo_repo_url']
sbo_txt: str = config['sbo_txt']
sbo_tar_suffix: str = config['tar_suffix']
sbo_repo_tag: str = config['repo_tag']
sbo_tar_suffix: str = config['sbo_tar_suffix']
sbo_repo_tag: str = config['sbo_repo_tag']
# Slackware commands
installpkg: str = config['installpkg']

View file

@ -16,7 +16,7 @@ class Download:
flags: list
session: str = Session
download_only = Configs.download_only
sbo_url: str = Configs.sbo_url
sbo_repo_url: str = Configs.sbo_repo_url
sbo_tar_suffix: str = Configs.sbo_tar_suffix
def packages(self, slackbuilds: list):
@ -29,7 +29,7 @@ class Download:
for sbo in slackbuilds:
file = f'{sbo}{self.sbo_tar_suffix}'
location = SBoQueries(sbo).location()
url = f'{self.sbo_url}/{location}/{file}'
url = f'{self.sbo_repo_url}/{location}/{file}'
wget.download(self.download_only, url)

View file

@ -14,7 +14,7 @@ from slpkg.models.models import session as Session
class Search:
session: str = Session
colors: dict = Configs.colour
sbo_url: str = Configs.sbo_url
sbo_repo_url: str = Configs.sbo_repo_url
def package(self, packages):
http = urllib3.PoolManager()
@ -39,7 +39,7 @@ class Search:
).filter(SBoTable.name == package).first()
readme = http.request(
'GET', f'{self.sbo_url}/{info[9]}/{info[0]}/README')
'GET', f'{self.sbo_repo_url}/{info[9]}/{info[0]}/README')
print(f'Name: {GREEN}{info[0]}{ENDC}\n'
f'Version: {GREEN}{info[1]}{ENDC}\n'
@ -50,5 +50,5 @@ class Search:
f'Md5sum_x86_64: {YELLOW}{info[6]}{ENDC}\n'
f'Files: {GREEN}{info[7]}{ENDC}\n'
f'Description: {GREEN}{info[8]}{ENDC}\n'
f'SBo url: {BLUE}{self.sbo_url}/{info[9]}/{info[0]}{ENDC}\n'
f'SBo url: {BLUE}{self.sbo_repo_url}/{info[9]}/{info[0]}{ENDC}\n'
f'README: {readme.data.decode()}')

View file

@ -28,7 +28,7 @@ class Slackbuilds:
session: str = Session
utils: str = Utilities()
build_path: str = Configs.build_path
sbo_url: str = Configs.sbo_url
sbo_repo_url: str = Configs.sbo_repo_url
build_path: str = Configs.build_path
tmp_slpkg: str = Configs.tmp_slpkg
tmp_path: str = Configs.tmp_path
@ -102,7 +102,7 @@ class Slackbuilds:
self.utils.remove_folder_if_exists(self.build_path, sbo)
location = SBoQueries(sbo).location()
url = f'{self.sbo_url}/{location}/{file}'
url = f'{self.sbo_repo_url}/{location}/{file}'
wget.download(self.tmp_slpkg, url)

View file

@ -18,7 +18,7 @@ from slpkg.models.models import session as Session
class UpdateRepository:
''' Deletes and install the data. '''
sbo_repo_path: str = Configs.sbo_repo_path
url: str = Configs.sbo_url
url: str = Configs.sbo_repo_url
sbo_txt: str = Configs.sbo_txt
db_path: str = Configs.db_path
database: str = Configs.database
@ -29,10 +29,10 @@ class UpdateRepository:
self.delete_file(self.sbo_repo_path, self.sbo_txt)
self.delete_sbo_data()
sbo_url = f'{self.url}/{self.sbo_txt}'
sbo_repo_url = f'{self.url}/{self.sbo_txt}'
wget = Wget()
wget.download(self.sbo_repo_path, sbo_url)
wget.download(self.sbo_repo_path, sbo_repo_url)
data = CreateData()
data.insert_sbo_table()