build

This is the osc build module to talk to the build script.

basic structures

osc.build.find_build_recipes(topdir: str, build_type: str | None = None) List[str]

Return all file names in topdir that match known build recipes.

Parameters:
  • topdir (str)

  • build_type (str | None)

Return type:

List[str]

class osc.build.Buildinfo(filename, apiurl, buildtype='spec', localpkgs=None, binarytype='rpm')

represent the contents of a buildinfo file

class osc.build.Pac(node, buildarch, pacsuffix, apiurl, localpkgs=None)

represent a package to be downloaded

We build a map that’s later used to fill our URL templates

osc.build.get_preinstall_image(apiurl, arch, cache_dir, img_info, offline=False)

Searches preinstall image according to build info and downloads it to cache (unless offline is set to True (default: False)). Returns preinstall image path, source and list of image binaries, which can be used to create rpmlist.

Note

preinstall image can be used only for new build roots!

osc.build.get_repo(path)

Walks up path looking for any repodata directories.

Parameters:

path – path to a directory

Returns:

path to repository directory containing repodata directory with repomd.xml file

Return type:

str

osc.build.get_prefer_pkgs(dirs, wanted_arch, type, cpio)

Gather all packages from directories specified via -p/–prefer-pkgs to make them available in the build environment.

We’re gathering all known package types, because they can be used for building both packages and containers and we don’t know what’s going to be used in the build recipe in the end.

osc.build.create_deps(pkgqs)

creates a list of dependencies which corresponds to build’s internal dependency file format