From 7d44a85e7b9a3b96c4f0155ea5c9cc840acfb551 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 11 May 2024 23:29:34 +0300 Subject: [PATCH] Updated for slackpkg changelog Signed-off-by: Dimitris Zlatanidis --- configs/slpkg.toml | 3 +++ slpkg/configs.py | 15 +++++++++------ tests/test_configs.py | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/configs/slpkg.toml b/configs/slpkg.toml index 1d67aae3..4b95a424 100644 --- a/configs/slpkg.toml +++ b/configs/slpkg.toml @@ -52,6 +52,9 @@ ASK_QUESTION = true # Default is true. [true/false]. 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] # Alternatively, you can use the option '--parallel'. PARALLEL_DOWNLOADS = false diff --git a/slpkg/configs.py b/slpkg/configs.py index 0814356f..e15773d7 100644 --- a/slpkg/configs.py +++ b/slpkg/configs.py @@ -21,11 +21,9 @@ class Configs: # pylint: disable=[R0902] toml_errors = TomlErrors() prog_name: str = 'slpkg' - os_arch: str = platform.machine() tmp_path: Path = Path('/tmp') tmp_slpkg: Path = Path(tmp_path, prog_name) build_path: Path = Path(tmp_path, prog_name, 'build') - download_only_path: Path = Path(tmp_slpkg, '') etc_path: Path = Path('/etc', prog_name) lib_path: Path = Path('/var/lib', 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') upgrade_log_file: Path = Path(log_path, 'upgrade.log') + os_arch: str = platform.machine() file_list_suffix: str = '.pkgs' installpkg: str = 'upgradepkg --install-new' reinstall: str = 'upgradepkg --reinstall' removepkg: str = 'removepkg' + kernel_version: str = True + slackpkg_changelog: str = False colors: bool = True makeflags: str = '-j4' gpg_verification: bool = False @@ -50,6 +51,7 @@ class Configs: # pylint: disable=[R0902] curl_options: str = '' lftp_get_options: str = '-c get -e' lftp_mirror_options: str = '-c mirror --parallel=100 --only-newer --delete' + download_only_path: Path = Path(tmp_slpkg, '') ascii_characters: bool = True ask_question: bool = True parallel_downloads: bool = False @@ -79,12 +81,12 @@ class Configs: # pylint: disable=[R0902] config = {k.lower(): v for k, v in configs['configs'].items()} os_arch: str = config['os_arch'] - download_only_path: Path = Path(config['download_only_path']) - ask_question: bool = config['ask_question'] - kernel_version: str = config['kernel_version'] + file_list_suffix: str = config['file_list_suffix'] installpkg: str = config['installpkg'] reinstall: str = config['reinstall'] removepkg: str = config['removepkg'] + kernel_version: str = config['kernel_version'] + slackpkg_changelog: str = config['slackpkg_changelog'] colors: bool = config['colors'] makeflags: str = config['makeflags'] gpg_verification: bool = config['gpg_verification'] @@ -96,8 +98,9 @@ class Configs: # pylint: disable=[R0902] curl_options: str = config['curl_options'] lftp_get_options: str = config['lftp_get_options'] lftp_mirror_options: str = config['lftp_mirror_options'] + download_only_path: Path = Path(config['download_only_path']) 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'] maximum_parallel: int = config['maximum_parallel'] progress_bar_conf: bool = config['progress_bar'] diff --git a/tests/test_configs.py b/tests/test_configs.py index d602368a..f45f73d8 100644 --- a/tests/test_configs.py +++ b/tests/test_configs.py @@ -46,6 +46,7 @@ class TestConfigs(unittest.TestCase): self.assertEqual(True, self.configs.ascii_characters) self.assertEqual(True, self.configs.ask_question) self.assertEqual(True, self.configs.kernel_version) + self.assertEqual(False, self.configs.slackpkg_changelog) self.assertEqual(False, self.configs.parallel_downloads) self.assertEqual(5, self.configs.maximum_parallel) self.assertEqual(True, self.configs.progress_bar_conf)