Project chroot

Projects Chroots allows to enable and disable target chroots and modify project settings dedicated for specific chroots.

Access to the project chroots is done through project_chroots(). property of initialized CoprClient. That property is an instance of ProjectChrootHandle.

However it’s usually more convenient to access project chroots from an instance of Project using methods get_project_chroot_list() or get_project_chroot().

Chroot are represented by ProjectChroot class.

Project chroot entity attributes

Field Type Can edit? Description
name string no chroot name
buildroot_pkgs list of strings yes packages to be installed into the buildroot
comps string yes content of the comps.xml
comps_name string yes name of the uploaded comps file
comps_len int no size of the uploaded comps file (bytes)

Note

all following examples assume that we use cl as an instance of client_v2.client.CoprClient and p as an instance of Project

Get project chroots list

>>> pc_list = cl.project_chroots.get_list(project=p)
# or more simple
>>> pc_list = p.get_project_chroot_list()
>>>  map(str, pc_list)
['<Project chroot: fedora-21-x86_64, additional packages: [], comps size if any: 0>',
 '<Project chroot: epel-7-x86_64, additional packages: [], comps size if any: 0>']

Get one project chroot

>>> pc = cl.project_chroots.get_one(project=p, name="fedora-23-x86_64")
# or
>>> pc = p.get_project_chroot("fedora-23-x86_64")
>>> print(pc)
<Project chroot: fedora-23-x86_64, additional packages: [], comps size if any: 0>

Modify project chroot

>>> pc.buildroot_pkgs = ["scl-utils",]
>>> pc.update()

Disable project chroot

>>> pc.disable()