kiwi.package_manager Package

Submodules

kiwi.package_manager.base Module

class kiwi.package_manager.base.PackageManagerBase(repository, custom_args=None)[source]

Bases: object

Implements base class for installation/deletion of packages and collections using a package manager

Parameters:
  • repository (object) – instance of Repository
  • root_dir (str) – root directory path name
  • root_bind (object) – instance of RootBind
  • package_requests (list) – list of packages to install or delete
  • collection_requests (list) – list of collections to install
  • product_requests (list) – list of products to install
cleanup_requests()[source]

Cleanup request queues

database_consistent()[source]

Check if package database is consistent

Implementation in specialized package manager class

dump_reload_package_database(version=45)[source]

For rpm based package managers, dump and reload the database to match the desired rpm db version

Implementation in specialized package manager class

Parameters:version (str) – unused
match_package_deleted(package_list, log_line)[source]

Match expression to indicate a package has been deleted

Implementation in specialized package manager class

Parameters:
  • package_list (list) – unused
  • log_line (str) – unused
match_package_installed(package_list, log_line)[source]

Match expression to indicate a package has been installed

Implementation in specialized package manager class

Parameters:
  • package_list (list) – unused
  • log_line (str) – unused
post_init(custom_args=None)[source]

Post initialization method

Implementation in specialized package manager class

Parameters:custom_args (list) – unused
process_delete_requests(force=False)[source]

Process package delete requests (chroot)

Implementation in specialized package manager class

Parameters:force (bool) – unused
process_install_requests()[source]

Process package install requests for image phase (chroot)

Implementation in specialized package manager class

process_install_requests_bootstrap()[source]

Process package install requests for bootstrap phase (no chroot)

Implementation in specialized package manager class

process_only_required()[source]

Setup package processing only for required packages

Implementation in specialized package manager class

Setup package processing to also include recommended dependencies

Implementation in specialized package manager class

request_collection(name)[source]

Queue a package collection

Implementation in specialized package manager class

Parameters:name (str) – unused
request_package(name)[source]

Queue a package request

Implementation in specialized package manager class

Parameters:name (str) – unused
request_package_exclusion(name)[source]

Queue a package exclusion(skip) request

Implementation in specialized package manager class

Parameters:name (str) – unused
request_package_lock(name)[source]

Queue a package exclusion(skip) request

Obsolete method, only kept for API compatbility Method calls: request_package_exclusion

request_product(name)[source]

Queue a product request

Implementation in specialized package manager class

Parameters:name (str) – unused
update()[source]

Process package update requests (chroot)

Implementation in specialized package manager class

kiwi.package_manager.yum Module

class kiwi.package_manager.yum.PackageManagerYum(repository, custom_args=None)[source]

Bases: kiwi.package_manager.base.PackageManagerBase

Implements base class for installation/deletion of packages and collections using yum

Parameters:
  • yum_args (list) – yum arguments from repository runtime configuration
  • command_env (dict) – yum command environment from repository runtime configuration
database_consistent()[source]

Check if rpm package database is consistent

Returns:True or False
Return type:bool
dump_reload_package_database(version=45)[source]

Dump and reload the rpm database to match the desired rpm db version

For the supported RHEL versions there is no dump/reload cycle required

Parameters:version (str) – unused
match_package_deleted(package_name, yum_output)[source]

Match expression to indicate a package has been deleted

Parameters:
  • package_list (list) – list of all packages
  • log_line (str) – yum status line
Returns:

match or None if there isn’t any match

Return type:

match object, None

match_package_installed(package_name, yum_output)[source]

Match expression to indicate a package has been installed

This match for the package to be installed in the output of the yum command is not 100% accurate. There might be false positives due to sub package names starting with the same base package name

Parameters:
  • package_list (list) – list of all packages
  • log_line (str) – yum status line
Returns:

match or None if there isn’t any match

Return type:

match object, None

post_init(custom_args=None)[source]

Post initialization method

Store custom yum arguments

Parameters:custom_args (list) – custom yum arguments
process_delete_requests(force=False)[source]

Process package delete requests (chroot)

Parameters:force (bool) – force deletion: true|false
Raises:KiwiRequestError – if none of the packages to delete is installed
Returns:process results in command type
Return type:namedtuple
process_install_requests()[source]

Process package install requests for image phase (chroot)

Returns:process results in command type
Return type:namedtuple
process_install_requests_bootstrap()[source]

Process package install requests for bootstrap phase (no chroot)

Returns:process results in command type
Return type:namedtuple
process_only_required()[source]

Setup package processing only for required packages

Setup package processing to also include recommended dependencies.

request_collection(name)[source]

Queue a collection request

Parameters:name (str) – yum group name
request_package(name)[source]

Queue a package request

Parameters:name (str) – package name
request_package_exclusion(name)[source]

Queue a package exclusion(skip) request

Parameters:name (str) – package name
request_product(name)[source]

Queue a product request

There is no product definition in the rhel repo data

Parameters:name (str) – unused
update()[source]

Process package update requests (chroot)

Returns:process results in command type
Return type:namedtuple

kiwi.package_manager.zypper Module

class kiwi.package_manager.zypper.PackageManagerZypper(repository, custom_args=None)[source]

Bases: kiwi.package_manager.base.PackageManagerBase

Implements base class for installation/deletion of packages and collections using zypper

Parameters:
  • zypper_args (list) – zypper arguments from repository runtime configuration
  • command_env (dict) – zypper command environment from repository runtime configuration
database_consistent()[source]

Check if rpm package database is consistent

Returns:True or False
Return type:bool
dump_reload_package_database(version=45)[source]

Dump and reload the rpm database to match the desired rpm db version Supported target rpm database db versions are

  • 45 (db45_load)
  • 48 (db48_load)
Parameters:version (str) – target rpm db version
match_package_deleted(package_name, zypper_output)[source]

Match expression to indicate a package has been deleted

Parameters:
  • package_list (list) – list of all packages
  • log_line (str) – zypper status line
Returns:

match or None if there isn’t any match

Return type:

match object, None

match_package_installed(package_name, zypper_output)[source]

Match expression to indicate a package has been installed

This match for the package to be installed in the output of the zypper command is not 100% accurate. There might be false positives due to sub package names starting with the same base package name

Parameters:
  • package_list (list) – list of all packages
  • log_line (str) – zypper status line
Returns:

match or None if there isn’t any match

Return type:

match object, None

post_init(custom_args=None)[source]

Post initialization method

Store custom zypper arguments

Parameters:custom_args (list) – custom zypper arguments
process_delete_requests(force=False)[source]

Process package delete requests (chroot)

Parameters:force (bool) – force deletion: true|false
Raises:KiwiRequestError – if none of the packages to delete is installed
Returns:process results in command type
Return type:namedtuple
process_install_requests()[source]

Process package install requests for image phase (chroot)

Returns:process results in command type
Return type:namedtuple
process_install_requests_bootstrap()[source]

Process package install requests for bootstrap phase (no chroot)

Returns:process results in command type
Return type:namedtuple
process_only_required()[source]

Setup package processing only for required packages

Setup package processing to also include recommended dependencies.

request_collection(name)[source]

Queue a collection request

Parameters:name (str) – zypper pattern name
request_package(name)[source]

Queue a package request

Parameters:name (str) – package name
request_package_exclusion(name)[source]

Queue a package exclusion(skip) request

Parameters:name (str) – package name
request_product(name)[source]

Queue a product request

Parameters:name (str) – zypper product name
update()[source]

Process package update requests (chroot)

Returns:process results in command type
Return type:namedtuple

Module Contents

class kiwi.package_manager.PackageManager[source]

Bases: object

Package manager factory

Parameters:
  • repository (object) – instance of Repository
  • package_manager (str) – package manager name
  • custom_args (list) – custom package manager arguments list
Raises:

KiwiPackageManagerSetupError – if the requested package manager type is not supported

Returns:

package manager

Return type:

PackageManagerBase subclass