![]() |
![]() |
![]() |
OSTree Manual | ![]() |
---|---|---|---|---|
Top | Description |
Content-addressed object storeContent-addressed object store — A git-like storage system for operating system binaries |
typedef OstreeRepo; enum OstreeRepoMode; gboolean ostree_repo_mode_from_string (const char *mode
,OstreeRepoMode *out_mode
,GError **error
); OstreeRepo * ostree_repo_new (GFile *path
); OstreeRepo * ostree_repo_new_default (void
); gboolean ostree_repo_open (OstreeRepo *self
,GCancellable *cancellable
,GError **error
); void ostree_repo_set_disable_fsync (OstreeRepo *self
,gboolean disable_fsync
); gboolean ostree_repo_is_system (OstreeRepo *repo
); gboolean ostree_repo_is_writable (OstreeRepo *self
,GError **error
); gboolean ostree_repo_create (OstreeRepo *self
,OstreeRepoMode mode
,GCancellable *cancellable
,GError **error
); GFile * ostree_repo_get_path (OstreeRepo *self
); OstreeRepoMode ostree_repo_get_mode (OstreeRepo *self
); GKeyFile * ostree_repo_get_config (OstreeRepo *self
); GKeyFile * ostree_repo_copy_config (OstreeRepo *self
); gboolean ostree_repo_remote_add (OstreeRepo *self
,const char *name
,const char *url
,GVariant *options
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_remote_delete (OstreeRepo *self
,const char *name
,GCancellable *cancellable
,GError **error
); enum OstreeRepoRemoteChange; gboolean ostree_repo_remote_change (OstreeRepo *self
,GFile *sysroot
,OstreeRepoRemoteChange changeop
,const char *name
,const char *url
,GVariant *options
,GCancellable *cancellable
,GError **error
); char ** ostree_repo_remote_list (OstreeRepo *self
,guint *out_n_remotes
); gboolean ostree_repo_remote_get_url (OstreeRepo *self
,const char *name
,char **out_url
,GError **error
); gboolean ostree_repo_remote_get_gpg_verify (OstreeRepo *self
,const char *name
,gboolean *out_gpg_verify
,GError **error
); OstreeRepo * ostree_repo_get_parent (OstreeRepo *self
); gboolean ostree_repo_write_config (OstreeRepo *self
,GKeyFile *new_config
,GError **error
); struct OstreeRepoTransactionStats; gboolean ostree_repo_scan_hardlinks (OstreeRepo *self
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_prepare_transaction (OstreeRepo *self
,gboolean *out_transaction_resume
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_commit_transaction (OstreeRepo *self
,OstreeRepoTransactionStats *out_stats
,GCancellable *cancellable
,GError **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
); void ostree_repo_transaction_set_ref (OstreeRepo *self
,const char *remote
,const char *ref
,const char *checksum
); gboolean ostree_repo_set_ref_immediate (OstreeRepo *self
,const char *remote
,const char *ref
,const char *checksum
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_has_object (OstreeRepo *self
,OstreeObjectType objtype
,const char *checksum
,gboolean *out_have_object
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_write_metadata (OstreeRepo *self
,OstreeObjectType objtype
,const char *expected_checksum
,GVariant *object
,guchar **out_csum
,GCancellable *cancellable
,GError **error
); void ostree_repo_write_metadata_async (OstreeRepo *self
,OstreeObjectType objtype
,const char *expected_checksum
,GVariant *object
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); 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
); gboolean ostree_repo_write_metadata_trusted (OstreeRepo *self
,OstreeObjectType objtype
,const char *checksum
,GVariant *variant
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_write_metadata_stream_trusted (OstreeRepo *self
,OstreeObjectType objtype
,const char *checksum
,GInputStream *object_input
,guint64 length
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_write_content_trusted (OstreeRepo *self
,const char *checksum
,GInputStream *object_input
,guint64 length
,GCancellable *cancellable
,GError **error
); void ostree_repo_write_content_async (OstreeRepo *self
,const char *expected_checksum
,GInputStream *object
,guint64 length
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean ostree_repo_write_content_finish (OstreeRepo *self
,GAsyncResult *result
,guchar **out_csum
,GError **error
); gboolean ostree_repo_resolve_rev (OstreeRepo *self
,const char *refspec
,gboolean allow_noent
,char **out_rev
,GError **error
); gboolean ostree_repo_list_refs (OstreeRepo *self
,const char *refspec_prefix
,GHashTable **out_all_refs
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_load_variant (OstreeRepo *self
,OstreeObjectType objtype
,const char *sha256
,GVariant **out_variant
,GError **error
); gboolean ostree_repo_load_variant_if_exists (OstreeRepo *self
,OstreeObjectType objtype
,const char *sha256
,GVariant **out_variant
,GError **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
); gboolean ostree_repo_load_object_stream (OstreeRepo *self
,OstreeObjectType objtype
,const char *checksum
,GInputStream **out_input
,guint64 *out_size
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_query_object_storage_size (OstreeRepo *self
,OstreeObjectType objtype
,const char *sha256
,guint64 *out_size
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_import_object_from (OstreeRepo *self
,OstreeRepo *source
,OstreeObjectType objtype
,const char *checksum
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_delete_object (OstreeRepo *self
,OstreeObjectType objtype
,const char *sha256
,GCancellable *cancellable
,GError **error
); enum OstreeRepoCommitFilterResult; OstreeRepoCommitFilterResult (*OstreeRepoCommitFilter) (OstreeRepo *repo
,const char *path
,GFileInfo *file_info
,gpointer user_data
); typedef OstreeRepoCommitModifier; enum OstreeRepoCommitModifierFlags; OstreeRepoCommitModifier * ostree_repo_commit_modifier_new (OstreeRepoCommitModifierFlags flags
,OstreeRepoCommitFilter commit_filter
,gpointer user_data
,GDestroyNotify destroy_notify
); 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
); void ostree_repo_commit_modifier_set_sepolicy (OstreeRepoCommitModifier *modifier
,OstreeSePolicy *sepolicy
); OstreeRepoCommitModifier * ostree_repo_commit_modifier_ref (OstreeRepoCommitModifier *modifier
); void ostree_repo_commit_modifier_unref (OstreeRepoCommitModifier *modifier
); gboolean ostree_repo_write_directory_to_mtree (OstreeRepo *self
,GFile *dir
,OstreeMutableTree *mtree
,OstreeRepoCommitModifier *modifier
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_write_archive_to_mtree (OstreeRepo *self
,GFile *archive
,OstreeMutableTree *mtree
,OstreeRepoCommitModifier *modifier
,gboolean autocreate_parents
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_write_mtree (OstreeRepo *self
,OstreeMutableTree *mtree
,GFile **out_file
,GCancellable *cancellable
,GError **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
); gboolean ostree_repo_read_commit_detached_metadata (OstreeRepo *self
,const char *checksum
,GVariant **out_metadata
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_write_commit_detached_metadata (OstreeRepo *self
,const char *checksum
,GVariant *metadata
,GCancellable *cancellable
,GError **error
); enum OstreeRepoCheckoutMode; enum OstreeRepoCheckoutOverwriteMode; gboolean ostree_repo_checkout_tree (OstreeRepo *self
,OstreeRepoCheckoutMode mode
,OstreeRepoCheckoutOverwriteMode overwrite_mode
,GFile *destination
,OstreeRepoFile *source
,GFileInfo *source_info
,GCancellable *cancellable
,GError **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
); gboolean ostree_repo_checkout_gc (OstreeRepo *self
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_read_commit (OstreeRepo *self
,const char *ref
,GFile **out_root
,char **out_commit
,GCancellable *cancellable
,GError **error
); enum OstreeRepoListObjectsFlags; #define OSTREE_REPO_LIST_OBJECTS_VARIANT_TYPE gboolean ostree_repo_list_objects (OstreeRepo *self
,OstreeRepoListObjectsFlags flags
,GHashTable **out_objects
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_list_commit_objects_starting_with (OstreeRepo *self
,const char *start
,GHashTable **out_commits
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_list_static_delta_names (OstreeRepo *self
,GPtrArray **out_deltas
,GCancellable *cancellable
,GError **error
); enum OstreeStaticDeltaGenerateOpt; gboolean ostree_repo_static_delta_generate (OstreeRepo *self
,OstreeStaticDeltaGenerateOpt opt
,const char *from
,const char *to
,GVariant *metadata
,GVariant *params
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_static_delta_execute_offline (OstreeRepo *self
,GFile *dir
,gboolean skip_validation
,GCancellable *cancellable
,GError **error
); GHashTable * ostree_repo_traverse_new_reachable (void
); gboolean ostree_repo_traverse_commit (OstreeRepo *repo
,const char *commit_checksum
,int maxdepth
,GHashTable **out_reachable
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_traverse_commit_union (OstreeRepo *repo
,const char *commit_checksum
,int maxdepth
,GHashTable *inout_reachable
,GCancellable *cancellable
,GError **error
); enum OstreeRepoPruneFlags; 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
); enum OstreeRepoPullFlags; gboolean ostree_repo_pull (OstreeRepo *self
,const char *remote_name
,char **refs_to_fetch
,OstreeRepoPullFlags flags
,OstreeAsyncProgress *progress
,GCancellable *cancellable
,GError **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
); gboolean ostree_repo_pull_with_options (OstreeRepo *self
,const char *remote_name
,GVariant *options
,OstreeAsyncProgress *progress
,GCancellable *cancellable
,GError **error
); void ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
,gpointer user_data
); gboolean ostree_repo_sign_commit (OstreeRepo *self
,const gchar *commit_checksum
,const gchar *key_id
,const gchar *homedir
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_append_gpg_signature (OstreeRepo *self
,const gchar *commit_checksum
,GBytes *signature_bytes
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_verify_commit (OstreeRepo *self
,const gchar *commit_checksum
,GFile *keyringdir
,GFile *extra_keyring
,GCancellable *cancellable
,GError **error
); OstreeGpgVerifyResult * ostree_repo_verify_commit_ext (OstreeRepo *self
,const gchar *commit_checksum
,GFile *keyringdir
,GFile *extra_keyring
,GCancellable *cancellable
,GError **error
); gboolean ostree_repo_regenerate_summary (OstreeRepo *self
,GVariant *additional_metadata
,GCancellable *cancellable
,GError **error
);
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()
.
typedef enum { OSTREE_REPO_MODE_BARE, OSTREE_REPO_MODE_ARCHIVE_Z2, OSTREE_REPO_MODE_BARE_USER } OstreeRepoMode;
See the documentation of OstreeRepo for more information about the possible modes.
gboolean ostree_repo_mode_from_string (const char *mode
,OstreeRepoMode *out_mode
,GError **error
);
OstreeRepo * ostree_repo_new (GFile *path
);
|
Path to a repository |
Returns : |
An accessor object for an OSTree repository located at path . [transfer full]
|
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.
Returns : |
An accessor object for an OSTree repository located at /ostree/repo. [transfer full] |
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.
|
An OstreeRepo |
|
If TRUE , do not fsync |
gboolean ostree_repo_is_system (OstreeRepo *repo
);
|
Repository |
Returns : |
TRUE if this repository is the root-owned system global repository |
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.
|
Repo |
|
a GError |
Returns : |
TRUE if this repository is writable |
gboolean ostree_repo_create (OstreeRepo *self
,OstreeRepoMode mode
,GCancellable *cancellable
,GError **error
);
Create the underlying structure on disk for the repository.
|
An OstreeRepo |
|
The mode to store the repository in |
|
Cancellable |
|
Error |
GFile * ostree_repo_get_path (OstreeRepo *self
);
Returns : |
Path to repo. [transfer none] |
GKeyFile * ostree_repo_get_config (OstreeRepo *self
);
Returns : |
The repository configuration; do not modify. [transfer none] |
GKeyFile * ostree_repo_copy_config (OstreeRepo *self
);
Returns : |
A newly-allocated copy of the repository config. [transfer full] |
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()
|
Repo |
|
Name of remote |
|
URL for remote (if URL begins with metalink=, it will be used as such) |
|
GVariant of type a{sv}. [allow-none] |
|
Cancellable |
|
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.
|
Repo |
|
Name of remote |
|
Cancellable |
|
Error |
typedef enum { OSTREE_REPO_REMOTE_CHANGE_ADD, OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS, OSTREE_REPO_REMOTE_CHANGE_DELETE, OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS } OstreeRepoRemoteChange;
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.
|
Repo |
|
System root. [allow-none] |
|
Operation to perform |
|
Name of remote |
|
URL for remote (if URL begins with metalink=, it will be used as such) |
|
GVariant of type a{sv}. [allow-none] |
|
Cancellable |
|
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
.
|
Repo |
|
Number of remotes available. [out][allow-none] |
Returns : |
a NULL -terminated
array of remote names. [array length=out_n_remotes][transfer full]
|
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.
|
Repo |
|
Name of remote |
|
Remote's URL. [out][allow-none] |
|
Error |
Returns : |
TRUE on success, FALSE on failure |
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.
|
Repo |
|
Name of remote |
|
Remote's GPG option. [out][allow-none] |
|
Error |
Returns : |
TRUE on success, FALSE on failure |
OstreeRepo * ostree_repo_get_parent (OstreeRepo *self
);
Before this function can be used, ostree_repo_init()
must have been
called.
|
Repo |
Returns : |
Parent repository, or NULL if none. [transfer none]
|
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.
|
Repo |
|
Overwrite the config file with this data. Do not change later! |
|
a GError |
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. | |
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.
|
An OstreeRepo |
|
Cancellable |
|
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.
|
An OstreeRepo |
|
Whether this transaction is resuming from a previous one. [allow-none][out] |
|
Cancellable |
|
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.
|
An OstreeRepo |
|
A set of statistics of things that happened during this transaction. [allow-none][out] |
|
Cancellable |
|
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.
|
An OstreeRepo |
|
The refspec to write |
|
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_complete_transaction()
. If the transaction
is instead aborted with ostree_repo_abort_transaction()
, no changes will
be made to the repository.
|
An OstreeRepo |
|
A remote for the ref. [allow-none] |
|
The ref to write |
|
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.
|
An OstreeRepo |
|
A remote for the ref. [allow-none] |
|
The ref to write |
|
The checksum to point it to, or NULL to unset. [allow-none]
|
|
GCancellable |
|
GError |
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.
|
Repo |
|
Object type |
|
ASCII SHA256 checksum |
|
TRUE if repository contains object. [out]
|
|
Cancellable |
|
Error |
Returns : |
FALSE if an unexpected error occurred, TRUE otherwise |
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.
|
Repo |
|
Object type |
|
If provided, validate content against this checksum. [allow-none] |
|
Metadata |
|
Binary checksum. [out][array fixed-size=32][allow-none] |
|
Cancellable |
|
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.
|
Repo |
|
Object type |
|
If provided, validate content against this checksum. [allow-none] |
|
Metadata |
|
Cancellable |
|
Invoked when metadata is writed |
|
Data for callback
|
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
.
|
Repo |
|
If provided, validate content against this checksum. [allow-none] |
|
Content object stream |
|
Length of object_input
|
|
Binary checksum. [out][array fixed-size=32][allow-none] |
|
Cancellable |
|
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.
|
Repo |
|
Object type |
|
Store object with this ASCII SHA256 checksum |
|
Metadata object |
|
Cancellable |
|
Error |
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.
|
Repo |
|
Object type |
|
Store object with this ASCII SHA256 checksum |
|
Metadata object stream |
|
Length, may be 0 for unknown |
|
Cancellable |
|
Error |
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.
|
Repo |
|
Store content using this ASCII SHA256 checksum |
|
Content stream |
|
Length of object_input
|
|
Cancellable |
|
Data for callback
|
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.
|
Repo |
|
If provided, validate content against this checksum. [allow-none] |
|
Input |
|
Length of object
|
|
Cancellable |
|
Invoked when content is writed |
|
User data for callback
|
gboolean ostree_repo_write_content_finish (OstreeRepo *self
,GAsyncResult *result
,guchar **out_csum
,GError **error
);
Completes an invocation of ostree_repo_write_content_async()
.
|
a OstreeRepo |
|
a GAsyncResult |
|
A binary SHA256 checksum of the content object. [out][transfer full] |
|
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
.
|
Repo |
|
A refspec |
|
Do not throw an error if refspec does not exist |
|
A checksum,or NULL if allow_noent is true and it does not exist. [out][transfer full]
|
|
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.
|
Repo |
|
Only list refs which match this prefix. [allow-none] |
|
Mapping from ref to checksum. [out][element-type utf8 utf8] |
|
Cancellable |
|
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
.
|
Repo |
|
Expected object type |
|
Checksum string |
|
Metadata object. [out][transfer full] |
|
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.
|
Repo |
|
Object type |
|
ASCII checksum |
|
Metadata. [out][transfer full] |
|
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.
|
Repo |
|
ASCII SHA256 checksum |
|
File content. [out][allow-none] |
|
File information. [out][allow-none] |
|
Extended attributes. [out][allow-none] |
|
Cancellable |
|
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.
|
Repo |
|
Object type |
|
Checksum |
|
Size in bytes object occupies physically. [out] |
|
Cancellable |
|
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.
|
Destination repo |
|
Source repo |
|
Object type |
|
checksum |
|
Cancellable |
|
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.
|
Repo |
|
Object type |
|
Checksum |
|
Cancellable |
|
Error |
typedef enum { OSTREE_REPO_COMMIT_FILTER_ALLOW, OSTREE_REPO_COMMIT_FILTER_SKIP } OstreeRepoCommitFilterResult;
OstreeRepoCommitFilterResult (*OstreeRepoCommitFilter) (OstreeRepo *repo
,const char *path
,GFileInfo *file_info
,gpointer user_data
);
|
Repo |
|
Path to file |
|
File information |
|
User data |
Returns : |
OstreeRepoCommitFilterResult saying whether or not to commit this file |
typedef struct OstreeRepoCommitModifier OstreeRepoCommitModifier;
A structure allowing control over commits.
typedef enum { OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE = 0, OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS = (1 << 0), OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES = (1 << 1) } OstreeRepoCommitModifierFlags;
OstreeRepoCommitModifier * ostree_repo_commit_modifier_new (OstreeRepoCommitModifierFlags flags
,OstreeRepoCommitFilter commit_filter
,gpointer user_data
,GDestroyNotify destroy_notify
);
|
Control options for filter |
|
Function that can inspect individual files. [allow-none] |
|
User data. [allow-none] |
|
A GDestroyNotify |
Returns : |
A new commit modifier. [transfer full] |
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.
|
An OstreeRepoCommitModifier |
|
Function to be invoked, should return extended attributes for path |
|
Destroy notification |
|
Data for callback : |
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.
|
An OstreeRepoCommitModifier |
|
Policy to use for labeling. [allow-none] |
OstreeRepoCommitModifier * ostree_repo_commit_modifier_ref
(OstreeRepoCommitModifier *modifier
);
void ostree_repo_commit_modifier_unref (OstreeRepoCommitModifier *modifier
);
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
.
|
Repo |
|
Path to a directory |
|
Overlay directory contents into this tree |
|
Optional modifier. [allow-none] |
|
Cancellable |
|
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
.
|
An OstreeRepo |
|
A path to an archive file |
|
The OstreeMutableTree to write to |
|
Optional commit modifier. [allow-none] |
|
Autocreate parent directories |
|
Cancellable |
|
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.
|
Repo |
|
Mutable tree |
|
An OstreeRepoFile representing mtree 's root. [out]
|
|
Cancellable |
|
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
.
|
Repo |
|
ASCII SHA256 checksum for parent, or NULL for none. [allow-none]
|
|
Subject |
|
Body. [allow-none] |
|
GVariant of type a{sv}, or NULL for none. [allow-none]
|
|
The tree to point the commit to |
|
Resulting ASCII SHA256 checksum for commit. [out] |
|
Cancellable |
|
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
.
|
Repo |
|
ASCII SHA256 commit checksum |
|
Metadata associated with commit in with format "a{sv}", or NULL if none exists. [out][transfer full]
|
|
Cancellable |
|
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.
|
Repo |
|
ASCII SHA256 commit checksum |
|
Metadata to associate with commit in with format "a{sv}", or NULL to delete. [allow-none]
|
|
Cancellable |
|
Error |
typedef enum { OSTREE_REPO_CHECKOUT_MODE_NONE = 0, OSTREE_REPO_CHECKOUT_MODE_USER = 1 } OstreeRepoCheckoutMode;
typedef enum { OSTREE_REPO_CHECKOUT_OVERWRITE_NONE = 0, OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES = 1 } OstreeRepoCheckoutOverwriteMode;
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.
|
Repo |
|
Options controlling all files |
|
Whether or not to overwrite files |
|
Place tree here |
|
Source tree |
|
Source info |
|
Cancellable |
|
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
);
Similar to ostree_repo_checkout_tree()
, but uses directory-relative
paths for the destination, uses a new `OstreeRepoCheckoutOptions`,
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.
|
Repo |
|
Options. [allow-none] |
|
Directory FD for destination |
|
Directory for destination |
|
Checksum for commit |
|
Cancellable |
|
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.
|
Repo |
|
Cancellable |
|
Error |
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
.
|
Repo |
|
Ref or ASCII checksum |
|
An OstreeRepoFile corresponding to the root. [out] |
|
The resolved commit checksum. [out] |
|
Cancellable |
|
Error |
typedef enum { OSTREE_REPO_LIST_OBJECTS_LOOSE = (1 << 0), OSTREE_REPO_LIST_OBJECTS_PACKED = (1 << 1), OSTREE_REPO_LIST_OBJECTS_ALL = (1 << 2) } OstreeRepoListObjectsFlags;
#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
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
.
|
Repo |
|
Flags controlling enumeration |
|
Map of serialized object name to variant data. [out] |
|
Cancellable |
|
Error |
Returns : |
TRUE on success, FALSE on error, and error will be set |
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
.
|
Repo |
|
List commits starting with this checksum |
|
Array of GVariants |
|
Cancellable |
|
Error |
Returns : |
TRUE on success, FALSE on error, and error will be set |
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
.
|
Repo |
|
String name of deltas (checksum-checksum.delta). [out][element-type utf8] |
|
Cancellable |
|
Error |
typedef enum { OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY, OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR } OstreeStaticDeltaGenerateOpt;
Parameters controlling optimization of static deltas.
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: Minimume uncompressed size in megabytes to use fallback
- max-chunk-size: u: Maximum size in megabytes of a delta part
- compression: y: Compression type: 0=none, x=lzma, g=gzip
- bsdiff-enabled: b: Enable bsdiff compression. Default TRUE.
- verbose: b: Print diagnostic messages. Default FALSE.
|
Repo |
|
High level optimization choice |
|
ASCII SHA256 checksum of origin, or NULL
|
|
ASCII SHA256 checksum of target |
|
Optional metadata. [allow-none] |
|
Parameters, see below. [allow-none] |
|
Cancellable |
|
Error |
gboolean ostree_repo_static_delta_execute_offline (OstreeRepo *self
,GFile *dir
,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.
|
Repo |
|
Path to a directory containing static delta data |
|
If TRUE , assume data integrity |
|
Cancellable |
|
Error |
GHashTable * ostree_repo_traverse_new_reachable (void
);
This hash table is a set of GVariant which can be accessed via
ostree_object_name_deserialize()
.
Returns : |
A new hash table. [transfer container][element-type GVariant GVariant] |
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 |
|
ASCII SHA256 checksum |
|
Traverse this many parent commits, -1 for unlimited |
|
Set of reachable objects. [out][transfer container][element-type GVariant GVariant] |
|
Cancellable |
|
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.
|
Repo |
|
ASCII SHA256 checksum |
|
Traverse this many parent commits, -1 for unlimited |
|
Set of reachable objects |
|
Cancellable |
|
Error |
typedef enum { OSTREE_REPO_PRUNE_FLAGS_NONE, OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE, OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY } OstreeRepoPruneFlags;
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.
|
Repo |
|
Options controlling prune process |
|
Stop traversal after this many iterations (-1 for unlimited) |
|
Number of objects found. [out] |
|
Number of objects deleted. [out] |
|
Storage size in bytes of objects deleted. [out] |
|
Cancellable |
|
Error |
typedef enum { OSTREE_REPO_PULL_FLAGS_NONE, OSTREE_REPO_PULL_FLAGS_MIRROR } OstreeRepoPullFlags;
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.
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.
|
Repo |
|
Name of remote |
|
Optional list of refs; if NULL , fetch all configured refs. [array zero-terminated=1][element-type utf8][allow-none]
|
|
Options controlling fetch behavior |
|
Progress. [allow-none] |
|
Cancellable |
|
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.
|
Repo |
|
Name of remote |
|
Subdirectory path |
|
Optional list of refs; if NULL , fetch all configured refs. [array zero-terminated=1][element-type utf8][allow-none]
|
|
Options controlling fetch behavior |
|
Progress. [allow-none] |
|
Cancellable |
|
Error |
gboolean ostree_repo_pull_with_options (OstreeRepo *self
,const char *remote_name
,GVariant *options
,OstreeAsyncProgress *progress
,GCancellable *cancellable
,GError **error
);
Like ostree_repo_pull()
, but supports an extensible set of flags.
The following are currently defined:
* subdir (s): Pull just this subdirectory * flags (i): An instance of OstreeRepoPullFlags * refs: (as): Array of string refs * depth: (i): How far in the history to traverse; default is 0, -1 means infinite
|
Repo |
|
Name of remote |
|
A GVariant a{sv} with an extensible set of flags. |
|
Progress. [allow-none] |
|
Cancellable |
|
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.
|
Async progress |
|
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 |
|
SHA256 of given commit to sign |
|
Use this GPG key id |
|
GPG home directory, or NULL . [allow-none]
|
|
A GCancellable |
|
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.
|
Self |
|
SHA256 of given commit to sign |
|
Signature data |
|
A GCancellable |
|
a GError |
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
.
|
Repository |
|
ASCII SHA256 checksum |
|
Path to directory GPG keyrings; overrides built-in default if given. [allow-none] |
|
Path to additional keyring file (not a directory). [allow-none] |
|
Cancellable |
|
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.
|
Repository |
|
ASCII SHA256 checksum |
|
Path to directory GPG keyrings; overrides built-in default if given. [allow-none] |
|
Path to additional keyring file (not a directory). [allow-none] |
|
Cancellable |
|
Error |
Returns : |
an OstreeGpgVerifyResult, or NULL on error. [transfer full]
|
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.
|
Repo |
|
A GVariant of type a{sv}, or NULL . [allow-none]
|
|
Cancellable |
|
Error |