OSTree.RepoCommitModifier

Fields

None

Methods

class

new (flags, commit_filter, *user_data)

ref ()

set_devino_cache (cache)

set_sepolicy (sepolicy)

set_sepolicy_from_commit (repo, rev, cancellable)

set_xattr_callback (callback, *user_data)

unref ()

Details

class OSTree.RepoCommitModifier

A structure allowing control over commits.

classmethod new(flags, commit_filter, *user_data)
Parameters:
Returns:

A new commit modifier.

Return type:

OSTree.RepoCommitModifier

ref()
Return type:

OSTree.RepoCommitModifier

set_devino_cache(cache)
Parameters:

cache (OSTree.RepoDevInoCache) – A hash table caching device,inode to checksums

See the documentation for ostree_repo_devino_cache_new(). This function can then be used for later calls to ostree_repo_write_directory_to_mtree() to optimize commits.

Note if your process has multiple writers, you should use separate OSTreeRepo instances if you want to also use this API.

This function will add a reference to cache without copying - you should avoid further mutation of the cache.

New in version 2017.13.

set_sepolicy(sepolicy)
Parameters:

sepolicy (OSTree.SePolicy or None) – Policy to use for labeling

If policy is non-None, use it to look up labels to use for “security.selinux” extended attributes.

Note that any policy specified this way operates in addition to any extended attributes provided via OSTree.RepoCommitModifier.set_xattr_callback(). However if both specify a value for “security.selinux”, then the one from the policy wins.

set_sepolicy_from_commit(repo, rev, cancellable)
Parameters:
Raises:

GLib.Error

Return type:

bool

In many cases, one wants to create a “derived” commit from base commit. SELinux policy labels are part of that base commit. This API allows one to easily set up SELinux labeling from a base commit.

New in version 2020.4.

set_xattr_callback(callback, *user_data)
Parameters:

If set, this function should return extended attributes to use for the given path. This is useful for things like ACLs and SELinux, where a build system can label the files as it’s committing to the repository.

unref()