[packages] Move pacman-options into their own key with subkeys

This commit is contained in:
Adriaan de Groot 2021-11-29 11:59:09 +01:00
parent 90459e434f
commit 8a1e5d35fa
3 changed files with 26 additions and 15 deletions

View File

@ -397,9 +397,15 @@ class PMPacman(PackageManager):
self.in_package_changes = False
self.line_cb = line_cb
self.pacman_num_retries = libcalamares.job.configuration.get("pacman_num_retries", 0)
self.pacman_disable_timeout = libcalamares.job.configuration.get("pacman_disable_download_timeout", False)
self.pacman_needed_only = libcalamares.job.configuration.get("pacman_needed_only", False)
pacman = libcalamares.job.configuration.get("pacman", None)
if pacman is None:
pacman = dict()
if type(pacman) is not dict:
libcalamares.utils.warning("Job configuration *pacman* will be ignored.")
pacman = dict()
self.pacman_num_retries = pacman.get("pacman_num_retries", 0)
self.pacman_disable_timeout = pacman.get("pacman_disable_download_timeout", False)
self.pacman_needed_only = pacman.get("pacman_needed_only", False)
def reset_progress(self):
self.in_package_changes = False

View File

@ -64,19 +64,20 @@ update_system: false
# pacman specific options
#
# pacman_num_retries should be a positive integer which sepcifies the
# *num_retries* should be a positive integer which specifies the
# number of times the call to pacman will be retried in the event of a
# failure. If it is missing, it will be set to 0
# failure. If it is missing, it will be set to 0.
#
# pacman_disable_download_timeout is a boolean that, when true, includes
# *disable_download_timeout* is a boolean that, when true, includes
# the flag --disable-download-timeout on calls to pacman. When missing,
# false is assumed
# false is assumed.
#
# pacman_needed_only is a boolean that includes the pacman argument --needed
# when set to true. If missing, false is assumed
pacman_num_retries: 0
pacman_disable_download_timeout: false
pacman_needed_only: false
# *needed_only* is a boolean that includes the pacman argument --needed
# when set to true. If missing, false is assumed.
pacman:
num_retries: 0
disable_download_timeout: false
needed_only: false
#
# List of maps with package operations such as install or remove.

View File

@ -26,9 +26,13 @@ properties:
update_system: { type: boolean, default: false }
skip_if_no_internet: { type: boolean, default: false }
pacman_num_retries: { type: integer, default: 0 }
pacman_disable_download_timeout: { type: boolean, default: false }
pacman_needed_only: { type: boolean, default: false }
pacman:
additionalProperties: false
type: object
properties:
num_retries: { type: integer, default: 0 }
disable_download_timeout: { type: boolean, default: false }
needed_only: { type: boolean, default: false }
operations:
type: array