Updated for slackpkg changelog

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2024-05-11 23:29:34 +03:00
parent 6421b4b772
commit 7d44a85e7b
3 changed files with 13 additions and 6 deletions

View file

@ -52,6 +52,9 @@ ASK_QUESTION = true
# Default is true. [true/false]. # Default is true. [true/false].
KERNEL_VERSION = true KERNEL_VERSION = true
# Updates the slackpkg ChangeLog.txt after update the slack repository.
SLACKPKG_CHANGELOG = false
# Download sources in parallel. Default is false. [true/false] # Download sources in parallel. Default is false. [true/false]
# Alternatively, you can use the option '--parallel'. # Alternatively, you can use the option '--parallel'.
PARALLEL_DOWNLOADS = false PARALLEL_DOWNLOADS = false

View file

@ -21,11 +21,9 @@ class Configs: # pylint: disable=[R0902]
toml_errors = TomlErrors() toml_errors = TomlErrors()
prog_name: str = 'slpkg' prog_name: str = 'slpkg'
os_arch: str = platform.machine()
tmp_path: Path = Path('/tmp') tmp_path: Path = Path('/tmp')
tmp_slpkg: Path = Path(tmp_path, prog_name) tmp_slpkg: Path = Path(tmp_path, prog_name)
build_path: Path = Path(tmp_path, prog_name, 'build') build_path: Path = Path(tmp_path, prog_name, 'build')
download_only_path: Path = Path(tmp_slpkg, '')
etc_path: Path = Path('/etc', prog_name) etc_path: Path = Path('/etc', prog_name)
lib_path: Path = Path('/var/lib', prog_name) lib_path: Path = Path('/var/lib', prog_name)
log_path: Path = Path('/var/log/', prog_name) log_path: Path = Path('/var/log/', prog_name)
@ -35,10 +33,13 @@ class Configs: # pylint: disable=[R0902]
slpkg_log_file: Path = Path(log_path, 'slpkg.log') slpkg_log_file: Path = Path(log_path, 'slpkg.log')
upgrade_log_file: Path = Path(log_path, 'upgrade.log') upgrade_log_file: Path = Path(log_path, 'upgrade.log')
os_arch: str = platform.machine()
file_list_suffix: str = '.pkgs' file_list_suffix: str = '.pkgs'
installpkg: str = 'upgradepkg --install-new' installpkg: str = 'upgradepkg --install-new'
reinstall: str = 'upgradepkg --reinstall' reinstall: str = 'upgradepkg --reinstall'
removepkg: str = 'removepkg' removepkg: str = 'removepkg'
kernel_version: str = True
slackpkg_changelog: str = False
colors: bool = True colors: bool = True
makeflags: str = '-j4' makeflags: str = '-j4'
gpg_verification: bool = False gpg_verification: bool = False
@ -50,6 +51,7 @@ class Configs: # pylint: disable=[R0902]
curl_options: str = '' curl_options: str = ''
lftp_get_options: str = '-c get -e' lftp_get_options: str = '-c get -e'
lftp_mirror_options: str = '-c mirror --parallel=100 --only-newer --delete' lftp_mirror_options: str = '-c mirror --parallel=100 --only-newer --delete'
download_only_path: Path = Path(tmp_slpkg, '')
ascii_characters: bool = True ascii_characters: bool = True
ask_question: bool = True ask_question: bool = True
parallel_downloads: bool = False parallel_downloads: bool = False
@ -79,12 +81,12 @@ class Configs: # pylint: disable=[R0902]
config = {k.lower(): v for k, v in configs['configs'].items()} config = {k.lower(): v for k, v in configs['configs'].items()}
os_arch: str = config['os_arch'] os_arch: str = config['os_arch']
download_only_path: Path = Path(config['download_only_path']) file_list_suffix: str = config['file_list_suffix']
ask_question: bool = config['ask_question']
kernel_version: str = config['kernel_version']
installpkg: str = config['installpkg'] installpkg: str = config['installpkg']
reinstall: str = config['reinstall'] reinstall: str = config['reinstall']
removepkg: str = config['removepkg'] removepkg: str = config['removepkg']
kernel_version: str = config['kernel_version']
slackpkg_changelog: str = config['slackpkg_changelog']
colors: bool = config['colors'] colors: bool = config['colors']
makeflags: str = config['makeflags'] makeflags: str = config['makeflags']
gpg_verification: bool = config['gpg_verification'] gpg_verification: bool = config['gpg_verification']
@ -96,8 +98,9 @@ class Configs: # pylint: disable=[R0902]
curl_options: str = config['curl_options'] curl_options: str = config['curl_options']
lftp_get_options: str = config['lftp_get_options'] lftp_get_options: str = config['lftp_get_options']
lftp_mirror_options: str = config['lftp_mirror_options'] lftp_mirror_options: str = config['lftp_mirror_options']
download_only_path: Path = Path(config['download_only_path'])
ascii_characters: bool = config['ascii_characters'] ascii_characters: bool = config['ascii_characters']
file_list_suffix: str = config['file_list_suffix'] ask_question: bool = config['ask_question']
parallel_downloads: bool = config['parallel_downloads'] parallel_downloads: bool = config['parallel_downloads']
maximum_parallel: int = config['maximum_parallel'] maximum_parallel: int = config['maximum_parallel']
progress_bar_conf: bool = config['progress_bar'] progress_bar_conf: bool = config['progress_bar']

View file

@ -46,6 +46,7 @@ class TestConfigs(unittest.TestCase):
self.assertEqual(True, self.configs.ascii_characters) self.assertEqual(True, self.configs.ascii_characters)
self.assertEqual(True, self.configs.ask_question) self.assertEqual(True, self.configs.ask_question)
self.assertEqual(True, self.configs.kernel_version) self.assertEqual(True, self.configs.kernel_version)
self.assertEqual(False, self.configs.slackpkg_changelog)
self.assertEqual(False, self.configs.parallel_downloads) self.assertEqual(False, self.configs.parallel_downloads)
self.assertEqual(5, self.configs.maximum_parallel) self.assertEqual(5, self.configs.maximum_parallel)
self.assertEqual(True, self.configs.progress_bar_conf) self.assertEqual(True, self.configs.progress_bar_conf)