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

  • root_bind
    Instance of RootBind
  • root_dir
    root directory path name
  • shared_location
    shared directory between image root and build system root
add_repo(name, uri, repo_type, prio, dist, components, user, secret, credentials_file)[source]

Add repository

Implementation in specialized repository class

Parameters:
  • name (string) – unused
  • uri (string) – unused
  • repo_type – unused
  • prio (int) – unused
  • dist – unused
  • components – unused
  • user – unused
  • secret – unused
  • credentials_file – 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_all_repos()[source]

Delete all repositories

Implementation in specialized repository class

delete_repo(name)[source]

Delete repository

Implementation in specialized repository class

Parameters:name (string) – unused
delete_repo_cache(name)[source]

Delete repository cache

Implementation in specialized repository class

Parameters:name (string) – unused
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

use_default_location()[source]

Call repository operations with default repository manager setup

Implementation in specialized repository class

kiwi.repository.yum Module

class kiwi.repository.yum.RepositoryYum(root_bind, custom_args=None)[source]

Bases: kiwi.repository.base.RepositoryBase

Implements repository handling for yum package manager

add_repo(name, uri, repo_type=’rpm-md’, prio=None, dist=None, components=None, user=None, secret=None, credentials_file=None)[source]

Add yum repository

Parameters:
  • name (string) – repository base file name
  • uri (string) – repository URI
  • repo_type – repostory type name
  • prio (int) – yum repostory priority
  • dist – unused
  • components – unused
  • user – unused
  • secret – unused
  • credentials_file – unused
cleanup_unused_repos()[source]

Delete unused yum repositories

Repository configurations which are not used for this build must be removed otherwise they are taken into account for the package installations

delete_all_repos()[source]

Delete all yum repositories

delete_repo(name)[source]

Delete yum repository

Parameters:name (string) – repository base file name
delete_repo_cache(name)[source]

Delete yum repository cache

The cache data for each repository is stored in a directory of the same name as the repository name. The method deletes this directory to cleanup the cache information

Parameters:name (string) – repository name
post_init(custom_args=None)[source]

Post initialization method

Store custom yum arguments and create runtime configuration and environment

Attributes

  • shared_yum_dir
    shared directory between image root and build system root
  • runtime_yum_config_file
    yum runtime config file name
  • command_env
    customized os.environ for yum
  • runtime_yum_config
    Instance of ConfigParser
Parameters:custom_args (list) – yum arguments
runtime_config()[source]

yum runtime configuration and environment

use_default_location()[source]

Setup yum repository operations to store all data in the default places

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

add_repo(name, uri, repo_type=’rpm-md’, prio=None, dist=None, components=None, user=None, secret=None, credentials_file=None)[source]

Add zypper repository

Parameters:
  • name (string) – repository name
  • uri (string) – repository URI
  • repo_type – repostory type name
  • prio (int) – zypper repostory priority
  • dist – unused
  • components – unused
  • user – credentials username
  • secret – credentials password
  • credentials_file – zypper credentials file
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_all_repos()[source]

Delete all zypper repositories

delete_repo(name)[source]

Delete zypper repository

Parameters:name (string) – repository name
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 (string) – repository name
post_init(custom_args=None)[source]

Post initialization method

Store custom zypper arguments and create runtime configuration and environment

Attributes

  • shared_zypper_dir
    shared directory between image root and build system root
  • runtime_zypper_config_file
    zypper runtime config file name
  • runtime_zypp_config_file
    libzypp runtime config file name
  • zypper_args
    zypper caller args plus additional custom args
  • command_env
    customized os.environ for zypper
  • runtime_zypper_config
    Instance of ConfigParser
Parameters:custom_args (list) – zypper arguments
runtime_config()[source]

zypper runtime configuration and environment

use_default_location()[source]

Setup zypper repository operations to store all data in the default places

Module Contents

class kiwi.repository.Repository[source]

Bases: object

Repository factory

Attributes

  • root_bind
    Instance of RootBind
  • package_manager
    package manager name
  • custom_args
    list of custom package manager arguments to setup the repository