craft_parts.packages.deb module

Support for deb files.

class craft_parts.packages.deb.Ubuntu[source]

Bases: BaseRepository

Repository management for Ubuntu packages.

classmethod configure(cls, application_package_name)[source]

Set up apt options and directories.

Parameters:

application_package_name (str) –

Return type:

None

classmethod download_packages(package_names)[source]

Download the specified packages to the local package cache area.

Parameters:

package_names (List[str]) –

Return type:

None

classmethod fetch_stage_packages(*, cache_dir, package_names, stage_packages_path, base, arch, list_only=False, packages_filters=None)[source]

Fetch stage packages to stage_packages_path.

Parameters:
  • cache_dir (Path) –

  • package_names (List[str]) –

  • stage_packages_path (Path) –

  • base (str) –

  • arch (str) –

  • list_only (bool) –

  • packages_filters (Optional[Set[str]]) –

Return type:

List[str]

classmethod get_installed_packages(cls)[source]

Obtain a list of the installed packages and their versions.

Return type:

List[str]

classmethod get_package_libraries(package_name)[source]

Return a list of libraries in package_name.

Parameters:

package_name (str) –

Return type:

Set[str]

classmethod get_packages_for_source_type(cls, source_type)[source]

Return the packages required to work with source_type.

Parameters:

source_type (str) –

Return type:

Set[str]

classmethod install_packages(package_names, *, list_only=False, refresh_package_cache=True)[source]

Install packages on the host system.

Parameters:
  • package_names (List[str]) –

  • list_only (bool) –

  • refresh_package_cache (bool) –

Return type:

List[str]

classmethod is_package_installed(cls, package_name)[source]

Inform if a package is installed on the host system.

Parameters:

package_name (str) –

Return type:

bool

classmethod refresh_packages_list(cls)[source]

Refresh the list of packages available in the repository.

Return type:

None

classmethod unpack_stage_packages(*, stage_packages_path, install_path, stage_packages=None, track_stage_packages=False)[source]

Unpack stage packages to install_path.

Parameters:
  • stage_packages_path (Path) –

  • install_path (Path) –

  • stage_packages (Optional[List[str]]) –

  • track_stage_packages (bool) –

Return type:

None

craft_parts.packages.deb.get_cache_dirs(cache_dir)[source]

Return the paths to the stage and deb cache directories.

Parameters:

cache_dir (Path) –

Return type:

Tuple[Path, Path]

craft_parts.packages.deb.get_packages_in_base(*, base)[source]

Get the list of packages for the given base.

Parameters:

base (str) –

Return type:

List[DebPackage]

craft_parts.packages.deb.process_run(command, **kwargs)[source]

Run a command and log its output.

Parameters:
  • command (List[str]) –

  • kwargs (Any) –

Return type:

None