kiwi.repository Package¶
Submodules¶
kiwi.repository.base
Module¶
-
class
kiwi.repository.base.
RepositoryBase
(root_bind, custom_args=None)[source]¶ Bases:
object
Implements base class for package manager repository handling
Attributes
- Parameters
-
add_repo
(name, uri, repo_type, prio, dist, components, user, secret, credentials_file, repo_gpgcheck, pkg_gpgcheck, sourcetype, use_for_bootstrap=False)[source]¶ Add repository
Implementation in specialized repository class
- Parameters
name (str) – unused
uri (str) – unused
repo_type – unused
prio (int) – unused
dist (str) – unused
components (str) – unused
user (str) – unused
secret (str) – unused
credentials_file (str) – unused
repo_gpgcheck (bool) – unused
pkg_gpgcheck (bool) – unused
sourcetype (str) – unused
use_for_bootstrap (bool) – unused
-
cleanup_unused_repos
()[source]¶ Cleanup/Delete unused repositories
Only configured repositories according to the image configuration are allowed to be active when building
Implementation in specialized repository class
-
delete_repo
(name)[source]¶ Delete repository
Implementation in specialized repository class
- Parameters
name (str) – unused
-
delete_repo_cache
(name)[source]¶ Delete repository cache
Implementation in specialized repository class
- Parameters
name (str) – unused
-
import_trusted_keys
(signing_keys)[source]¶ Imports trusted keys into the image
Implementation in specialized repository class
- Parameters
signing_keys (list) – list of the key files to import
-
post_init
(custom_args)[source]¶ Post initialization method
Implementation in specialized repository class
- Parameters
custom_args (list) – unused
-
runtime_config
()[source]¶ Repository runtime configuration and environment
Implementation in specialized repository class
kiwi.repository.dnf
Module¶
-
class
kiwi.repository.dnf.
RepositoryDnf
(root_bind, custom_args=None)[source]¶ Bases:
kiwi.repository.base.RepositoryBase
Implements repository handling for dnf package manager
- Parameters
-
add_repo
(name, uri, repo_type='rpm-md', prio=None, dist=None, components=None, user=None, secret=None, credentials_file=None, repo_gpgcheck=None, pkg_gpgcheck=None, sourcetype=None, use_for_bootstrap=False)[source]¶ Add dnf repository
- Parameters
name (str) – repository base file name
uri (str) – repository URI
repo_type – repostory type name
prio (int) – dnf repostory priority
dist (str) – unused
components (str) – unused
user (str) – unused
secret (str) – unused
credentials_file (str) – unused
repo_gpgcheck (bool) – enable repository signature validation
pkg_gpgcheck (bool) – enable package signature validation
sourcetype (str) – source type, one of ‘baseurl’, ‘metalink’ or ‘mirrorlist’
use_for_bootstrap (bool) – unused
-
cleanup_unused_repos
()[source]¶ Delete unused dnf repositories
Repository configurations which are not used for this build must be removed otherwise they are taken into account for the package installations
-
delete_repo_cache
(name)[source]¶ Delete dnf repository cache
The cache data for each repository is stored in a directory and additional files all starting with the repository name. The method glob deletes all files and directories matching the repository name followed by any characters to cleanup the cache information
- Parameters
name (str) – repository name
-
import_trusted_keys
(signing_keys)[source]¶ Imports trusted keys into the image
- Parameters
signing_keys (list) – list of the key files to import
-
post_init
(custom_args=None)[source]¶ Post initialization method
Store custom dnf arguments and create runtime configuration and environment
- Parameters
custom_args (list) – dnf arguments
-
runtime_config
()[source]¶ dnf runtime configuration and environment
- Returns
dnf_args:list, command_env:dict
- Return type
-
setup_package_database_configuration
()[source]¶ Setup rpm macros for bootstrapping and image building
Create the rpm image macro which persists during the build
Create the rpm bootstrap macro to make sure for bootstrapping the rpm database location matches the host rpm database setup. This macro only persists during the bootstrap phase. If the image was already bootstrapped a compat link is created instead.
kiwi.repository.zypper
Module¶
-
class
kiwi.repository.zypper.
RepositoryZypper
(root_bind, custom_args=None)[source]¶ Bases:
kiwi.repository.base.RepositoryBase
Implements repo handling for zypper package manager
- Parameters
shared_zypper_dir (str) – shared directory between image root and build system root
runtime_zypper_config_file (str) – zypper runtime config file name
runtime_zypp_config_file (str) – libzypp runtime config file name
zypper_args (list) – zypper caller args plus additional custom args
command_env (dict) – customized os.environ for zypper
runtime_zypper_config (object) – instance of
ConfigParser
-
add_repo
(name, uri, repo_type='rpm-md', prio=None, dist=None, components=None, user=None, secret=None, credentials_file=None, repo_gpgcheck=None, pkg_gpgcheck=None, sourcetype=None, use_for_bootstrap=False)[source]¶ Add zypper repository
- Parameters
name (str) – repository name
uri (str) – repository URI
repo_type – repostory type name
prio (int) – zypper repostory priority
dist (str) – unused
components (str) – unused
user (str) – credentials username
secret (str) – credentials password
credentials_file (str) – zypper credentials file
repo_gpgcheck (bool) – enable repository signature validation
pkg_gpgcheck (bool) – enable package signature validation
sourcetype (str) – unused
use_for_bootstrap (boot) – unused
-
cleanup_unused_repos
()[source]¶ Delete unused zypper repositories
zypper creates a system solvable which is unwanted for the purpose of building images. In addition zypper fails with an error message ‘Failed to cache rpm database’ if such a system solvable exists and a new root system is created
All other repository configurations which are not used for this build must be removed too, otherwise they are taken into account for the package installations
-
delete_repo_cache
(name)[source]¶ Delete zypper repository cache
The cache data for each repository is stored in a list of directories of the same name as the repository name. The method deletes these directories to cleanup the cache information
- Parameters
name (str) – repository name
-
import_trusted_keys
(signing_keys)[source]¶ Imports trusted keys into the image
- Parameters
signing_keys (list) – list of the key files to import
-
post_init
(custom_args=None)[source]¶ Post initialization method
Store custom zypper arguments and create runtime configuration and environment
- Parameters
custom_args (list) – zypper arguments
-
setup_package_database_configuration
()[source]¶ Setup rpm macros for bootstrapping and image building
Create the rpm image macro which persists during the build
Create the rpm bootstrap macro to make sure for bootstrapping the rpm database location matches the host rpm database setup. This macro only persists during the bootstrap phase. If the image was already bootstrapped a compat link is created instead.
Create zypper compat link
Module Contents¶
-
class
kiwi.repository.
Repository
[source]¶ Bases:
object
Repository factory
- Parameters
- Raises
KiwiRepositorySetupError – if package_manager is not supported