OSTree API references |
|---|
for OSTree 2016.11
| +Top + | +
+Content-addressed object store+Content-addressed object store — A git-like storage system for operating system binaries + |
++ |
| typedef | +OstreeRepo | +
| enum | +OstreeRepoMode | +
| enum | +OstreeRepoRemoteChange | +
| struct | +OstreeRepoTransactionStats | +
| enum | +OstreeRepoCommitFilterResult | +
| typedef | +OstreeRepoCommitModifier | +
| enum | +OstreeRepoCommitModifierFlags | +
| enum | +OstreeRepoCheckoutMode | +
| enum | +OstreeRepoCheckoutOverwriteMode | +
| enum | +OstreeRepoListObjectsFlags | +
| #define | +OSTREE_REPO_LIST_OBJECTS_VARIANT_TYPE | +
| enum | +OstreeStaticDeltaGenerateOpt | +
| enum | +OstreeRepoPruneFlags | +
| enum | +OstreeRepoPullFlags | +
The OstreeRepo is like git, a content-addressed object store. +Unlike git, it records uid, gid, and extended attributes.
+There are three possible "modes" for an OstreeRepo;
+OSTREE_REPO_MODE_BARE is very simple - content files are
+represented exactly as they are, and checkouts are just hardlinks.
+OSTREE_REPO_MODE_BARE_USER is similar, except the uid/gids are not
+set on the files, and checkouts as hardlinks hardlinks work only for user checkouts.
+A OSTREE_REPO_MODE_ARCHIVE_Z2 repository in contrast stores
+content files zlib-compressed. It is suitable for non-root-owned
+repositories that can be served via a static HTTP server.
Creating an OstreeRepo does not invoke any file I/O, and thus needs
+to be initialized, either from an existing contents or with a new
+repository. If you have an existing repo, use ostree_repo_open()
+to load it from disk and check its validity. To initialize a new
+repository in the given filepath, use ostree_repo_create() instead.
To store content in the repo, first start a transaction with
+ostree_repo_prepare_transaction(). Then create a
+OstreeMutableTree, and apply functions such as
+ostree_repo_write_directory_to_mtree() to traverse a physical
+filesystem and write content, possibly multiple times.
Once the OstreeMutableTree is complete, write all of its metadata
+with ostree_repo_write_mtree(), and finally create a commit with
+ostree_repo_write_commit().
gboolean +ostree_repo_mode_from_string (+const char *mode, +OstreeRepoMode *out_mode, +GError **error);
OstreeRepo * +ostree_repo_new_for_sysroot_path (+GFile *repo_path, +GFile *sysroot_path);
Creates a new OstreeRepo instance, taking the system root path explicitly +instead of assuming "/".
+ + +OstreeRepo *
+ostree_repo_new_default (void);
+If the current working directory appears to be an OSTree +repository, create a new OstreeRepo object for accessing it. +Otherwise use the path in the OSTREE_REPO environment variable +(if defined) or else the default system repository located at +/ostree/repo.
+ +gboolean +ostree_repo_open (+OstreeRepo *self, +GCancellable *cancellable, +GError **error);
void +ostree_repo_set_disable_fsync (+OstreeRepo *self, +gboolean disable_fsync);
Disable requests to fsync() to stable storage during commits. This
+option should only be used by build system tools which are creating
+disposable virtual machines, or have higher level mechanisms for
+ensuring data consistency.
self |
+An OstreeRepo |
+Â | +
disable_fsync |
+If |
+Â | +
gboolean
+ostree_repo_get_disable_fsync (OstreeRepo *self);
+For more information see ostree_repo_set_disable_fsync().
gboolean +ostree_repo_is_writable (+OstreeRepo *self, +GError **error);
Returns whether the repository is writable by the current user.
+If the repository is not writable, the error
+ indicates why.
gboolean +ostree_repo_create (+OstreeRepo *self, +OstreeRepoMode mode, +GCancellable *cancellable, +GError **error);
Create the underlying structure on disk for the repository, and call
+ostree_repo_open() on the result, preparing it for use.
Since version 2016.8, this function will succeed on an existing +repository, and finish creating any necessary files in a partially +created repository. However, this function cannot change the mode +of an existing repository, and will silently ignore an attempt to +do so.
+self |
+An OstreeRepo |
+Â | +
mode |
+The mode to store the repository in |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
int
+ostree_repo_get_dfd (OstreeRepo *self);
+In some cases it's useful for applications to access the repository
+directly; for example, writing content into repo/tmp ensures it's
+on the same filesystem. Another case is detecting the mtime on the
+repository (to see whether a ref was written).
gboolean +ostree_repo_remote_add (+OstreeRepo *self, +const char *name, +const char *url, +GVariant *options, +GCancellable *cancellable, +GError **error);
Create a new remote named name
+ pointing to url
+. If options
+ is
+provided, then it will be mapped to GKeyFile entries, where the
+GVariant dictionary key is an option string, and the value is
+mapped as follows:
s: g_key_file_set_string()
b: g_key_file_set_boolean()
as: g_key_file_set_string_list()
self |
+Repo |
+Â | +
name |
+Name of remote |
+Â | +
url |
+URL for remote (if URL begins with metalink=, it will be used as such) |
+Â | +
options |
+GVariant of type a{sv}. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_remote_delete (+OstreeRepo *self, +const char *name, +GCancellable *cancellable, +GError **error);
Delete the remote named name
+. It is an error if the provided
+remote does not exist.
gboolean +ostree_repo_remote_change (+OstreeRepo *self, +GFile *sysroot, +OstreeRepoRemoteChange changeop, +const char *name, +const char *url, +GVariant *options, +GCancellable *cancellable, +GError **error);
A combined function handling the equivalent of
+ostree_repo_remote_add(), ostree_repo_remote_delete(), with more
+options.
self |
+Repo |
+Â | +
sysroot |
+System root. |
+[allow-none] | +
changeop |
+Operation to perform |
+Â | +
name |
+Name of remote |
+Â | +
url |
+URL for remote (if URL begins with metalink=, it will be used as such) |
+Â | +
options |
+GVariant of type a{sv}. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
char ** +ostree_repo_remote_list (+OstreeRepo *self, +guint *out_n_remotes);
List available remote names in an OstreeRepo. Remote names are sorted
+alphabetically. If no remotes are available the function returns NULL.
self |
+Repo |
+Â | +
out_n_remotes |
+Number of remotes available. |
+[out][allow-none] | +
gboolean +ostree_repo_remote_get_url (+OstreeRepo *self, +const char *name, +char **out_url, +GError **error);
Return the URL of the remote named name
+ through out_url
+. It is an
+error if the provided remote does not exist.
self |
+Repo |
+Â | +
name |
+Name of remote |
+Â | +
out_url |
+Remote's URL. |
+[out][allow-none] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_remote_get_gpg_verify (+OstreeRepo *self, +const char *name, +gboolean *out_gpg_verify, +GError **error);
Return whether GPG verification is enabled for the remote named name
+
+through out_gpg_verify
+. It is an error if the provided remote does
+not exist.
self |
+Repo |
+Â | +
name |
+Name of remote |
+Â | +
out_gpg_verify |
+Remote's GPG option. |
+[out][allow-none] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_remote_get_gpg_verify_summary + (+OstreeRepo *self, +const char *name, +gboolean *out_gpg_verify_summary, +GError **error);
Return whether GPG verification of the summary is enabled for the remote
+named name
+ through out_gpg_verify_summary
+. It is an error if the provided
+remote does not exist.
self |
+Repo |
+Â | +
name |
+Name of remote |
+Â | +
out_gpg_verify_summary |
+Remote's GPG option. |
+[out][allow-none] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_remote_gpg_import (+OstreeRepo *self, +const char *name, +GInputStream *source_stream, +const char * const *key_ids, +guint *out_imported, +GCancellable *cancellable, +GError **error);
Imports one or more GPG keys from the open source_stream
+, or from the
+user's personal keyring if source_stream
+ is NULL. The key_ids
+ array
+can optionally restrict which keys are imported. If key_ids
+ is NULL,
+then all keys are imported.
The imported keys will be used to conduct GPG verification when pulling
+from the remote named name
+.
self |
+Self |
+Â | +
name |
+name of a remote |
+Â | +
source_stream |
+ a GInputStream, or |
+[allow-none] | +
key_ids |
+ a |
+[array zero-terminated=1][element-type utf8][allow-none] | +
out_imported |
+ return location for the number of imported
+keys, or |
+[allow-none] | +
cancellable |
+a GCancellable |
+Â | +
error |
+a GError |
+Â | +
gboolean +ostree_repo_remote_fetch_summary (+OstreeRepo *self, +const char *name, +GBytes **out_summary, +GBytes **out_signatures, +GCancellable *cancellable, +GError **error);
Tries to fetch the summary file and any GPG signatures on the summary file
+over HTTP, and returns the binary data in out_summary
+ and out_signatures
+
+respectively.
If no summary file exists on the remote server, out_summary
+ is set to
+NULL
+. Likewise if the summary file is not signed, out_signatures
+ is
+set to NULL
+. In either case the function still returns TRUE.
Parse the summary data into a GVariant using g_variant_new_from_bytes()
+with OSTREE_SUMMARY_GVARIANT_FORMAT as the format string.
gboolean +ostree_repo_remote_fetch_summary_with_options + (+OstreeRepo *self, +const char *name, +GVariant *options, +GBytes **out_summary, +GBytes **out_signatures, +GCancellable *cancellable, +GError **error);
Like ostree_repo_remote_fetch_summary(), but supports an extensible set of flags.
+The following are currently defined:
override-url (s): Fetch summary from this URL if remote specifies no metalink in options
self |
+Self |
+Â | +
name |
+name of a remote |
+Â | +
options |
+A GVariant a{sv} with an extensible set of flags. |
+[nullable] | +
out_summary |
+ return location for raw summary data, or |
+[nullable] | +
out_signatures |
+ return location for raw summary signature
+data, or |
+[nullable] | +
cancellable |
+a GCancellable |
+Â | +
error |
+a GError |
+Â | +
gboolean +ostree_repo_get_remote_boolean_option (+OstreeRepo *self, +const char *remote_name, +const char *option_name, +gboolean default_value, +gboolean *out_value, +GError **error);
OSTree remotes are represented by keyfile groups, formatted like:
+[remote "remotename"]. This function returns a value named option_name
+
+underneath that group, and returns it as a boolean.
+If the option is not set, out_value
+ will be set to default_value
+.
gboolean +ostree_repo_get_remote_list_option (+OstreeRepo *self, +const char *remote_name, +const char *option_name, +char ***out_value, +GError **error);
OSTree remotes are represented by keyfile groups, formatted like:
+[remote "remotename"]. This function returns a value named option_name
+
+underneath that group, and returns it as an zero terminated array of strings.
+If the option is not set, out_value
+ will be set to NULL.
gboolean +ostree_repo_get_remote_option (+OstreeRepo *self, +const char *remote_name, +const char *option_name, +const char *default_value, +char **out_value, +GError **error);
OSTree remotes are represented by keyfile groups, formatted like:
+[remote "remotename"]. This function returns a value named option_name
+
+underneath that group, or default_value
+ if the remote exists but not the
+option name.
self |
+A OstreeRepo |
+Â | +
remote_name |
+Name |
+Â | +
option_name |
+Option |
+Â | +
default_value |
+ Value returned if |
+[allow-none] | +
out_value |
+Return location for value. |
+[out] | +
error |
+Error |
+Â | +
OstreeRepo *
+ostree_repo_get_parent (OstreeRepo *self);
+Before this function can be used, ostree_repo_init() must have been
+called.
gboolean +ostree_repo_write_config (+OstreeRepo *self, +GKeyFile *new_config, +GError **error);
Save new_config
+ in place of this repository's config file. Note
+that new_config
+ should not be modified after - this function
+simply adds a reference.
gboolean +ostree_repo_scan_hardlinks (+OstreeRepo *self, +GCancellable *cancellable, +GError **error);
When ostree builds a mutable tree from directory like in
+ostree_repo_write_directory_to_mtree(), it has to scan all files that you
+pass in and compute their checksums. If your commit contains hardlinks from
+ostree's existing repo, ostree can build a mapping of device numbers and
+inodes to their checksum.
There is an upfront cost to creating this mapping, as this will scan the
+entire objects directory. If your commit is composed of mostly hardlinks to
+existing ostree objects, then this will speed up considerably, so call it
+before you call ostree_write_directory_to_mtree() or similar.
self |
+An OstreeRepo |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_prepare_transaction (+OstreeRepo *self, +gboolean *out_transaction_resume, +GCancellable *cancellable, +GError **error);
Starts or resumes a transaction. In order to write to a repo, you
+need to start a transaction. You can complete the transaction with
+ostree_repo_commit_transaction(), or abort the transaction with
+ostree_repo_abort_transaction().
Currently, transactions are not atomic, and aborting a transaction +will not erase any data you write during the transaction.
+self |
+An OstreeRepo |
+Â | +
out_transaction_resume |
+ Whether this transaction
+is resuming from a previous one. This is a legacy state, now OSTree
+pulls use per-commit |
+[allow-none][out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_commit_transaction (+OstreeRepo *self, +OstreeRepoTransactionStats *out_stats, +GCancellable *cancellable, +GError **error);
Complete the transaction. Any refs set with
+ostree_repo_transaction_set_ref() or
+ostree_repo_transaction_set_refspec() will be written out.
self |
+An OstreeRepo |
+Â | +
out_stats |
+A set of statistics of things +that happened during this transaction. |
+[allow-none][out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_abort_transaction (+OstreeRepo *self, +GCancellable *cancellable, +GError **error);
void +ostree_repo_transaction_set_refspec (+OstreeRepo *self, +const char *refspec, +const char *checksum);
Like ostree_repo_transaction_set_ref(), but takes concatenated
+refspec
+ format as input instead of separate remote and name
+arguments.
self |
+An OstreeRepo |
+Â | +
refspec |
+The refspec to write |
+Â | +
checksum |
+The checksum to point it to |
+Â | +
void +ostree_repo_transaction_set_ref (+OstreeRepo *self, +const char *remote, +const char *ref, +const char *checksum);
If checksum
+ is not NULL, then record it as the target of ref named
+ref
+; if remote
+ is provided, the ref will appear to originate from that
+remote.
Otherwise, if checksum
+ is NULL, then record that the ref should
+be deleted.
The change will not be written out immediately, but when the transaction
+is completed with ostree_repo_commit_transaction(). If the transaction
+is instead aborted with ostree_repo_abort_transaction(), no changes will
+be made to the repository.
self |
+An OstreeRepo |
+Â | +
remote |
+A remote for the ref. |
+[allow-none] | +
ref |
+The ref to write |
+Â | +
checksum |
+The checksum to point it to |
+Â | +
gboolean +ostree_repo_set_ref_immediate (+OstreeRepo *self, +const char *remote, +const char *ref, +const char *checksum, +GCancellable *cancellable, +GError **error);
This is like ostree_repo_transaction_set_ref(), except it may be
+invoked outside of a transaction. This is presently safe for the
+case where we're creating or overwriting an existing ref.
self |
+An OstreeRepo |
+Â | +
remote |
+A remote for the ref. |
+[allow-none] | +
ref |
+The ref to write |
+Â | +
checksum |
+ The checksum to point it to, or |
+[allow-none] | +
cancellable |
+GCancellable |
+Â | +
error |
+GError |
+Â | +
gboolean +ostree_repo_set_cache_dir (+OstreeRepo *self, +int dfd, +const char *path, +GCancellable *cancellable, +GError **error);
Set a custom location for the cache directory used for e.g. +per-remote summary caches. Setting this manually is useful when +doing operations on a system repo as a user because you don't have +write permissions in the repo, where the cache is normally stored.
+self |
+An OstreeRepo |
+Â | +
dfd |
+directory fd |
+Â | +
path |
+subpath in |
+Â | +
cancellable |
+a GCancellable |
+Â | +
error |
+a GError |
+Â | +
gboolean +ostree_repo_sign_delta (+OstreeRepo *self, +const gchar *from_commit, +const gchar *to_commit, +const gchar *key_id, +const gchar *homedir, +GCancellable *cancellable, +GError **error);
This function is deprecated, sign the summary file instead. +Add a GPG signature to a static delta.
+gboolean +ostree_repo_has_object (+OstreeRepo *self, +OstreeObjectType objtype, +const char *checksum, +gboolean *out_have_object, +GCancellable *cancellable, +GError **error);
Set out_have_object
+ to TRUE if self
+ contains the given object;
+FALSE otherwise.
self |
+Repo |
+Â | +
objtype |
+Object type |
+Â | +
checksum |
+ASCII SHA256 checksum |
+Â | +
out_have_object |
+ |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_metadata (+OstreeRepo *self, +OstreeObjectType objtype, +const char *expected_checksum, +GVariant *object, +guchar **out_csum, +GCancellable *cancellable, +GError **error);
Store the metadata object variant
+. Return the checksum
+as out_csum
+.
If expected_checksum
+ is not NULL, verify it against the
+computed checksum.
self |
+Repo |
+Â | +
objtype |
+Object type |
+Â | +
expected_checksum |
+If provided, validate content against this checksum. |
+[allow-none] | +
object |
+Metadata |
+Â | +
out_csum |
+Binary checksum. |
+[out][array fixed-size=32][allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
void +ostree_repo_write_metadata_async (+OstreeRepo *self, +OstreeObjectType objtype, +const char *expected_checksum, +GVariant *object, +GCancellable *cancellable, +GAsyncReadyCallback callback, +gpointer user_data);
Asynchronously store the metadata object variant
+. If provided,
+the checksum expected_checksum
+ will be verified.
self |
+Repo |
+Â | +
objtype |
+Object type |
+Â | +
expected_checksum |
+If provided, validate content against this checksum. |
+[allow-none] | +
object |
+Metadata |
+Â | +
cancellable |
+Cancellable |
+Â | +
callback |
+Invoked when metadata is writed |
+Â | +
user_data |
+Data for |
+Â | +
gboolean +ostree_repo_write_metadata_finish (+OstreeRepo *self, +GAsyncResult *result, +guchar **out_csum, +GError **error);
gboolean +ostree_repo_write_content (+OstreeRepo *self, +const char *expected_checksum, +GInputStream *object_input, +guint64 length, +guchar **out_csum, +GCancellable *cancellable, +GError **error);
Store the content object streamed as object_input
+,
+with total length length
+. The actual checksum will
+be returned as out_csum
+.
self |
+Repo |
+Â | +
expected_checksum |
+If provided, validate content against this checksum. |
+[allow-none] | +
object_input |
+Content object stream |
+Â | +
length |
+Length of |
+Â | +
out_csum |
+Binary checksum. |
+[out][array fixed-size=32][allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_metadata_trusted (+OstreeRepo *self, +OstreeObjectType objtype, +const char *checksum, +GVariant *variant, +GCancellable *cancellable, +GError **error);
Store the metadata object variant
+; the provided checksum
+ is
+trusted.
gboolean +ostree_repo_write_metadata_stream_trusted + (+OstreeRepo *self, +OstreeObjectType objtype, +const char *checksum, +GInputStream *object_input, +guint64 length, +GCancellable *cancellable, +GError **error);
Store the metadata object variant
+; the provided checksum
+ is
+trusted.
gboolean +ostree_repo_write_content_trusted (+OstreeRepo *self, +const char *checksum, +GInputStream *object_input, +guint64 length, +GCancellable *cancellable, +GError **error);
Store the content object streamed as object_input
+, with total
+length length
+. The given checksum
+ will be treated as trusted.
This function should be used when importing file objects from local +disk, for example.
+ +void +ostree_repo_write_content_async (+OstreeRepo *self, +const char *expected_checksum, +GInputStream *object, +guint64 length, +GCancellable *cancellable, +GAsyncReadyCallback callback, +gpointer user_data);
Asynchronously store the content object object
+. If provided, the
+checksum expected_checksum
+ will be verified.
self |
+Repo |
+Â | +
expected_checksum |
+If provided, validate content against this checksum. |
+[allow-none] | +
object |
+Input |
+Â | +
length |
+Length of |
+Â | +
cancellable |
+Cancellable |
+Â | +
callback |
+Invoked when content is writed |
+Â | +
user_data |
+User data for |
+Â | +
gboolean +ostree_repo_write_content_finish (+OstreeRepo *self, +GAsyncResult *result, +guchar **out_csum, +GError **error);
Completes an invocation of ostree_repo_write_content_async().
self |
++ | Â | +
result |
+a GAsyncResult |
+Â | +
out_csum |
+A binary SHA256 checksum of the content object. |
+[out][transfer full] | +
error |
+a GError |
+Â | +
gboolean +ostree_repo_resolve_rev (+OstreeRepo *self, +const char *refspec, +gboolean allow_noent, +char **out_rev, +GError **error);
Look up the given refspec, returning the checksum it references in
+the parameter out_rev
+. Will fall back on remote directory if cannot
+find the given refspec in local.
self |
+Repo |
+Â | +
refspec |
+A refspec |
+Â | +
allow_noent |
+Do not throw an error if refspec does not exist |
+Â | +
out_rev |
+ A checksum,or |
+[out][transfer full] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_resolve_rev_ext (+OstreeRepo *self, +const char *refspec, +gboolean allow_noent, +OstreeRepoResolveRevExtFlags flags, +char **out_rev, +GError **error);
Look up the given refspec, returning the checksum it references in
+the parameter out_rev
+. Differently from ostree_repo_resolve_rev(),
+this will not fall back to searching through remote repos if a
+local ref is specified but not found.
self |
+Repo |
+Â | +
refspec |
+A refspec |
+Â | +
allow_noent |
+Do not throw an error if refspec does not exist |
+Â | +
flags |
+Options controlling behavior |
+Â | +
out_rev |
+ A checksum,or |
+[out][transfer full] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_list_refs (+OstreeRepo *self, +const char *refspec_prefix, +GHashTable **out_all_refs, +GCancellable *cancellable, +GError **error);
If refspec_prefix
+ is NULL, list all local and remote refspecs,
+with their current values in out_all_refs
+. Otherwise, only list
+refspecs which have refspec_prefix
+ as a prefix.
self |
+Repo |
+Â | +
refspec_prefix |
+Only list refs which match this prefix. |
+[allow-none] | +
out_all_refs |
+Mapping from ref to checksum. |
+[out][element-type utf8 utf8] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_list_refs_ext (+OstreeRepo *self, +const char *refspec_prefix, +GHashTable **out_all_refs, +OstreeRepoListRefsExtFlags flags, +GCancellable *cancellable, +GError **error);
If refspec_prefix
+ is NULL, list all local and remote refspecs,
+with their current values in out_all_refs
+. Otherwise, only list
+refspecs which have refspec_prefix
+ as a prefix. Differently from
+ostree_repo_list_refs(), the prefix will not be removed from the ref
+name.
self |
+Repo |
+Â | +
refspec_prefix |
+Only list refs which match this prefix. |
+[allow-none] | +
out_all_refs |
+Mapping from ref to checksum. |
+[out][element-type utf8 utf8] | +
flags |
+Options controlling listing behavior |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_remote_list_refs (+OstreeRepo *self, +const char *remote_name, +GHashTable **out_all_refs, +GCancellable *cancellable, +GError **error);
self |
+Repo |
+Â | +
remote_name |
+Name of the remote. |
+Â | +
out_all_refs |
+Mapping from ref to checksum. |
+[out][element-type utf8 utf8] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_load_variant (+OstreeRepo *self, +OstreeObjectType objtype, +const char *sha256, +GVariant **out_variant, +GError **error);
Load the metadata object sha256
+ of type objtype
+, storing the
+result in out_variant
+.
self |
+Repo |
+Â | +
objtype |
+Expected object type |
+Â | +
sha256 |
+Checksum string |
+Â | +
out_variant |
+Metadata object. |
+[out][transfer full] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_load_commit (+OstreeRepo *self, +const char *checksum, +GVariant **out_commit, +OstreeRepoCommitState *out_state, +GError **error);
A version of ostree_repo_load_variant() specialized to commits,
+capable of returning extended state information. Currently
+the only extended state is OSTREE_REPO_COMMIT_STATE_PARTIAL, which
+means that only a sub-path of the commit is available.
self |
+Repo |
+Â | +
checksum |
+Commit checksum |
+Â | +
out_commit |
+Commit. |
+[out][allow-none] | +
out_state |
+Commit state. |
+[out][allow-none] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_load_variant_if_exists (+OstreeRepo *self, +OstreeObjectType objtype, +const char *sha256, +GVariant **out_variant, +GError **error);
Attempt to load the metadata object sha256
+ of type objtype
+ if it
+exists, storing the result in out_variant
+. If it doesn't exist,
+NULL is returned.
self |
+Repo |
+Â | +
objtype |
+Object type |
+Â | +
sha256 |
+ASCII checksum |
+Â | +
out_variant |
+Metadata. |
+[out][transfer full] | +
error |
+Error |
+Â | +
gboolean +ostree_repo_load_file (+OstreeRepo *self, +const char *checksum, +GInputStream **out_input, +GFileInfo **out_file_info, +GVariant **out_xattrs, +GCancellable *cancellable, +GError **error);
Load content object, decomposing it into three parts: the actual +content (for regular files), the metadata, and extended attributes.
+self |
+Repo |
+Â | +
checksum |
+ASCII SHA256 checksum |
+Â | +
out_input |
+File content. |
+[out][allow-none] | +
out_file_info |
+File information. |
+[out][allow-none] | +
out_xattrs |
+Extended attributes. |
+[out][allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_load_object_stream (+OstreeRepo *self, +OstreeObjectType objtype, +const char *checksum, +GInputStream **out_input, +guint64 *out_size, +GCancellable *cancellable, +GError **error);
Load object as a stream; useful when copying objects between +repositories.
+ +gboolean +ostree_repo_query_object_storage_size (+OstreeRepo *self, +OstreeObjectType objtype, +const char *sha256, +guint64 *out_size, +GCancellable *cancellable, +GError **error);
Return the size in bytes of object with checksum sha256
+, after any
+compression has been applied.
self |
+Repo |
+Â | +
objtype |
+Object type |
+Â | +
sha256 |
+Checksum |
+Â | +
out_size |
+Size in bytes object occupies physically. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_import_object_from (+OstreeRepo *self, +OstreeRepo *source, +OstreeObjectType objtype, +const char *checksum, +GCancellable *cancellable, +GError **error);
Copy object named by objtype
+ and checksum
+ into self
+ from the
+source repository source
+. If both repositories are of the same
+type and on the same filesystem, this will simply be a fast Unix
+hard link operation.
Otherwise, a copy will be performed.
+ +gboolean +ostree_repo_import_object_from_with_trust + (+OstreeRepo *self, +OstreeRepo *source, +OstreeObjectType objtype, +const char *checksum, +gboolean trusted, +GCancellable *cancellable, +GError **error);
Copy object named by objtype
+ and checksum
+ into self
+ from the
+source repository source
+. If both repositories are of the same
+type and on the same filesystem, this will simply be a fast Unix
+hard link operation.
Otherwise, a copy will be performed.
+ +gboolean +ostree_repo_import_archive_to_mtree (+OstreeRepo *self, +OstreeRepoImportArchiveOptions *opts, +void *archive, +OstreeMutableTree *mtree, +OstreeRepoCommitModifier *modifier, +GCancellable *cancellable, +GError **error);
Import an archive file archive
+ into the repository, and write its
+file structure to mtree
+.
[skip]
+self |
+An OstreeRepo |
+Â | +
opts |
+Options structure, ensure this is zeroed, then set specific variables |
+Â | +
archive |
+Really this is "struct archive*" |
+Â | +
mtree |
+The OstreeMutableTree to write to |
+Â | +
modifier |
+Optional commit modifier. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_export_tree_to_archive (+OstreeRepo *self, +OstreeRepoExportArchiveOptions *opts, +OstreeRepoFile *root, +void *archive, +GCancellable *cancellable, +GError **error);
Import an archive file archive
+ into the repository, and write its
+file structure to mtree
+.
[skip]
+self |
+An OstreeRepo |
+Â | +
opts |
+Options controlling conversion |
+Â | +
root |
+An OstreeRepoFile for the base directory |
+Â | +
archive |
+A |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_delete_object (+OstreeRepo *self, +OstreeObjectType objtype, +const char *sha256, +GCancellable *cancellable, +GError **error);
Remove the object of type objtype
+ with checksum sha256
+
+from the repository. An error of type G_IO_ERROR_NOT_FOUND
+is thrown if the object does not exist.
OstreeRepoCommitFilterResult +(*OstreeRepoCommitFilter) (+ + +OstreeRepo *repo, +const char *path, +GFileInfo *file_info, +gpointer user_data);
OstreeRepoCommitModifier * +ostree_repo_commit_modifier_new (+OstreeRepoCommitModifierFlags flags, +OstreeRepoCommitFilter commit_filter, +gpointer user_data, +GDestroyNotify destroy_notify);
flags |
+Control options for filter |
+Â | +
commit_filter |
+Function that can inspect individual files. |
+[allow-none] | +
user_data |
+User data. |
+[allow-none] | +
destroy_notify |
+A GDestroyNotify |
+Â | +
GVariant * +(*OstreeRepoCommitModifierXattrCallback) + (+OstreeRepo *repo, +const char *path, +GFileInfo *file_info, +gpointer user_data);
void +ostree_repo_commit_modifier_set_xattr_callback + (+OstreeRepoCommitModifier *modifier, +OstreeRepoCommitModifierXattrCallback callback, +GDestroyNotify destroy, +gpointer user_data);
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.
+ +void +ostree_repo_commit_modifier_set_sepolicy + (+OstreeRepoCommitModifier *modifier, +OstreeSePolicy *sepolicy);
If policy
+ is non-NULL, 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_repo_commit_modifier_set_xattr_callback(). However if both
+specify a value for "security.selinux", then the one from the
+policy wins.
modifier |
++ | Â | +
sepolicy |
+Policy to use for labeling. |
+[allow-none] | +
void +ostree_repo_commit_modifier_set_devino_cache + (+OstreeRepoCommitModifier *modifier, +OstreeRepoDevInoCache *cache);
See the documentation for
+. This function can
+then be used for later calls to
+ostree_repo_devino_cache_new() to optimize commits.ostree_repo_write_directory_to_mtree()
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.
OstreeRepoCommitModifier *
+ostree_repo_commit_modifier_ref (OstreeRepoCommitModifier *modifier);
+void
+ostree_repo_commit_modifier_unref (OstreeRepoCommitModifier *modifier);
+OstreeRepoDevInoCache *
+ostree_repo_devino_cache_new (void);
+OSTree has support for pairing ostree_repo_checkout_tree_at() using
+hardlinks in combination with a later
+ostree_repo_write_directory_to_mtree() using a (normally modified)
+directory. In order for OSTree to optimally detect just the new
+files, use this function and fill in the devino_to_csum_cache
+member of OstreeRepoCheckoutAtOptions, then call
+ostree_repo_commit_set_devino_cache().
OstreeRepoDevInoCache *
+ostree_repo_devino_cache_ref (OstreeRepoDevInoCache *cache);
+void
+ostree_repo_devino_cache_unref (OstreeRepoDevInoCache *cache);
+gboolean +ostree_repo_write_directory_to_mtree (+OstreeRepo *self, +GFile *dir, +OstreeMutableTree *mtree, +OstreeRepoCommitModifier *modifier, +GCancellable *cancellable, +GError **error);
Store objects for dir
+ and all children into the repository self
+,
+overlaying the resulting filesystem hierarchy into mtree
+.
self |
+Repo |
+Â | +
dir |
+Path to a directory |
+Â | +
mtree |
+Overlay directory contents into this tree |
+Â | +
modifier |
+Optional modifier. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_dfd_to_mtree (+OstreeRepo *self, +int dfd, +const char *path, +OstreeMutableTree *mtree, +OstreeRepoCommitModifier *modifier, +GCancellable *cancellable, +GError **error);
Store as objects all contents of the directory referred to by dfd
+
+and path
+ all children into the repository self
+, overlaying the
+resulting filesystem hierarchy into mtree
+.
self |
+Repo |
+Â | +
dfd |
+Directory file descriptor |
+Â | +
path |
+Path |
+Â | +
mtree |
+Overlay directory contents into this tree |
+Â | +
modifier |
+Optional modifier. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_archive_to_mtree (+OstreeRepo *self, +GFile *archive, +OstreeMutableTree *mtree, +OstreeRepoCommitModifier *modifier, +gboolean autocreate_parents, +GCancellable *cancellable, +GError **error);
Import an archive file archive
+ into the repository, and write its
+file structure to mtree
+.
self |
+An OstreeRepo |
+Â | +
archive |
+A path to an archive file |
+Â | +
mtree |
+The OstreeMutableTree to write to |
+Â | +
modifier |
+Optional commit modifier. |
+[allow-none] | +
autocreate_parents |
+Autocreate parent directories |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_mtree (+OstreeRepo *self, +OstreeMutableTree *mtree, +GFile **out_file, +GCancellable *cancellable, +GError **error);
Write all metadata objects for mtree
+ to repo; the resulting
+out_file
+ points to the OSTREE_OBJECT_TYPE_DIR_TREE object that
+the mtree
+ represented.
self |
+Repo |
+Â | +
mtree |
+Mutable tree |
+Â | +
out_file |
+ An OstreeRepoFile representing |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_commit (+OstreeRepo *self, +const char *parent, +const char *subject, +const char *body, +GVariant *metadata, +OstreeRepoFile *root, +char **out_commit, +GCancellable *cancellable, +GError **error);
Write a commit metadata object, referencing root_contents_checksum
+
+and root_metadata_checksum
+.
self |
+Repo |
+Â | +
parent |
+ ASCII SHA256 checksum for parent, or |
+[allow-none] | +
subject |
+Subject. |
+[allow-none] | +
body |
+Body. |
+[allow-none] | +
metadata |
+ GVariant of type a{sv}, or |
+[allow-none] | +
root |
+The tree to point the commit to |
+Â | +
out_commit |
+Resulting ASCII SHA256 checksum for commit. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_commit_with_time (+OstreeRepo *self, +const char *parent, +const char *subject, +const char *body, +GVariant *metadata, +OstreeRepoFile *root, +guint64 time, +char **out_commit, +GCancellable *cancellable, +GError **error);
Write a commit metadata object, referencing root_contents_checksum
+
+and root_metadata_checksum
+.
self |
+Repo |
+Â | +
parent |
+ ASCII SHA256 checksum for parent, or |
+[allow-none] | +
subject |
+Subject. |
+[allow-none] | +
body |
+Body. |
+[allow-none] | +
metadata |
+ GVariant of type a{sv}, or |
+[allow-none] | +
root |
+The tree to point the commit to |
+Â | +
time |
+The time to use to stamp the commit |
+Â | +
out_commit |
+Resulting ASCII SHA256 checksum for commit. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_read_commit_detached_metadata + (+OstreeRepo *self, +const char *checksum, +GVariant **out_metadata, +GCancellable *cancellable, +GError **error);
OSTree commits can have arbitrary metadata associated; this
+function retrieves them. If none exists, out_metadata
+ will be set
+to NULL.
self |
+Repo |
+Â | +
checksum |
+ASCII SHA256 commit checksum |
+Â | +
out_metadata |
+ Metadata associated with commit in with format "a{sv}", or |
+[out][transfer full] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_write_commit_detached_metadata + (+OstreeRepo *self, +const char *checksum, +GVariant *metadata, +GCancellable *cancellable, +GError **error);
Replace any existing metadata associated with commit referred to by
+checksum
+ with metadata
+. If metadata
+ is NULL, then existing
+data will be deleted.
self |
+Repo |
+Â | +
checksum |
+ASCII SHA256 commit checksum |
+Â | +
metadata |
+ Metadata to associate with commit in with format "a{sv}", or |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_checkout_tree (+OstreeRepo *self, +OstreeRepoCheckoutMode mode, +OstreeRepoCheckoutOverwriteMode overwrite_mode, +GFile *destination, +OstreeRepoFile *source, +GFileInfo *source_info, +GCancellable *cancellable, +GError **error);
Check out source
+ into destination
+, which must live on the
+physical filesystem. source
+ may be any subdirectory of a given
+commit. The mode
+ and overwrite_mode
+ allow control over how the
+files are checked out.
self |
+Repo |
+Â | +
mode |
+Options controlling all files |
+Â | +
overwrite_mode |
+Whether or not to overwrite files |
+Â | +
destination |
+Place tree here |
+Â | +
source |
+Source tree |
+Â | +
source_info |
+Source info |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_checkout_tree_at (+OstreeRepo *self, +OstreeRepoCheckoutOptions *options, +int destination_dfd, +const char *destination_path, +const char *commit, +GCancellable *cancellable, +GError **error);
ostree_repo_checkout_tree_at is deprecated and should not be used in newly-written code.
Similar to ostree_repo_checkout_tree(), but uses directory-relative
+paths for the destination, uses a new OstreeRepoCheckoutAtOptions,
+and takes a commit checksum and optional subpath pair, rather than
+requiring use of GFile APIs for the caller.
Note in addition that unlike ostree_repo_checkout_tree(), the
+default is not to use the repository-internal uncompressed objects
+cache.
This function is deprecated. Use ostree_repo_checkout_at() instead.
[skip]
+self |
+Repo |
+Â | +
options |
+Options. |
+[allow-none] | +
destination_dfd |
+Directory FD for destination |
+Â | +
destination_path |
+Directory for destination |
+Â | +
commit |
+Checksum for commit |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_checkout_at (+OstreeRepo *self, +OstreeRepoCheckoutAtOptions *options, +int destination_dfd, +const char *destination_path, +const char *commit, +GCancellable *cancellable, +GError **error);
Similar to ostree_repo_checkout_tree(), but uses directory-relative
+paths for the destination, uses a new OstreeRepoCheckoutAtOptions,
+and takes a commit checksum and optional subpath pair, rather than
+requiring use of GFile APIs for the caller.
It also replaces ostree_repo_checkout_at() which was not safe to
+use with GObject introspection.
Note in addition that unlike ostree_repo_checkout_tree(), the
+default is not to use the repository-internal uncompressed objects
+cache.
self |
+Repo |
+Â | +
options |
+Options. |
+[allow-none] | +
destination_dfd |
+Directory FD for destination |
+Â | +
destination_path |
+Directory for destination |
+Â | +
commit |
+Checksum for commit |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_checkout_gc (+OstreeRepo *self, +GCancellable *cancellable, +GError **error);
Call this after finishing a succession of checkout operations; it +will delete any currently-unused uncompressed objects from the +cache.
+ +gboolean +ostree_repo_read_commit (+OstreeRepo *self, +const char *ref, +GFile **out_root, +char **out_commit, +GCancellable *cancellable, +GError **error);
Load the content for rev
+ into out_root
+.
self |
+Repo |
+Â | +
ref |
+Ref or ASCII checksum |
+Â | +
out_root |
+An OstreeRepoFile corresponding to the root. |
+[out] | +
out_commit |
+The resolved commit checksum. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_list_objects (+OstreeRepo *self, +OstreeRepoListObjectsFlags flags, +GHashTable **out_objects, +GCancellable *cancellable, +GError **error);
This function synchronously enumerates all objects in the
+repository, returning data in out_objects
+. out_objects
+
+maps from keys returned by ostree_object_name_serialize()
+to GVariant values of type OSTREE_REPO_LIST_OBJECTS_VARIANT_TYPE.
self |
+Repo |
+Â | +
flags |
+Flags controlling enumeration |
+Â | +
out_objects |
+Map of serialized object name to variant data. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_list_commit_objects_starting_with + (+OstreeRepo *self, +const char *start, +GHashTable **out_commits, +GCancellable *cancellable, +GError **error);
This function synchronously enumerates all commit objects starting
+with start
+, returning data in out_commits
+.
gboolean +ostree_repo_list_static_delta_names (+OstreeRepo *self, +GPtrArray **out_deltas, +GCancellable *cancellable, +GError **error);
This function synchronously enumerates all static deltas in the
+repository, returning its result in out_deltas
+.
self |
+Repo |
+Â | +
out_deltas |
+String name of deltas (checksum-checksum.delta). |
+[out][element-type utf8][transfer container] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_static_delta_generate (+OstreeRepo *self, +OstreeStaticDeltaGenerateOpt opt, +const char *from, +const char *to, +GVariant *metadata, +GVariant *params, +GCancellable *cancellable, +GError **error);
Generate a lookaside "static delta" from from
+ (NULL means
+from-empty) which can generate the objects in to
+. This delta is
+an optimization over fetching individual objects, and can be
+conveniently stored and applied offline.
The params
+ argument should be an a{sv}. The following attributes
+are known:
min-fallback-size: u: Minimum uncompressed size in megabytes to use fallback, 0 to disable fallbacks
max-chunk-size: u: Maximum size in megabytes of a delta part
max-bsdiff-size: u: Maximum size in megabytes to consider bsdiff compression +for input files
compression: y: Compression type: 0=none, x=lzma, g=gzip
bsdiff-enabled: b: Enable bsdiff compression. Default TRUE.
inline-parts: b: Put part data in header, to get a single file delta. Default FALSE.
verbose: b: Print diagnostic messages. Default FALSE.
endianness: b: Deltas use host byte order by default; this option allows choosing (G_BIG_ENDIAN or G_LITTLE_ENDIAN)
filename: ay: Save delta superblock to this filename, and parts in the same directory. Default saves to repository.
self |
+Repo |
+Â | +
opt |
+High level optimization choice |
+Â | +
from |
+ASCII SHA256 checksum of origin, or |
+Â | +
to |
+ASCII SHA256 checksum of target |
+Â | +
metadata |
+Optional metadata. |
+[allow-none] | +
params |
+Parameters, see below. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_static_delta_execute_offline + (+OstreeRepo *self, +GFile *dir_or_file, +gboolean skip_validation, +GCancellable *cancellable, +GError **error);
Given a directory representing an already-downloaded static delta +on disk, apply it, generating a new commit. The directory must be +named with the form "FROM-TO", where both are checksums, and it +must contain a file named "superblock", along with at least one part.
+ +GHashTable *
+ostree_repo_traverse_new_reachable (void);
+This hash table is a set of GVariant which can be accessed via
+ostree_object_name_deserialize().
gboolean +ostree_repo_traverse_commit (+OstreeRepo *repo, +const char *commit_checksum, +int maxdepth, +GHashTable **out_reachable, +GCancellable *cancellable, +GError **error);
Create a new set out_reachable
+ containing all objects reachable
+from commit_checksum
+, traversing maxdepth
+ parent commits.
repo |
+Repo |
+Â | +
commit_checksum |
+ASCII SHA256 checksum |
+Â | +
maxdepth |
+Traverse this many parent commits, -1 for unlimited |
+Â | +
out_reachable |
+Set of reachable objects. |
+[out][transfer container][element-type GVariant GVariant] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_traverse_commit_union (+OstreeRepo *repo, +const char *commit_checksum, +int maxdepth, +GHashTable *inout_reachable, +GCancellable *cancellable, +GError **error);
Update the set inout_reachable
+ containing all objects reachable
+from commit_checksum
+, traversing maxdepth
+ parent commits.
[skip]
+ +void
+ostree_repo_commit_traverse_iter_cleanup
+ (void *p);
+void
+ostree_repo_commit_traverse_iter_clear
+ (OstreeRepoCommitTraverseIter *iter);
+void +ostree_repo_commit_traverse_iter_get_dir + (+OstreeRepoCommitTraverseIter *iter, +char **out_name, +char **out_content_checksum, +char **out_meta_checksum);
Return information on the current directory. This function may
+only be called if OSTREE_REPO_COMMIT_ITER_RESULT_DIR was returned
+from ostree_repo_commit_traverse_iter_next().
iter |
+An iter |
+Â | +
out_name |
+Name of current dir. |
+[out][transfer none] | +
out_content_checksum |
+Checksum of current content. |
+[out][transfer none] | +
out_meta_checksum |
+Checksum of current metadata. |
+[out][transfer none] | +
void +ostree_repo_commit_traverse_iter_get_file + (+OstreeRepoCommitTraverseIter *iter, +char **out_name, +char **out_checksum);
Return information on the current file. This function may only be
+called if OSTREE_REPO_COMMIT_ITER_RESULT_FILE was returned from
+ostree_repo_commit_traverse_iter_next().
iter |
+An iter |
+Â | +
out_name |
+Name of current file. |
+[out][transfer none] | +
out_checksum |
+Checksum of current file. |
+[out][transfer none] | +
gboolean +ostree_repo_commit_traverse_iter_init_commit + (+OstreeRepoCommitTraverseIter *iter, +OstreeRepo *repo, +GVariant *commit, +OstreeRepoCommitTraverseFlags flags, +GError **error);
Initialize (in place) an iterator over the root of a commit object.
+iter |
+An iter |
+Â | +
repo |
+A repo |
+Â | +
commit |
+Variant of type |
+Â | +
flags |
+Flags |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_commit_traverse_iter_init_dirtree + (+OstreeRepoCommitTraverseIter *iter, +OstreeRepo *repo, +GVariant *dirtree, +OstreeRepoCommitTraverseFlags flags, +GError **error);
Initialize (in place) an iterator over a directory tree.
+iter |
+An iter |
+Â | +
repo |
+A repo |
+Â | +
dirtree |
+Variant of type |
+Â | +
flags |
+Flags |
+Â | +
error |
+Error |
+Â | +
OstreeRepoCommitIterResult +ostree_repo_commit_traverse_iter_next (+OstreeRepoCommitTraverseIter *iter, +GCancellable *cancellable, +GError **error);
Step the interator to the next item. Files will be returned first,
+then subdirectories. Call this in a loop; upon encountering
+OSTREE_REPO_COMMIT_ITER_RESULT_END, there will be no more files or
+directories. If OSTREE_REPO_COMMIT_ITER_RESULT_DIR is returned,
+then call ostree_repo_commit_traverse_iter_get_dir() to retrieve
+data for that directory. Similarly, if
+OSTREE_REPO_COMMIT_ITER_RESULT_FILE is returned, call
+ostree_repo_commit_traverse_iter_get_file().
If OSTREE_REPO_COMMIT_ITER_RESULT_ERROR is returned, it is a
+program error to call any further API on iter
+ except for
+ostree_repo_commit_traverse_iter_clear().
gboolean +ostree_repo_prune (+OstreeRepo *self, +OstreeRepoPruneFlags flags, +gint depth, +gint *out_objects_total, +gint *out_objects_pruned, +guint64 *out_pruned_object_size_total, +GCancellable *cancellable, +GError **error);
Delete content from the repository. By default, this function will +only delete "orphaned" objects not referred to by any commit. This +can happen during a local commit operation, when we have written +content objects but not saved the commit referencing them.
+However, if OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY is provided, instead
+of traversing all commits, only refs will be used. Particularly
+when combined with depth
+, this is a convenient way to delete
+history from the repository.
Use the OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE to just determine
+statistics on objects that would be deleted, without actually
+deleting them.
self |
+Repo |
+Â | +
flags |
+Options controlling prune process |
+Â | +
depth |
+Stop traversal after this many iterations (-1 for unlimited) |
+Â | +
out_objects_total |
+Number of objects found. |
+[out] | +
out_objects_pruned |
+Number of objects deleted. |
+[out] | +
out_pruned_object_size_total |
+Storage size in bytes of objects deleted. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_prune_static_deltas (+OstreeRepo *self, +const char *commit, +GCancellable *cancellable, +GError **error);
Prune static deltas, if COMMIT is specified then delete static delta files only +targeting that commit; otherwise any static delta of non existing commits are +deleted.
+self |
+Repo |
+Â | +
commit |
+ ASCII SHA256 checksum for commit, or |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_pull (+OstreeRepo *self, +const char *remote_name, +char **refs_to_fetch, +OstreeRepoPullFlags flags, +OstreeAsyncProgress *progress, +GCancellable *cancellable, +GError **error);
Connect to the remote repository, fetching the specified set of
+refs refs_to_fetch
+. For each ref that is changed, download the
+commit, all metadata, and all content objects, storing them safely
+on disk in self
+.
If flags
+ contains OSTREE_REPO_PULL_FLAGS_MIRROR, and
+the refs_to_fetch
+ is NULL, and the remote repository contains a
+summary file, then all refs will be fetched.
If flags
+ contains OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY, then only the
+metadata for the commits in refs_to_fetch
+ is pulled.
Warning: This API will iterate the thread default main context,
+which is a bug, but kept for compatibility reasons. If you want to
+avoid this, use g_main_context_push_thread_default() to push a new
+one around this call.
self |
+Repo |
+Â | +
remote_name |
+Name of remote |
+Â | +
refs_to_fetch |
+ Optional list of refs; if |
+[array zero-terminated=1][element-type utf8][allow-none] | +
flags |
+Options controlling fetch behavior |
+Â | +
progress |
+Progress. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_pull_one_dir (+OstreeRepo *self, +const char *remote_name, +const char *dir_to_pull, +char **refs_to_fetch, +OstreeRepoPullFlags flags, +OstreeAsyncProgress *progress, +GCancellable *cancellable, +GError **error);
This is similar to ostree_repo_pull(), but only fetches a single
+subpath.
self |
+Repo |
+Â | +
remote_name |
+Name of remote |
+Â | +
dir_to_pull |
+Subdirectory path |
+Â | +
refs_to_fetch |
+ Optional list of refs; if |
+[array zero-terminated=1][element-type utf8][allow-none] | +
flags |
+Options controlling fetch behavior |
+Â | +
progress |
+Progress. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_pull_with_options (+OstreeRepo *self, +const char *remote_name_or_baseurl, +GVariant *options, +OstreeAsyncProgress *progress, +GCancellable *cancellable, +GError **error);
Like ostree_repo_pull(), but supports an extensible set of flags.
+The following are currently defined:
refs (as): Array of string refs
flags (i): An instance of OstreeRepoPullFlags
subdir (s): Pull just this subdirectory
override-remote-name (s): If local, add this remote to refspec
gpg-verify (b): GPG verify commits
gpg-verify-summary (b): GPG verify summary
depth (i): How far in the history to traverse; default is 0, -1 means infinite
disable-static-deltas (b): Do not use static deltas
require-static-deltas (b): Require static deltas
override-commit-ids (as): Array of specific commit IDs to fetch for refs
dry-run (b): Only print information on what will be downloaded (requires static deltas)
override-url (s): Fetch objects from this URL if remote specifies no metalink in options
self |
+Repo |
+Â | +
remote_name_or_baseurl |
+Name of remote or file:// url |
+Â | +
options |
+A GVariant a{sv} with an extensible set of flags. |
+Â | +
progress |
+Progress. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
void +ostree_repo_pull_default_console_progress_changed + (+OstreeAsyncProgress *progress, +gpointer user_data);
Convenient "changed" callback for use with
+ostree_async_progress_new_and_connect() when pulling from a remote
+repository.
Depending on the state of the OstreeAsyncProgress, either displays a +custom status message, or else outstanding fetch progress in bytes/sec, +or else outstanding content or metadata writes to the repository in +number of objects.
+Compatibility note: this function previously assumed that user_data
+
+was a pointer to a GSConsole instance. This is no longer the case,
+and user_data
+ is ignored.
progress |
+Async progress |
+Â | +
user_data |
+User data. |
+[allow-none] | +
gboolean +ostree_repo_sign_commit (+OstreeRepo *self, +const gchar *commit_checksum, +const gchar *key_id, +const gchar *homedir, +GCancellable *cancellable, +GError **error);
Add a GPG signature to a commit.
+self |
+Self |
+Â | +
commit_checksum |
+SHA256 of given commit to sign |
+Â | +
key_id |
+Use this GPG key id |
+Â | +
homedir |
+ GPG home directory, or |
+[allow-none] | +
cancellable |
+A GCancellable |
+Â | +
error |
+a GError |
+Â | +
gboolean +ostree_repo_append_gpg_signature (+OstreeRepo *self, +const gchar *commit_checksum, +GBytes *signature_bytes, +GCancellable *cancellable, +GError **error);
Append a GPG signature to a commit.
+ +gboolean +ostree_repo_add_gpg_signature_summary (+OstreeRepo *self, +const gchar **key_id, +const gchar *homedir, +GCancellable *cancellable, +GError **error);
Add a GPG signature to a static delta.
+self |
+Self |
+Â | +
key_id |
+NULL-terminated array of GPG keys. |
+[array zero-terminated=1][element-type utf8] | +
homedir |
+ GPG home directory, or |
+[allow-none] | +
cancellable |
+A GCancellable |
+Â | +
error |
+a GError |
+Â | +
OstreeGpgVerifyResult * +ostree_repo_gpg_verify_data (+OstreeRepo *self, +const gchar *remote_name, +GBytes *data, +GBytes *signatures, +GFile *keyringdir, +GFile *extra_keyring, +GCancellable *cancellable, +GError **error);
Verify signatures
+ for data
+ using GPG keys in the keyring for
+remote_name
+, and return an OstreeGpgVerifyResult.
The remote_name
+ parameter can be NULL. In that case it will do
+the verifications using GPG keys in the keyrings of all remotes.
self |
+Repository |
+Â | +
remote_name |
+Name of remote. |
+[nullable] | +
data |
+Data as a GBytes |
+Â | +
signatures |
+Signatures as a GBytes |
+Â | +
keyringdir |
+Path to directory GPG keyrings; overrides built-in default if given. |
+[nullable] | +
extra_keyring |
+Path to additional keyring file (not a directory). |
+[nullable] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_repo_verify_commit (+OstreeRepo *self, +const gchar *commit_checksum, +GFile *keyringdir, +GFile *extra_keyring, +GCancellable *cancellable, +GError **error);
Check for a valid GPG signature on commit named by the ASCII
+checksum commit_checksum
+.
self |
+Repository |
+Â | +
commit_checksum |
+ASCII SHA256 checksum |
+Â | +
keyringdir |
+Path to directory GPG keyrings; overrides built-in default if given. |
+[allow-none] | +
extra_keyring |
+Path to additional keyring file (not a directory). |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
OstreeGpgVerifyResult * +ostree_repo_verify_commit_ext (+OstreeRepo *self, +const gchar *commit_checksum, +GFile *keyringdir, +GFile *extra_keyring, +GCancellable *cancellable, +GError **error);
Read GPG signature(s) on the commit named by the ASCII checksum
+commit_checksum
+ and return detailed results.
self |
+Repository |
+Â | +
commit_checksum |
+ASCII SHA256 checksum |
+Â | +
keyringdir |
+Path to directory GPG keyrings; overrides built-in default if given. |
+[allow-none] | +
extra_keyring |
+Path to additional keyring file (not a directory). |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
OstreeGpgVerifyResult * +ostree_repo_verify_summary (+OstreeRepo *self, +const char *remote_name, +GBytes *summary, +GBytes *signatures, +GCancellable *cancellable, +GError **error);
Verify signatures
+ for summary
+ data using GPG keys in the keyring for
+remote_name
+, and return an OstreeGpgVerifyResult.
gboolean +ostree_repo_regenerate_summary (+OstreeRepo *self, +GVariant *additional_metadata, +GCancellable *cancellable, +GError **error);
An OSTree repository can contain a high level "summary" file that +describes the available branches and other metadata.
+It is regenerated automatically after a commit if
+core/commit-update-summary is set.
self |
+Repo |
+Â | +
additional_metadata |
+ A GVariant of type a{sv}, or |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
See the documentation of OstreeRepo for more information about the +possible modes.
+| + |
+ Files are stored as themselves; checkouts are hardlinks; can only be written as root + |
+Â | +
| + |
+ Files are compressed, should be owned by non-root. Can be served via HTTP + |
+Â | +
| + |
+ Files are stored as themselves, except ownership; can be written by user. Hardlinks work only in user checkouts. + |
+Â | +
struct OstreeRepoTransactionStats {
+ guint metadata_objects_total;
+ guint metadata_objects_written;
+ guint content_objects_total;
+ guint content_objects_written;
+ guint64 content_bytes_written;
+
+ guint64 padding1;
+ guint64 padding2;
+ guint64 padding3;
+ guint64 padding4;
+};
+
+A list of statistics for each transaction that may be +interesting for reporting purposes.
+| + | The total number of metadata objects +in the repository after this transaction has completed. |
+Â | +
| + | The number of metadata objects that +were written to the repository in this transaction. |
+Â | +
| + | The total number of content objects +in the repository after this transaction has completed. |
+Â | +
| + | The number of content objects that +were written to the repository in this transaction. |
+Â | +
| + | The amount of data added to the repository, +in bytes, counting only content objects. |
+Â | +
| + | reserved |
+Â | +
| + | reserved |
+Â | +
| + | reserved |
+Â | +
| + | reserved |
+Â | +
typedef struct OstreeRepoCommitModifier OstreeRepoCommitModifier; ++
A structure allowing control over commits.
+#define OSTREE_REPO_LIST_OBJECTS_VARIANT_TYPE (G_VARIANT_TYPE ("(bas)")
+
+b - TRUE if object is available "loose"
+as - List of pack file checksums in which this object appears
| +Top + | +
+Core repository-independent functions+Core repository-independent functions — Create, validate, and convert core data types + |
++ |
| #define | +OSTREE_MAX_METADATA_SIZE | +
| #define | +OSTREE_MAX_METADATA_WARN_SIZE | +
| #define | +OSTREE_MAX_RECURSION | +
| enum | +OstreeObjectType | +
| #define | +OSTREE_OBJECT_TYPE_LAST | +
| #define | +OSTREE_DIRMETA_GVARIANT_STRING | +
| #define | +OSTREE_DIRMETA_GVARIANT_FORMAT | +
| #define | +OSTREE_FILEMETA_GVARIANT_STRING | +
| #define | +OSTREE_FILEMETA_GVARIANT_FORMAT | +
| #define | +OSTREE_TREE_GVARIANT_STRING | +
| #define | +OSTREE_TREE_GVARIANT_FORMAT | +
| #define | +OSTREE_COMMIT_GVARIANT_STRING | +
| #define | +OSTREE_COMMIT_GVARIANT_FORMAT | +
| #define | +OSTREE_SUMMARY_GVARIANT_STRING | +
| #define | +OSTREE_SUMMARY_GVARIANT_FORMAT | +
These functions implement repository-independent algorithms for +operating on the core OSTree data formats, such as converting +GFileInfo into a GVariant.
+There are 4 types of objects; file, dirmeta, tree, and commit. The +last 3 are metadata, and the file object is the only content object +type.
+All metadata objects are stored as GVariant (big endian). The +rationale for this is the same as that of the ext{2,3,4} family of +filesystems; most developers will be using LE, and so it's better +to continually test the BE->LE swap.
+The file object is a custom format in order to support streaming.
+const GVariantType *
+ostree_metadata_variant_type (OstreeObjectType objtype);
+gboolean +ostree_validate_checksum_string (+const char *sha256, +GError **error);
Use this function to see if input strings are checksums.
+ + +guchar *
+ostree_checksum_to_bytes (const char *checksum);
+
+ Binary checksum from checksum
+of length 32; free with g_free().
[transfer full][array fixed-size=32]
+GVariant *
+ostree_checksum_to_bytes_v (const char *checksum);
+
+
+void +ostree_checksum_inplace_from_bytes (+const guchar *csum, +char *buf);
Overwrite the contents of buf
+ with stringified version of csum
+.
[skip]
+csum |
+An binary checksum of length 32. |
+[array fixed-size=32] | +
buf |
+Output location, must be at least OSTREE_SHA256_STRING_LEN+1 bytes in length |
+Â | +
void +ostree_checksum_inplace_to_bytes (+const char *checksum, +guchar *buf);
Convert checksum
+ from a string to binary in-place, without
+allocating memory. Use this function in hot code paths.
const guchar *
+ostree_checksum_bytes_peek (GVariant *bytes);
+
+ Binary checksum data in bytes
+; do not free. If bytes
+does not have the correct length, return NULL.
[transfer none][array fixed-size=32][element-type guint8]
+const guchar * +ostree_checksum_bytes_peek_validate (+GVariant *bytes, +GError **error);
Like ostree_checksum_bytes_peek(), but also throws error
+.
char *
+ostree_checksum_b64_from_bytes (const guchar *csum);
+
+
+guchar *
+ostree_checksum_b64_to_bytes (const char *checksum);
+
+
+void +ostree_checksum_b64_inplace_from_bytes + (+const guchar *csum, +char *buf);
Overwrite the contents of buf
+ with modified base64 encoding of csum
+.
+The "modified" term refers to the fact that instead of '/', the '_'
+character is used.
[skip]
+csum |
+An binary checksum of length 32. |
+[array fixed-size=32] | +
buf |
+Output location, must be at least 44 bytes in length |
+Â | +
void +ostree_checksum_b64_inplace_to_bytes (+const char *checksum, +guint8 *buf);
Overwrite the contents of buf
+ with stringified version of csum
+.
[skip]
+checksum |
+An binary checksum of length 32. |
+[array fixed-size=32] | +
buf |
+Output location, must be at least 45 bytes in length |
+Â | +
int +ostree_cmp_checksum_bytes (+const guchar *a, +const guchar *b);
Compare two binary checksums, using memcmp().
gboolean +ostree_parse_refspec (+const char *refspec, +char **out_remote, +char **out_ref, +GError **error);
Split a refspec like "gnome-ostree:gnome-ostree/buildmaster" into
+two parts; out_remote
+ will be set to "gnome-ostree", and out_ref
+
+will be "gnome-ostree/buildmaster".
If refspec
+ refers to a local ref, out_remote
+ will be NULL.
refspec |
+A "refspec" string |
+Â | +
out_remote |
+ The remote name, or |
+[out][allow-none] | +
out_ref |
+Name of ref. |
+[out][allow-none] | +
error |
+Error |
+Â | +
const char *
+ostree_object_type_to_string (OstreeObjectType objtype);
+Serialize objtype
+ to a string; this is used for file extensions.
OstreeObjectType
+ostree_object_type_from_string (const char *str);
+The reverse of ostree_object_type_to_string().
guint
+ostree_hash_object_name (gconstpointer a);
+Use this function with GHashTable and ostree_object_name_serialize().
GVariant * +ostree_object_name_serialize (+ + +const char *checksum, +OstreeObjectType objtype);
void +ostree_object_name_deserialize (+GVariant *variant, +const char **out_checksum, +OstreeObjectType *out_objtype);
Reverse ostree_object_name_serialize(). Note that out_checksum
+ is
+only valid for the lifetime of variant
+, and must not be freed.
variant |
+A GVariant of type (su) |
+Â | +
out_checksum |
+ Pointer into string memory of |
+[out][transfer none] | +
out_objtype |
+Return object type. |
+[out] | +
char * +ostree_object_to_string (+ + +const char *checksum, +OstreeObjectType objtype);
void +ostree_object_from_string (+const char *str, +gchar **out_checksum, +OstreeObjectType *out_objtype);
Reverse ostree_object_to_string().
str |
+An ASCII checksum |
+Â | +
out_checksum |
+Parsed checksum. |
+[out][transfer full] | +
out_objtype |
+Parsed object type. |
+[out] | +
gboolean +ostree_content_stream_parse (+gboolean compressed, +GInputStream *input, +guint64 input_length, +gboolean trusted, +GInputStream **out_input, +GFileInfo **out_file_info, +GVariant **out_xattrs, +GCancellable *cancellable, +GError **error);
The reverse of ostree_raw_file_to_content_stream(); this function
+converts an object content stream back into components.
compressed |
+Whether or not the stream is zlib-compressed |
+Â | +
input |
+Object content stream |
+Â | +
input_length |
+Length of stream |
+Â | +
trusted |
+If |
+Â | +
out_input |
+The raw file content stream. |
+[out] | +
out_file_info |
+Normal metadata. |
+[out] | +
out_xattrs |
+Extended attributes. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_content_file_parse (+gboolean compressed, +GFile *content_path, +gboolean trusted, +GInputStream **out_input, +GFileInfo **out_file_info, +GVariant **out_xattrs, +GCancellable *cancellable, +GError **error);
A thin wrapper for ostree_content_stream_parse(); this function
+converts an object content stream back into components.
compressed |
+Whether or not the stream is zlib-compressed |
+Â | +
content_path |
+Path to file containing content |
+Â | +
trusted |
+If |
+Â | +
out_input |
+The raw file content stream. |
+[out] | +
out_file_info |
+Normal metadata. |
+[out] | +
out_xattrs |
+Extended attributes. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_content_file_parse_at (+gboolean compressed, +int parent_dfd, +const char *path, +gboolean trusted, +GInputStream **out_input, +GFileInfo **out_file_info, +GVariant **out_xattrs, +GCancellable *cancellable, +GError **error);
A thin wrapper for ostree_content_stream_parse(); this function
+converts an object content stream back into components.
compressed |
+Whether or not the stream is zlib-compressed |
+Â | +
parent_dfd |
+Directory file descriptor |
+Â | +
path |
+Subpath |
+Â | +
trusted |
+If |
+Â | +
out_input |
+The raw file content stream. |
+[out] | +
out_file_info |
+Normal metadata. |
+[out] | +
out_xattrs |
+Extended attributes. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_raw_file_to_archive_z2_stream (+GInputStream *input, +GFileInfo *file_info, +GVariant *xattrs, +GInputStream **out_input, +GCancellable *cancellable, +GError **error);
Convert from a "bare" file representation into an +OSTREE_OBJECT_TYPE_FILE stream suitable for ostree pull.
+input |
+File raw content stream |
+Â | +
file_info |
+A file info |
+Â | +
xattrs |
+Optional extended attributes. |
+[allow-none] | +
out_input |
+Serialized object stream. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_raw_file_to_content_stream (+GInputStream *input, +GFileInfo *file_info, +GVariant *xattrs, +GInputStream **out_input, +guint64 *out_length, +GCancellable *cancellable, +GError **error);
Convert from a "bare" file representation into an +OSTREE_OBJECT_TYPE_FILE stream. This is a fundamental operation +for writing data to an OstreeRepo.
+input |
+File raw content stream |
+Â | +
file_info |
+A file info |
+Â | +
xattrs |
+Optional extended attributes. |
+[allow-none] | +
out_input |
+Serialized object stream. |
+[out] | +
out_length |
+Length of stream. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_checksum_file_from_input (+GFileInfo *file_info, +GVariant *xattrs, +GInputStream *in, +OstreeObjectType objtype, +guchar **out_csum, +GCancellable *cancellable, +GError **error);
Compute the OSTree checksum for a given input.
+file_info |
+File information |
+Â | +
xattrs |
+Optional extended attributes. |
+[allow-none] | +
in |
+ File content, should be |
+[allow-none] | +
objtype |
+Object type |
+Â | +
out_csum |
+Return location for binary checksum. |
+[out][array fixed-size=32] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_checksum_file (+GFile *f, +OstreeObjectType objtype, +guchar **out_csum, +GCancellable *cancellable, +GError **error);
Compute the OSTree checksum for a given file.
+ +void +ostree_checksum_file_async (+GFile *f, +OstreeObjectType objtype, +int io_priority, +GCancellable *cancellable, +GAsyncReadyCallback callback, +gpointer user_data);
Asynchronously compute the OSTree checksum for a given file;
+complete with ostree_checksum_file_async_finish().
gboolean +ostree_checksum_file_async_finish (+GFile *f, +GAsyncResult *result, +guchar **out_csum, +GError **error);
Finish computing the OSTree checksum for a given file; see
+ostree_checksum_file_async().
GVariant * +ostree_create_directory_metadata (+GFileInfo *dir_info, +GVariant *xattrs);
dir_info |
+a GFileInfo containing directory information |
+Â | +
xattrs |
+Optional extended attributes. |
+[allow-none] | +
gboolean +ostree_validate_structureof_objtype (+ + +guchar objtype, +GError **error);
gboolean +ostree_validate_structureof_csum_v (+ + +GVariant *checksum, +GError **error);
gboolean +ostree_validate_structureof_checksum_string + (+ + +const char *checksum, +GError **error);
gboolean +ostree_validate_structureof_file_mode (+ + +guint32 mode, +GError **error);
gboolean +ostree_validate_structureof_commit (+GVariant *commit, +GError **error);
Use this to validate the basic structure of commit
+, independent of
+any other objects it references.
commit |
+A commit object, |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_validate_structureof_dirtree (+GVariant *dirtree, +GError **error);
Use this to validate the basic structure of dirtree
+, independent of
+any other objects it references.
dirtree |
+A dirtree object, |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_validate_structureof_dirmeta (+GVariant *dirmeta, +GError **error);
Use this to validate the basic structure of dirmeta
+.
dirmeta |
+A dirmeta object, |
+Â | +
error |
+Error |
+Â | +
#define OSTREE_MAX_METADATA_SIZE (10 * 1024 * 1024) ++
Maximum permitted size in bytes of metadata objects. This is an +arbitrary number, but really, no one should be putting humongous +data in metadata.
+#define OSTREE_MAX_METADATA_WARN_SIZE (7 * 1024 * 1024) ++
Objects committed above this size will be allowed, but a warning +will be emitted.
+Enumeration for core object types; OSTREE_OBJECT_TYPE_FILE is for
+content, the other types are metadata.
| + |
+ Content; regular file, symbolic link + |
+Â | +
| + |
+ List of children (trees or files), and metadata + |
+Â | +
| + |
+ Directory metadata + |
+Â | +
| + |
+ Toplevel object, refers to tree and dirmeta for root + |
+Â | +
| + |
+ Toplevel object, refers to a deleted commit + |
+Â | +
| + |
+ Detached metadata for a commit + |
+Â | +
#define OSTREE_OBJECT_TYPE_LAST OSTREE_OBJECT_TYPE_COMMIT_META ++
Last valid object type; use this to validate ranges.
+#define OSTREE_DIRMETA_GVARIANT_FORMAT G_VARIANT_TYPE (OSTREE_DIRMETA_GVARIANT_STRING) ++
u - uid
u - gid
u - mode
a(ayay) - xattrs
#define OSTREE_FILEMETA_GVARIANT_FORMAT G_VARIANT_TYPE (OSTREE_FILEMETA_GVARIANT_STRING) ++
This is not a regular object type, but used as an xattr on a .file object +in bare-user repositories. This allows us to store metadata information that we +can't store in the real filesystem but we can still use a regular .file object +that we can hardlink to in the case of a user-mode checkout.
+u - uid
u - gid
u - mode
a(ayay) - xattrs
#define OSTREE_TREE_GVARIANT_FORMAT G_VARIANT_TYPE (OSTREE_TREE_GVARIANT_STRING) ++
a(say) - array of (filename, checksum) for files
a(sayay) - array of (dirname, tree_checksum, meta_checksum) for directories
#define OSTREE_COMMIT_GVARIANT_FORMAT G_VARIANT_TYPE (OSTREE_COMMIT_GVARIANT_STRING) ++
a{sv} - Metadata
ay - parent checksum (empty string for initial)
a(say) - Related objects
s - subject
s - body
t - Timestamp in seconds since the epoch (UTC)
ay - Root tree contents
ay - Root tree metadata
#define OSTREE_SUMMARY_GVARIANT_FORMAT G_VARIANT_TYPE (OSTREE_SUMMARY_GVARIANT_STRING) ++
a(s(taya{sv})) - Map of ref name -> (latest commit size, latest commit checksum, additional metadata), sorted by ref name
a{sv} - Additional metadata, at the current time the following are defined:
+key: "ostree.static-deltas", value: a{sv}, static delta name -> 32 bytes of checksum
| +Top + | +
+GPG signature verification results+GPG signature verification results — Inspect detached GPG signatures + |
++ |
| +guint + | ++ostree_gpg_verify_result_count_all () + | +
| +guint + | ++ostree_gpg_verify_result_count_valid () + | +
| +gboolean + | ++ostree_gpg_verify_result_lookup () + | +
| +GVariant * + | ++ostree_gpg_verify_result_get () + | +
| +GVariant * + | ++ostree_gpg_verify_result_get_all () + | +
| +void + | ++ostree_gpg_verify_result_describe () + | +
| +void + | ++ostree_gpg_verify_result_describe_variant () + | +
| +gboolean + | ++ostree_gpg_verify_result_require_valid_signature () + | +
| typedef | +OstreeGpgVerifyResult | +
| enum | +OstreeGpgSignatureAttr | +
| enum | +OstreeGpgSignatureFormatFlags | +
OstreeGpgVerifyResult contains verification details for GPG signatures +read from a detached OstreeRepo metadata object.
+Use ostree_gpg_verify_result_count_all() and
+ostree_gpg_verify_result_count_valid() to quickly check overall signature
+validity.
Use ostree_gpg_verify_result_lookup() to find a signature by the key ID
+or fingerprint of the signing key.
For more in-depth inspection, such as presenting signature details to the
+user, pass an array of attribute values to ostree_gpg_verify_result_get()
+or get all signature details with ostree_gpg_verify_result_get_all().
guint
+ostree_gpg_verify_result_count_all (OstreeGpgVerifyResult *result);
+Counts all the signatures in result
+.
guint
+ostree_gpg_verify_result_count_valid (OstreeGpgVerifyResult *result);
+Counts only the valid signatures in result
+.
gboolean +ostree_gpg_verify_result_lookup (+OstreeGpgVerifyResult *result, +const gchar *key_id, +guint *out_signature_index);
Searches result
+ for a signature signed by key_id
+. If a match is found,
+the function returns TRUE and sets out_signature_index
+ so that further
+signature details can be obtained through ostree_gpg_verify_result_get().
+If no match is found, the function returns FALSE and leaves
+out_signature_index
+ unchanged.
result |
++ | Â | +
key_id |
+a GPG key ID or fingerprint |
+Â | +
out_signature_index |
+ return location for the index of the signature
+signed by |
+[out] | +
GVariant * +ostree_gpg_verify_result_get (+OstreeGpgVerifyResult *result, +guint signature_index, +OstreeGpgSignatureAttr *attrs, +guint n_attrs);
Builds a GVariant tuple of requested attributes for the GPG signature at
+signature_index
+ in result
+. See the OstreeGpgSignatureAttr description
+for the GVariantType of each available attribute.
It is a programmer error to request an invalid OstreeGpgSignatureAttr or
+an invalid signature_index
+. Use ostree_gpg_verify_result_count_all() to
+find the number of signatures in result
+.
result |
++ | Â | +
signature_index |
+which signature to get attributes from |
+Â | +
attrs |
+Array of requested attributes. |
+[array length=n_attrs] | +
n_attrs |
+Length of the |
+Â | +
GVariant * +ostree_gpg_verify_result_get_all (+OstreeGpgVerifyResult *result, +guint signature_index);
Builds a GVariant tuple of all available attributes for the GPG signature
+at signature_index
+ in result
+.
The child values in the returned GVariant tuple are ordered to match the
+OstreeGpgSignatureAttr enumeration, which means the enum values can be
+used as index values in functions like g_variant_get_child(). See the
+OstreeGpgSignatureAttr description for the GVariantType of each
+available attribute.
+ The OstreeGpgSignatureAttr enumeration may be extended in the future + with new attributes, which would affect the GVariant tuple returned by + this function. While the position and type of current child values in + the GVariant tuple will not change, to avoid backward-compatibility + issues please do not depend on the tuple's overall size or + type signature. +
It is a programmer error to request an invalid signature_index
+. Use
+ostree_gpg_verify_result_count_all() to find the number of signatures in
+result
+.
void +ostree_gpg_verify_result_describe (+OstreeGpgVerifyResult *result, +guint signature_index, +GString *output_buffer, +const gchar *line_prefix, +OstreeGpgSignatureFormatFlags flags);
Appends a brief, human-readable description of the GPG signature at
+signature_index
+ in result
+ to the output_buffer
+. The description
+spans multiple lines. A line_prefix
+ string, if given, will precede
+each line of the description.
The flags
+ argument is reserved for future variations to the description
+format. Currently must be 0.
It is a programmer error to request an invalid signature_index
+. Use
+ostree_gpg_verify_result_count_all() to find the number of signatures in
+result
+.
result |
++ | Â | +
signature_index |
+which signature to describe |
+Â | +
output_buffer |
+a GString to hold the description |
+Â | +
line_prefix |
+optional line prefix string. |
+[allow-none] | +
flags |
+flags to adjust the description format |
+Â | +
void +ostree_gpg_verify_result_describe_variant + (+GVariant *variant, +GString *output_buffer, +const gchar *line_prefix, +OstreeGpgSignatureFormatFlags flags);
Similar to ostree_gpg_verify_result_describe() but takes a GVariant of
+all attributes for a GPG signature instead of an OstreeGpgVerifyResult
+and signature index.
The variant
+ MUST have been created by
+ostree_gpg_verify_result_get_all().
variant |
+a GVariant from |
+Â | +
output_buffer |
+a GString to hold the description |
+Â | +
line_prefix |
+optional line prefix string. |
+[allow-none] | +
flags |
+flags to adjust the description format |
+Â | +
gboolean +ostree_gpg_verify_result_require_valid_signature + (+OstreeGpgVerifyResult *result, +GError **error);
Checks if the result contains at least one signature from the
+trusted keyring. You can call this function immediately after
+ostree_repo_verify_summary() or ostree_repo_verify_commit_ext() -
+it will handle the NULL result
+ and filled error
+ too.
typedef struct OstreeGpgVerifyResult OstreeGpgVerifyResult; ++
Private instance structure.
+Signature attributes available from an OstreeGpgVerifyResult. +The attribute's GVariantType is shown in brackets.
+| + |
+ [G_VARIANT_TYPE_BOOLEAN] Is the signature valid? + |
+Â | +
| + |
+ [G_VARIANT_TYPE_BOOLEAN] Has the signature expired? + |
+Â | +
| + |
+ [G_VARIANT_TYPE_BOOLEAN] Has the signing key expired? + |
+Â | +
| + |
+ [G_VARIANT_TYPE_BOOLEAN] Has the signing key been revoked? + |
+Â | +
| + |
+ [G_VARIANT_TYPE_BOOLEAN] Is the signing key missing? + |
+Â | +
| + |
+ [G_VARIANT_TYPE_STRING] Fingerprint of the signing key + |
+Â | +
| + |
+ [G_VARIANT_TYPE_INT64] Signature creation Unix timestamp + |
+Â | +
| + |
+ [G_VARIANT_TYPE_INT64] Signature expiration Unix timestamp (0 if no + expiration) + |
+Â | +
| + |
+ [G_VARIANT_TYPE_STRING] Name of the public key algorithm used to create + the signature + |
+Â | +
| + |
+ [G_VARIANT_TYPE_STRING] Name of the hash algorithm used to create the + signature + |
+Â | +
| + |
+ [G_VARIANT_TYPE_STRING] The name of the signing key's primary user + |
+Â | +
| + |
+ [G_VARIANT_TYPE_STRING] The email address of the signing key's primary + user + |
+Â | +
Formatting flags for ostree_gpg_verify_result_describe(). Currently
+there's only one possible output format, but this enumeration allows
+for future variations.
| +Top + | +
+In-memory modifiable filesystem tree+In-memory modifiable filesystem tree — Modifiable filesystem tree + |
++ |
| +OstreeMutableTree * + | ++ostree_mutable_tree_new () + | +
| +void + | ++ostree_mutable_tree_set_metadata_checksum () + | +
| const char * + | ++ostree_mutable_tree_get_metadata_checksum () + | +
| +void + | ++ostree_mutable_tree_set_contents_checksum () + | +
| const char * + | ++ostree_mutable_tree_get_contents_checksum () + | +
| +gboolean + | ++ostree_mutable_tree_replace_file () + | +
| +gboolean + | ++ostree_mutable_tree_ensure_dir () + | +
| +gboolean + | ++ostree_mutable_tree_lookup () + | +
| +gboolean + | ++ostree_mutable_tree_ensure_parent_dirs () + | +
| +gboolean + | ++ostree_mutable_tree_walk () + | +
| +GHashTable * + | ++ostree_mutable_tree_get_subdirs () + | +
| +GHashTable * + | ++ostree_mutable_tree_get_files () + | +
In order to commit content into an OstreeRepo, it must first be +imported into an OstreeMutableTree. There are several high level +APIs to create an initiable OstreeMutableTree from a physical +filesystem directory, but they may also be computed +programmatically.
+void +ostree_mutable_tree_set_metadata_checksum + (+OstreeMutableTree *self, +const char *checksum);
const char *
+ostree_mutable_tree_get_metadata_checksum
+ (OstreeMutableTree *self);
+void +ostree_mutable_tree_set_contents_checksum + (+OstreeMutableTree *self, +const char *checksum);
const char *
+ostree_mutable_tree_get_contents_checksum
+ (OstreeMutableTree *self);
+gboolean +ostree_mutable_tree_replace_file (+OstreeMutableTree *self, +const char *name, +const char *checksum, +GError **error);
gboolean +ostree_mutable_tree_ensure_dir (+OstreeMutableTree *self, +const char *name, +OstreeMutableTree **out_subdir, +GError **error);
gboolean +ostree_mutable_tree_lookup (+OstreeMutableTree *self, +const char *name, +char **out_file_checksum, +OstreeMutableTree **out_subdir, +GError **error);
gboolean +ostree_mutable_tree_ensure_parent_dirs + (+OstreeMutableTree *self, +GPtrArray *split_path, +const char *metadata_checksum, +OstreeMutableTree **out_parent, +GError **error);
Create all parent trees necessary for the given split_path
+ to
+exist.
self |
+Tree |
+Â | +
split_path |
+File path components. |
+[element-type utf8] | +
metadata_checksum |
+SHA256 checksum for metadata |
+Â | +
out_parent |
+The parent tree. |
+[out][transfer full] | +
error |
+a GError |
+Â | +
gboolean +ostree_mutable_tree_walk (+OstreeMutableTree *self, +GPtrArray *split_path, +guint start, +OstreeMutableTree **out_subdir, +GError **error);
Traverse start
+ number of elements starting from split_path
+; the
+child will be returned in out_subdir
+.
self |
+Tree |
+Â | +
split_path |
+Split pathname. |
+[element-type utf8] | +
start |
+Descend from this number of elements in |
+Â | +
out_subdir |
+Target parent. |
+[out][transfer full] | +
error |
+Error |
+Â | +
GHashTable *
+ostree_mutable_tree_get_subdirs (OstreeMutableTree *self);
+
+GHashTable *
+ostree_mutable_tree_get_files (OstreeMutableTree *self);
+
+| +Top + | +
+Progress notification system for asynchronous operations+Progress notification system for asynchronous operations — Values representing progress + |
++ |
| +OstreeAsyncProgress * + | ++ostree_async_progress_new () + | +
| +OstreeAsyncProgress * + | ++ostree_async_progress_new_and_connect () + | +
| +char * + | ++ostree_async_progress_get_status () + | +
| +guint + | ++ostree_async_progress_get_uint () + | +
| +guint64 + | ++ostree_async_progress_get_uint64Â () + | +
| +void + | ++ostree_async_progress_set_status () + | +
| +void + | ++ostree_async_progress_set_uint () + | +
| +void + | ++ostree_async_progress_set_uint64Â () + | +
| +void + | ++ostree_async_progress_finish () + | +
For many asynchronous operations, it's desirable for callers to be +able to watch their status as they progress. For example, an user +interface calling an asynchronous download operation will want to +be able to see the total number of bytes downloaded.
+This class provides a mechanism for callees of asynchronous +operations to communicate back with callers. It transparently +handles thread safety, ensuring that the progress change +notification occurs in the thread-default context of the calling +operation.
+OstreeAsyncProgress * +ostree_async_progress_new_and_connect (+void (*changed) (OstreeAsyncProgress *self, gpointer user_data), +gpointer user_data);
char *
+ostree_async_progress_get_status (OstreeAsyncProgress *self);
+guint +ostree_async_progress_get_uint (+OstreeAsyncProgress *self, +const char *key);
guint64 +ostree_async_progress_get_uint64 (+OstreeAsyncProgress *self, +const char *key);
void +ostree_async_progress_set_status (+OstreeAsyncProgress *self, +const char *status);
void +ostree_async_progress_set_uint (+OstreeAsyncProgress *self, +const char *key, +guint value);
void +ostree_async_progress_set_uint64 (+OstreeAsyncProgress *self, +const char *key, +guint64 value);
void
+ostree_async_progress_finish (OstreeAsyncProgress *self);
+Process any pending signals, ensuring the main context is cleared +of sources used by this object. Also ensures that no further +events will be queued.
+ +| +Top + | +
| typedef | +OstreeSysroot | +
| enum | +OstreeSysrootSimpleWriteDeploymentFlags | +
A OstreeSysroot object represents a physical root filesystem, +which in particular should contain a toplevel /ostree directory. +Inside this directory is an OstreeRepo in /ostree/repo, plus a set +of deployments in /ostree/deploy.
+This class is not by default safe against concurrent use by threads
+or external processes. You can use ostree_sysroot_lock() to
+perform locking externally.
gboolean +ostree_sysroot_load (+OstreeSysroot *self, +GCancellable *cancellable, +GError **error);
Load deployment list, bootversion, and subbootversion from the
+rootfs self
+.
gboolean +ostree_sysroot_load_if_changed (+OstreeSysroot *self, +gboolean *out_changed, +GCancellable *cancellable, +GError **error);
gboolean +ostree_sysroot_lock (+OstreeSysroot *self, +GError **error);
Acquire an exclusive multi-process write lock for self
+. This call
+blocks until the lock has been acquired. The lock is not
+reentrant.
Release the lock with ostree_sysroot_unlock(). The lock will also
+be released if self
+ is deallocated.
gboolean +ostree_sysroot_try_lock (+OstreeSysroot *self, +gboolean *out_acquired, +GError **error);
Try to acquire an exclusive multi-process write lock for self
+. If
+another process holds the lock, this function will return
+immediately, setting out_acquired
+ to FALSE, and returning TRUE
+(and no error).
Release the lock with ostree_sysroot_unlock(). The lock will also
+be released if self
+ is deallocated.
self |
+Self |
+Â | +
out_acquired |
+Whether or not the lock has been acquired. |
+[out] | +
error |
+Error |
+Â | +
void +ostree_sysroot_lock_async (+OstreeSysroot *self, +GCancellable *cancellable, +GAsyncReadyCallback callback, +gpointer user_data);
An asynchronous version of ostree_sysroot_lock().
gboolean +ostree_sysroot_lock_finish (+OstreeSysroot *self, +GAsyncResult *result, +GError **error);
Call when ostree_sysroot_lock_async() is ready.
void
+ostree_sysroot_unlock (OstreeSysroot *self);
+Clear the lock previously acquired with ostree_sysroot_lock(). It
+is safe to call this function if the lock has not been previously
+acquired.
void
+ostree_sysroot_unload (OstreeSysroot *self);
+Release any resources such as file descriptors referring to the +root directory of this sysroot. Normally, those resources are +cleared by finalization, but in garbage collected languages that +may not be predictable.
+This undoes the effect of .ostree_sysroot_load()
int
+ostree_sysroot_get_fd (OstreeSysroot *self);
+Access a file descriptor that refers to the root directory of this
+sysroot. ostree_sysroot_load() must have been invoked prior to
+calling this function.
gboolean +ostree_sysroot_ensure_initialized (+OstreeSysroot *self, +GCancellable *cancellable, +GError **error);
Ensure that self
+ is set up as a valid rootfs, by creating
+/ostree/repo, among other things.
int
+ostree_sysroot_get_subbootversion (OstreeSysroot *self);
+GPtrArray *
+ostree_sysroot_get_deployments (OstreeSysroot *self);
+
+
+OstreeDeployment *
+ostree_sysroot_get_booted_deployment (OstreeSysroot *self);
+
+
+GFile * +ostree_sysroot_get_deployment_directory + (+ + +OstreeSysroot *self, +OstreeDeployment *deployment);
char * +ostree_sysroot_get_deployment_dirpath (+OstreeSysroot *self, +OstreeDeployment *deployment);
Note this function only returns a *relative* path - if you want
+to access, it, you must either use fd-relative api such as openat(),
+or concatenate it with the full ostree_sysroot_get_path().
GFile *
+ostree_sysroot_get_deployment_origin_path
+ (GFile *deployment_path);
+
+
+gboolean +ostree_sysroot_cleanup (+OstreeSysroot *self, +GCancellable *cancellable, +GError **error);
Delete any state that resulted from a partially completed +transaction, such as incomplete deployments.
+ +gboolean +ostree_sysroot_prepare_cleanup (+OstreeSysroot *self, +GCancellable *cancellable, +GError **error);
Like ostree_sysroot_cleanup() in that it cleans up incomplete deployments
+and old boot versions, but does NOT prune the repository.
gboolean +ostree_sysroot_get_repo (+OstreeSysroot *self, +OstreeRepo **out_repo, +GCancellable *cancellable, +GError **error);
Retrieve the OSTree repository in sysroot self
+.
self |
+Sysroot |
+Â | +
out_repo |
+ Repository in sysroot |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sysroot_init_osname (+OstreeSysroot *self, +const char *osname, +GCancellable *cancellable, +GError **error);
Initialize the directory structure for an "osname", which is a
+group of operating system deployments, with a shared /var. One
+is required for generating a deployment.
gboolean +ostree_sysroot_deployment_set_kargs (+OstreeSysroot *self, +OstreeDeployment *deployment, +char **new_kargs, +GCancellable *cancellable, +GError **error);
Entirely replace the kernel arguments of deployment
+ with the
+values in new_kargs
+.
self |
+Sysroot |
+Â | +
deployment |
+A deployment |
+Â | +
new_kargs |
+Replace deployment's kernel arguments. |
+[array zero-terminated=1][element-type utf8] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sysroot_deployment_set_mutable (+OstreeSysroot *self, +OstreeDeployment *deployment, +gboolean is_mutable, +GCancellable *cancellable, +GError **error);
By default, deployment directories are not mutable. This function +will allow making them temporarily mutable, for example to allow +layering additional non-OSTree content.
+ +gboolean +ostree_sysroot_deployment_unlock (+OstreeSysroot *self, +OstreeDeployment *deployment, +OstreeDeploymentUnlockedState unlocked_state, +GCancellable *cancellable, +GError **error);
Configure the target deployment deployment
+ such that it
+is writable. There are multiple modes, essentially differing
+in whether or not any changes persist across reboot.
The OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX state is persistent
+across reboots.
gboolean +ostree_sysroot_write_deployments (+OstreeSysroot *self, +GPtrArray *new_deployments, +GCancellable *cancellable, +GError **error);
Assuming new_deployments
+ have already been deployed in place on
+disk, atomically update bootloader configuration.
self |
+Sysroot |
+Â | +
new_deployments |
+List of new deployments. |
+[element-type OstreeDeployment] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sysroot_write_origin_file (+OstreeSysroot *sysroot, +OstreeDeployment *deployment, +GKeyFile *new_origin, +GCancellable *cancellable, +GError **error);
Immediately replace the origin file of the referenced deployment
+
+with the contents of new_origin
+. If new_origin
+ is NULL,
+this function will write the current origin of deployment
+.
sysroot |
+System root |
+Â | +
deployment |
+Deployment |
+Â | +
new_origin |
+Origin content. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sysroot_deploy_tree (+OstreeSysroot *self, +const char *osname, +const char *revision, +GKeyFile *origin, +OstreeDeployment *provided_merge_deployment, +char **override_kernel_argv, +OstreeDeployment **out_new_deployment, +GCancellable *cancellable, +GError **error);
Check out deployment tree with revision revision
+, performing a 3
+way merge with provided_merge_deployment
+ for configuration.
self |
+Sysroot |
+Â | +
osname |
+osname to use for merge deployment. |
+[allow-none] | +
revision |
+Checksum to add |
+Â | +
origin |
+Origin to use for upgrades. |
+[allow-none] | +
provided_merge_deployment |
+Use this deployment for merge path. |
+[allow-none] | +
override_kernel_argv |
+ Use these as kernel arguments; if |
+[allow-none][array zero-terminated=1][element-type utf8] | +
out_new_deployment |
+The new deployment path. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
OstreeDeployment * +ostree_sysroot_get_merge_deployment (+OstreeSysroot *self, +const char *osname);
Find the deployment to use as a configuration merge source; this is +the first one in the current deployment list which matches osname.
+self |
+Sysroot |
+Â | +
osname |
+Operating system group. |
+[allow-none] | +
GKeyFile * +ostree_sysroot_origin_new_from_refspec + (+ + +OstreeSysroot *self, +const char *refspec);
gboolean +ostree_sysroot_simple_write_deployment + (+OstreeSysroot *sysroot, +const char *osname, +OstreeDeployment *new_deployment, +OstreeDeployment *merge_deployment, +OstreeSysrootSimpleWriteDeploymentFlags flags, +GCancellable *cancellable, +GError **error);
Prepend new_deployment
+ to the list of deployments, commit, and
+cleanup. By default, all other deployments for the given osname
+
+except the merge deployment and the booted deployment will be
+garbage collected.
If OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN is
+specified, then all current deployments will be kept.
If OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT is
+specified, then instead of prepending, the new deployment will be
+added right after the booted or merge deployment, instead of first.
sysroot |
+Sysroot |
+Â | +
osname |
+OS name. |
+[allow-none] | +
new_deployment |
+Prepend this deployment to the list |
+Â | +
merge_deployment |
+Use this deployment for configuration merge. |
+[allow-none] | +
flags |
+Flags controlling behavior |
+Â | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
| +Top + | +
+SELinux policy management+SELinux policy management — Read SELinux policy and manage filesystem labels + |
++ |
| +OstreeSePolicy * + | ++ostree_sepolicy_new () + | +
| +GFile * + | ++ostree_sepolicy_get_path () + | +
| const char * + | ++ostree_sepolicy_get_name () + | +
| +gboolean + | ++ostree_sepolicy_get_label () + | +
| const char * + | ++ostree_sepolicy_get_csum () + | +
| +gboolean + | ++ostree_sepolicy_restorecon () + | +
| +gboolean + | ++ostree_sepolicy_setfscreatecon () + | +
| +void + | ++ostree_sepolicy_fscreatecon_cleanup () + | +
| typedef | +OstreeSePolicy | +
| enum | +OstreeSePolicyRestoreconFlags | +
A OstreeSePolicy object can load the SELinux policy from a given +root and perform labeling.
+OstreeSePolicy * +ostree_sepolicy_new (+ + +GFile *path, +GCancellable *cancellable, +GError **error);
gboolean +ostree_sepolicy_get_label (+OstreeSePolicy *self, +const char *relpath, +guint32 unix_mode, +char **out_label, +GCancellable *cancellable, +GError **error);
Store in out_label
+ the security context for the given relpath
+ and
+mode unix_mode
+. If the policy does not specify a label, NULL
+will be returned.
self |
+Self |
+Â | +
relpath |
+Path |
+Â | +
unix_mode |
+Unix mode |
+Â | +
out_label |
+Return location for security context. |
+[allow-none][out][transfer full] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sepolicy_restorecon (+OstreeSePolicy *self, +const char *path, +GFileInfo *info, +GFile *target, +OstreeSePolicyRestoreconFlags flags, +char **out_new_label, +GCancellable *cancellable, +GError **error);
Reset the security context of target
+ based on the SELinux policy.
self |
+Self |
+Â | +
path |
+Path string to use for policy lookup |
+Â | +
info |
+File attributes. |
+[allow-none] | +
target |
+Physical path to target file |
+Â | +
flags |
+Flags controlling behavior |
+Â | +
out_new_label |
+ New label, or |
+[allow-none][out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sepolicy_setfscreatecon (+ +OstreeSePolicy *self, +const char *path, +guint32 mode, +GError **error);
void
+ostree_sepolicy_fscreatecon_cleanup (void **unused);
+Cleanup function for ostree_sepolicy_setfscreatecon().
| +Top + | +
| +OstreeSysrootUpgrader * + | ++ostree_sysroot_upgrader_new () + | +
| +OstreeSysrootUpgrader * + | ++ostree_sysroot_upgrader_new_for_os () + | +
| +OstreeSysrootUpgrader * + | ++ostree_sysroot_upgrader_new_for_os_with_flags () + | +
| +GKeyFile * + | ++ostree_sysroot_upgrader_get_origin () + | +
| +GKeyFile * + | ++ostree_sysroot_upgrader_dup_origin () + | +
| +gboolean + | ++ostree_sysroot_upgrader_set_origin () + | +
| +char * + | ++ostree_sysroot_upgrader_get_origin_description () + | +
| +gboolean + | ++ostree_sysroot_upgrader_check_timestamps () + | +
| +gboolean + | ++ostree_sysroot_upgrader_pull () + | +
| +gboolean + | ++ostree_sysroot_upgrader_pull_one_dir () + | +
| +gboolean + | ++ostree_sysroot_upgrader_deploy () + | +
| typedef | +OstreeSysrootUpgrader | +
| enum | +OstreeSysrootUpgraderFlags | +
| enum | +OstreeSysrootUpgraderPullFlags | +
OstreeSysrootUpgrader * +ostree_sysroot_upgrader_new (+ + +OstreeSysroot *sysroot, +GCancellable *cancellable, +GError **error);
OstreeSysrootUpgrader * +ostree_sysroot_upgrader_new_for_os (+OstreeSysroot *sysroot, +const char *osname, +GCancellable *cancellable, +GError **error);
sysroot |
++ | Â | +
osname |
+Operating system name. |
+[allow-none] | +
OstreeSysrootUpgrader * +ostree_sysroot_upgrader_new_for_os_with_flags + (+OstreeSysroot *sysroot, +const char *osname, +OstreeSysrootUpgraderFlags flags, +GCancellable *cancellable, +GError **error);
sysroot |
++ | Â | +
osname |
+Operating system name. |
+[allow-none] | +
flags |
+Flags |
+Â | +
GKeyFile *
+ostree_sysroot_upgrader_get_origin (OstreeSysrootUpgrader *self);
+
+
+GKeyFile *
+ostree_sysroot_upgrader_dup_origin (OstreeSysrootUpgrader *self);
+
+
+gboolean +ostree_sysroot_upgrader_set_origin (+OstreeSysrootUpgrader *self, +GKeyFile *origin, +GCancellable *cancellable, +GError **error);
Replace the origin with origin
+.
self |
+Sysroot |
+Â | +
origin |
+The new origin. |
+[allow-none] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
char *
+ostree_sysroot_upgrader_get_origin_description
+ (OstreeSysrootUpgrader *self);
+
+
+gboolean +ostree_sysroot_upgrader_check_timestamps + (+OstreeRepo *repo, +const char *from_rev, +const char *to_rev, +GError **error);
Check that the timestamp on to_rev
+ is equal to or newer than
+from_rev
+. This protects systems against man-in-the-middle
+attackers which provide a client with an older commit.
gboolean +ostree_sysroot_upgrader_pull (+OstreeSysrootUpgrader *self, +OstreeRepoPullFlags flags, +OstreeSysrootUpgraderPullFlags upgrader_flags, +OstreeAsyncProgress *progress, +gboolean *out_changed, +GCancellable *cancellable, +GError **error);
Perform a pull from the origin. First check if the ref has
+changed, if so download the linked objects, and store the updated
+ref locally. Then out_changed
+ will be TRUE.
If the origin remote is unchanged, out_changed
+ will be set to
+FALSE.
self |
+Upgrader |
+Â | +
flags |
+Flags controlling pull behavior |
+Â | +
upgrader_flags |
+Flags controlling upgrader behavior |
+Â | +
progress |
+Progress. |
+[allow-none] | +
out_changed |
+Whether or not the origin changed. |
+[out] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
gboolean +ostree_sysroot_upgrader_pull_one_dir (+OstreeSysrootUpgrader *self, +const char *dir_to_pull, +OstreeRepoPullFlags flags, +OstreeSysrootUpgraderPullFlags upgrader_flags, +OstreeAsyncProgress *progress, +gboolean *out_changed, +GCancellable *cancellable, +GError **error);
Like ostree_sysroot_upgrader_pull(), but allows retrieving just a
+subpath of the tree. This can be used to download metadata files
+from inside the tree such as package databases.
gboolean +ostree_sysroot_upgrader_deploy (+OstreeSysrootUpgrader *self, +GCancellable *cancellable, +GError **error);
Write the new deployment to disk, perform a configuration merge +with /etc, and update the bootloader configuration.
+ +| +Top + | +
| +OstreeBootconfigParser * + | ++ostree_bootconfig_parser_new () + | +
| +OstreeBootconfigParser * + | ++ostree_bootconfig_parser_clone () + | +
| +gboolean + | ++ostree_bootconfig_parser_parse () + | +
| +gboolean + | ++ostree_bootconfig_parser_parse_at () + | +
| +gboolean + | ++ostree_bootconfig_parser_write () + | +
| +gboolean + | ++ostree_bootconfig_parser_write_at () + | +
| +void + | ++ostree_bootconfig_parser_set () + | +
| const char * + | ++ostree_bootconfig_parser_get () + | +
OstreeBootconfigParser *
+ostree_bootconfig_parser_new (void);
+OstreeBootconfigParser *
+ostree_bootconfig_parser_clone (OstreeBootconfigParser *self);
+
+
+gboolean +ostree_bootconfig_parser_parse (+OstreeBootconfigParser *self, +GFile *path, +GCancellable *cancellable, +GError **error);
gboolean +ostree_bootconfig_parser_parse_at (+OstreeBootconfigParser *self, +int dfd, +const char *path, +GCancellable *cancellable, +GError **error);
Initialize a bootconfig from the given file.
+ +gboolean +ostree_bootconfig_parser_write (+OstreeBootconfigParser *self, +GFile *output, +GCancellable *cancellable, +GError **error);
gboolean +ostree_bootconfig_parser_write_at (+OstreeBootconfigParser *self, +int dfd, +const char *path, +GCancellable *cancellable, +GError **error);
void +ostree_bootconfig_parser_set (+OstreeBootconfigParser *self, +const char *key, +const char *value);
const char * +ostree_bootconfig_parser_get (+OstreeBootconfigParser *self, +const char *key);
| +Top + | +
OstreeChainInputStream *
+ostree_chain_input_stream_new (GPtrArray *streams);
+| +Top + | +
| +OstreeChecksumInputStream * + | ++ostree_checksum_input_stream_new () + | +
OstreeChecksumInputStream * +ostree_checksum_input_stream_new (+GInputStream *stream, +GChecksum *checksum);
| +Top + | +
gboolean +ostree_deployment_equal (+ + +gconstpointer ap, +gconstpointer bp);
OstreeDeployment * +ostree_deployment_new (+int index, +const char *osname, +const char *csum, +int deployserial, +const char *bootcsum, +int bootserial);
const char *
+ostree_deployment_get_osname (OstreeDeployment *self);
+int
+ostree_deployment_get_deployserial (OstreeDeployment *self);
+const char *
+ostree_deployment_get_csum (OstreeDeployment *self);
+const char *
+ostree_deployment_get_bootcsum (OstreeDeployment *self);
+int
+ostree_deployment_get_bootserial (OstreeDeployment *self);
+OstreeBootconfigParser *
+ostree_deployment_get_bootconfig (OstreeDeployment *self);
+
+
+GKeyFile *
+ostree_deployment_get_origin (OstreeDeployment *self);
+
+
+char *
+ostree_deployment_get_origin_relpath (OstreeDeployment *self);
+Note this function only returns a *relative* path - if you want to
+access, it, you must either use fd-relative api such as openat(),
+or concatenate it with the full ostree_sysroot_get_path().
OstreeDeploymentUnlockedState
+ostree_deployment_get_unlocked (OstreeDeployment *self);
+void +ostree_deployment_set_index (+OstreeDeployment *self, +int index);
void +ostree_deployment_set_bootserial (+OstreeDeployment *self, +int index);
void +ostree_deployment_set_bootconfig (+OstreeDeployment *self, +OstreeBootconfigParser *bootconfig);
void +ostree_deployment_set_origin (+OstreeDeployment *self, +GKeyFile *origin);
OstreeDeployment *
+ostree_deployment_clone (OstreeDeployment *self);
+
+
+typedef struct {
+ GObject parent_instance;
+
+ int index;
+ char *osname;
+ char *csum;
+ int deployserial;
+ char *bootcsum;
+ int bootserial;
+ OstreeBootconfigParser *bootconfig;
+ GKeyFile *origin;
+ OstreeDeploymentUnlockedState unlocked;
+} OstreeDeployment;
+
+| + | Global offset |
+Â | +
| + | Â | +Â | +
| + | OSTree checksum of tree |
+Â | +
| + | How many times this particular csum appears in deployment list |
+Â | +
| + | Checksum of kernel+initramfs |
+Â | +
| + | An integer assigned to this tree per its ${bootcsum} |
+Â | +
OstreeBootconfigParser * |
+Bootloader configuration |
+Â | +
| + | How to construct an upgraded version of this tree |
+Â | +
| + | The unlocked state |
+Â | +
| +Top + | +
| +OstreeDiffItem * + | ++ostree_diff_item_ref () + | +
| +void + | ++ostree_diff_item_unref () + | +
| +gboolean + | ++ostree_diff_dirs () + | +
| +void + | ++ostree_diff_print () + | +
gboolean +ostree_diff_dirs (+OstreeDiffFlags flags, +GFile *a, +GFile *b, +GPtrArray *modified, +GPtrArray *removed, +GPtrArray *added, +GCancellable *cancellable, +GError **error);
Compute the difference between directory a
+ and b
+ as 3 separate
+sets of OstreeDiffItem in modified
+, removed
+, and added
+.
flags |
+Flags |
+Â | +
a |
+First directory path, or |
+Â | +
b |
+First directory path |
+Â | +
modified |
+Modified files. |
+[element-type OstreeDiffItem] | +
removed |
+Removed files. |
+[element-type Gio.File] | +
added |
+Added files. |
+[element-type Gio.File] | +
cancellable |
+Cancellable |
+Â | +
error |
+Error |
+Â | +
void +ostree_diff_print (+GFile *a, +GFile *b, +GPtrArray *modified, +GPtrArray *removed, +GPtrArray *added);
Print the contents of a diff to stdout.
+a |
+First directory path |
+Â | +
b |
+First directory path |
+Â | +
modified |
+Modified files. |
+[element-type OstreeDiffItem] | +
removed |
+Removed files. |
+[element-type Gio.File] | +
added |
+Added files. |
+[element-type Gio.File] | +
| +Top + | +
| +gboolean + | ++ostree_repo_file_ensure_resolved () + | +
| +gboolean + | ++ostree_repo_file_get_xattrs () + | +
| +OstreeRepo * + | ++ostree_repo_file_get_repo () + | +
| +OstreeRepoFile * + | ++ostree_repo_file_get_root () + | +
| +void + | ++ostree_repo_file_tree_set_metadata () + | +
| const char * + | ++ostree_repo_file_tree_get_contents_checksum () + | +
| const char * + | ++ostree_repo_file_tree_get_metadata_checksum () + | +
| +GVariant * + | ++ostree_repo_file_tree_get_contents () + | +
| +GVariant * + | ++ostree_repo_file_tree_get_metadata () + | +
| const char * + | ++ostree_repo_file_get_checksum () + | +
| +int + | ++ostree_repo_file_tree_find_child () + | +
| +gboolean + | ++ostree_repo_file_tree_query_child () + | +
gboolean +ostree_repo_file_ensure_resolved (+OstreeRepoFile *self, +GError **error);
gboolean +ostree_repo_file_get_xattrs (+OstreeRepoFile *self, +GVariant **out_xattrs, +GCancellable *cancellable, +GError **error);
OstreeRepo *
+ostree_repo_file_get_repo (OstreeRepoFile *self);
+
+OstreeRepoFile *
+ostree_repo_file_get_root (OstreeRepoFile *self);
+
+void +ostree_repo_file_tree_set_metadata (+OstreeRepoFile *self, +const char *checksum, +GVariant *metadata);
const char *
+ostree_repo_file_tree_get_contents_checksum
+ (OstreeRepoFile *self);
+const char *
+ostree_repo_file_tree_get_metadata_checksum
+ (OstreeRepoFile *self);
+GVariant *
+ostree_repo_file_tree_get_contents (OstreeRepoFile *self);
+GVariant *
+ostree_repo_file_tree_get_metadata (OstreeRepoFile *self);
+const char *
+ostree_repo_file_get_checksum (OstreeRepoFile *self);
+int +ostree_repo_file_tree_find_child (+OstreeRepoFile *self, +const char *name, +gboolean *is_dir, +GVariant **out_container);
gboolean +ostree_repo_file_tree_query_child (+OstreeRepoFile *self, +int n, +const char *attributes, +GFileQueryInfoFlags flags, +GFileInfo **out_info, +GCancellable *cancellable, +GError **error);
| + |