mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-06 08:46:21 +01:00
Updated for ponce
This commit is contained in:
parent
3b1d238dd4
commit
a215c18474
4 changed files with 13 additions and 12 deletions
|
@ -86,7 +86,7 @@
|
||||||
# include in the ponce repository. #
|
# include in the ponce repository. #
|
||||||
#########################################################################
|
#########################################################################
|
||||||
PONCE_REPO = false
|
PONCE_REPO = false
|
||||||
PONCE_REPO_URL = "https://cgit.ponce.cc/slackbuilds/plain"
|
PONCE_URL = "https://cgit.ponce.cc/slackbuilds/plain"
|
||||||
SLACK_CURRENT_MIRROR = "https://mirrors.slackware.com/slackware/slackware64-current"
|
SLACK_CURRENT_MIRROR = "https://mirrors.slackware.com/slackware/slackware64-current"
|
||||||
SLACK_CHGLOG_TXT = "ChangeLog.txt"
|
SLACK_CHGLOG_TXT = "ChangeLog.txt"
|
||||||
SLACK_CHGLOG_PATH = "/var/lib/slpkg/repository/slack_current"
|
SLACK_CHGLOG_PATH = "/var/lib/slpkg/repository/slack_current"
|
|
@ -56,7 +56,7 @@ class Configs:
|
||||||
|
|
||||||
# Ponce repo configs.
|
# Ponce repo configs.
|
||||||
ponce_repo: bool = False
|
ponce_repo: bool = False
|
||||||
ponce_repo_url: str = 'https://cgit.ponce.cc/slackbuilds/plain'
|
ponce_url: str = 'https://cgit.ponce.cc/slackbuilds/plain'
|
||||||
slack_current_mirror: str = 'https://mirrors.slackware.com/slackware/slackware64-current'
|
slack_current_mirror: str = 'https://mirrors.slackware.com/slackware/slackware64-current'
|
||||||
slack_chglog_txt: str = 'ChangeLog.txt'
|
slack_chglog_txt: str = 'ChangeLog.txt'
|
||||||
slack_chglog_path: str = Path('/var/lib/slpkg/repository/slack_current')
|
slack_chglog_path: str = Path('/var/lib/slpkg/repository/slack_current')
|
||||||
|
@ -116,7 +116,7 @@ class Configs:
|
||||||
|
|
||||||
# Ponce repo configs.
|
# Ponce repo configs.
|
||||||
ponce_repo: bool = config['PONCE_REPO']
|
ponce_repo: bool = config['PONCE_REPO']
|
||||||
ponce_repo_url: str = config['PONCE_REPO_URL']
|
ponce_url: str = config['PONCE_URL']
|
||||||
slack_current_mirror: str = config['SLACK_CURRENT_MIRROR']
|
slack_current_mirror: str = config['SLACK_CURRENT_MIRROR']
|
||||||
slack_chglog_txt: str = config['SLACK_CHGLOG_TXT']
|
slack_chglog_txt: str = config['SLACK_CHGLOG_TXT']
|
||||||
slack_chglog_path: str = config['SLACK_CHGLOG_PATH']
|
slack_chglog_path: str = config['SLACK_CHGLOG_PATH']
|
||||||
|
|
|
@ -12,6 +12,7 @@ from slpkg.dialog_box import DialogBox
|
||||||
class FormConfigs(Configs):
|
class FormConfigs(Configs):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
super(Configs).__init__()
|
||||||
self.orig_configs = None
|
self.orig_configs = None
|
||||||
self.load_configs = LoadConfigs()
|
self.load_configs = LoadConfigs()
|
||||||
self.dialogbox = DialogBox()
|
self.dialogbox = DialogBox()
|
||||||
|
@ -27,7 +28,7 @@ class FormConfigs(Configs):
|
||||||
configs = self.load_configs.file(self.etc_path, self.prog_name)
|
configs = self.load_configs.file(self.etc_path, self.prog_name)
|
||||||
|
|
||||||
# Creating the elements for the dialog form.
|
# Creating the elements for the dialog form.
|
||||||
for i, (key, value) in enumerate(configs['configs'].items(), start=1):
|
for i, (key, value) in enumerate(configs['CONFIGS'].items(), start=1):
|
||||||
if value is True:
|
if value is True:
|
||||||
value = 'true'
|
value = 'true'
|
||||||
elif value is False:
|
elif value is False:
|
||||||
|
@ -36,7 +37,7 @@ class FormConfigs(Configs):
|
||||||
(key, i, 1, value, i, 17, 47, 200, '0x0')
|
(key, i, 1, value, i, 17, 47, 200, '0x0')
|
||||||
]
|
]
|
||||||
|
|
||||||
height = 28
|
height = 35
|
||||||
width = 70
|
width = 70
|
||||||
text = f'Edit the configuration file: {config_file}'
|
text = f'Edit the configuration file: {config_file}'
|
||||||
title = ' Configuration File '
|
title = ' Configuration File '
|
||||||
|
@ -62,13 +63,13 @@ class FormConfigs(Configs):
|
||||||
|
|
||||||
def check_configs(self, configs: dict, tags: list) -> bool:
|
def check_configs(self, configs: dict, tags: list) -> bool:
|
||||||
""" Check for true of false values. """
|
""" Check for true of false values. """
|
||||||
for key, value in zip(configs['configs'].keys(), tags):
|
for key, value in zip(configs['CONFIGS'].keys(), tags):
|
||||||
|
|
||||||
if key in ['colors', 'dialog', 'silent_mode', 'ascii_characters'] and value not in ['true', 'false']:
|
if key in ['COLORS', 'DIALOG', 'SILENT_MODE', 'ASCII_CHARACTERS', 'PONCE_REPO'] and value not in ['true', 'false']:
|
||||||
self.dialogbox.msgbox(f"\nError value for {key}. It must be 'true' or 'false'\n", height=7, width=60)
|
self.dialogbox.msgbox(f"\nError value for {key}. It must be 'true' or 'false'\n", height=7, width=60)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if key in ['downloader'] and value not in ['wget', 'curl']:
|
if key in ['DOWNLOADER'] and value not in ['wget', 'curl']:
|
||||||
self.dialogbox.msgbox(f"\nError value for {key}. It must be 'wget' or 'curl'\n", height=7, width=60)
|
self.dialogbox.msgbox(f"\nError value for {key}. It must be 'wget' or 'curl'\n", height=7, width=60)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -84,9 +85,9 @@ class FormConfigs(Configs):
|
||||||
self.read_configs()
|
self.read_configs()
|
||||||
with open(self.config_file, 'w') as patch_toml:
|
with open(self.config_file, 'w') as patch_toml:
|
||||||
for line in self.orig_configs:
|
for line in self.orig_configs:
|
||||||
for key, value in zip(configs['configs'].keys(), tags):
|
for key, value in zip(configs['CONFIGS'].keys(), tags):
|
||||||
if line.lstrip().startswith(key):
|
if line.lstrip().startswith(key):
|
||||||
line = f' {key} = "{value}"\n'
|
line = f' {key} = "{value}"\n'
|
||||||
if line.lstrip().startswith(('colors =', 'dialog =', 'silent_mode =', 'ascii_characters =')):
|
if line.lstrip().startswith(('COLORS =', 'DIALOG =', 'SILENT_MODE =', 'ASCII_CHARACTERS =', 'PONCE_REPO =')):
|
||||||
line = line.replace('"', '')
|
line = line.replace('"', '')
|
||||||
patch_toml.write(line)
|
patch_toml.write(line)
|
||||||
|
|
|
@ -139,9 +139,9 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
location = SBoQueries(sbo).location()
|
location = SBoQueries(sbo).location()
|
||||||
sbo_url = f'{self.sbo_repo_url}/{location}/{file}'
|
sbo_url = f'{self.sbo_repo_url}/{location}/{file}'
|
||||||
ponce_url = f'{self.ponce_repo_url}/{location}/{sbo}'
|
ponce_url = f'{self.ponce_url}/{location}/{sbo}'
|
||||||
|
|
||||||
if self.ponce_repo and self.ponce_repo_url:
|
if self.ponce_repo and self.ponce_url:
|
||||||
path = Path(self.build_path, sbo)
|
path = Path(self.build_path, sbo)
|
||||||
lftp = Downloader(path, ponce_url, self.flags)
|
lftp = Downloader(path, ponce_url, self.flags)
|
||||||
lftp.download()
|
lftp.download()
|
||||||
|
|
Loading…
Add table
Reference in a new issue