Part of cleaning up our usage of libglnx; we want to use what's in GLib where we
can.
Had to change a few .c files to `#include ostree.h` early on to pick up
autoptrs for the core types.
Closes: #1040
Approved by: jlebon
GError **error);
gboolean (* is_atomic) (OstreeBootloader *self);
};
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeBootloader, g_object_unref)
GType _ostree_bootloader_get_type (void) G_GNUC_CONST;
#include "config.h"
+#include "ostree.h"
#include "ostree-deployment-private.h"
#include "libglnx.h"
OstreeDeployment *
ostree_deployment_clone (OstreeDeployment *self)
{
- glnx_unref_object OstreeBootconfigParser *new_bootconfig = NULL;
+ g_autoptr(OstreeBootconfigParser) new_bootconfig = NULL;
OstreeDeployment *ret = ostree_deployment_new (self->index, self->osname, self->csum,
self->deployserial,
self->bootcsum, self->bootserial);
const char *cert_and_key_path = data; /* str\0str\0 in one malloc buf */
const char *cert_path = cert_and_key_path;
const char *key_path = cert_and_key_path + strlen (cert_and_key_path) + 1;
- glnx_unref_object OstreeTlsCertInteraction *interaction = NULL;
+ g_autoptr(OstreeTlsCertInteraction) interaction = NULL;
/* The GTlsInteraction instance must be created in the
* session thread so it uses the correct GMainContext. */
{
GObjectClass parent_class;
};
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMetalink, g_object_unref)
GType _ostree_metalink_get_type (void) G_GNUC_CONST;
#include "config.h"
-#include "ostree-mutable-tree.h"
+#include "ostree.h"
#include "otutil.h"
-#include "ostree-core.h"
/**
* SECTION:ostree-mutable-tree
GError **error)
{
gboolean ret = FALSE;
- glnx_unref_object OstreeMutableTree *ret_dir = NULL;
+ g_autoptr(OstreeMutableTree) ret_dir = NULL;
g_return_val_if_fail (name != NULL, FALSE);
GError **error)
{
gboolean ret = FALSE;
- glnx_unref_object OstreeMutableTree *ret_subdir = NULL;
+ g_autoptr(OstreeMutableTree) ret_subdir = NULL;
g_autofree char *ret_file_checksum = NULL;
ret_subdir = ot_gobject_refz (g_hash_table_lookup (self->subdirs, name));
gboolean ret = FALSE;
int i;
OstreeMutableTree *subdir = self; /* nofree */
- glnx_unref_object OstreeMutableTree *ret_parent = NULL;
+ g_autoptr(OstreeMutableTree) ret_parent = NULL;
g_assert (metadata_checksum != NULL);
#include <gio/gfiledescriptorbased.h>
#include <gio/gunixinputstream.h>
#include <gio/gunixoutputstream.h>
-#include "otutil.h"
+#include <sys/xattr.h>
+#include <glib/gprintf.h>
+#include "ostree.h"
#include "ostree-core-private.h"
#include "ostree-repo-private.h"
#include "ostree-repo-file-enumerator.h"
#include "ostree-checksum-input-stream.h"
-#include "ostree-mutable-tree.h"
#include "ostree-varint.h"
-#include <sys/xattr.h>
-#include <glib/gprintf.h>
+#include "otutil.h"
gboolean
_ostree_repo_ensure_loose_objdir_at (int dfd,
{
g_autoptr(GFile) child = NULL;
g_autoptr(GFileInfo) modified_info = NULL;
- glnx_unref_object OstreeMutableTree *child_mtree = NULL;
+ g_autoptr(OstreeMutableTree) child_mtree = NULL;
g_autofree char *child_relpath = NULL;
const char *name;
GFileType file_type;
#include "config.h"
+#include "ostree.h"
#include "ostree-core-private.h"
#include "ostree-repo-private.h"
-#include "ostree-repo-file.h"
-#include "ostree-mutable-tree.h"
#ifdef HAVE_LIBARCHIVE
#include <archive.h>
GCancellable *cancellable,
GError **error)
{
- glnx_unref_object OstreeMutableTree *dir = NULL;
+ g_autoptr(OstreeMutableTree) dir = NULL;
g_autofree guchar *csum_raw = NULL;
g_autofree char *csum = NULL;
GError **error)
{
g_autofree char *fullpath = NULL;
- glnx_unref_object OstreeMutableTree *dir = NULL;
+ g_autoptr(OstreeMutableTree) dir = NULL;
/* start with the root itself */
if (!aic_ensure_parent_dir (ctx, ctx->root, "/", &dir, cancellable, error))
GError **error)
{
g_autoptr(GFileInfo) fi = NULL;
- glnx_unref_object OstreeMutableTree *parent = NULL;
+ g_autoptr(OstreeMutableTree) parent = NULL;
g_autofree char *path = aic_get_final_entry_pathname (ctx, error);
if (path == NULL)
const char *name = glnx_basename (target);
const char *name_dh = glnx_basename (dh->path);
g_autoptr(GPtrArray) components = NULL;
- glnx_unref_object OstreeMutableTree *parent = NULL;
+ g_autoptr(OstreeMutableTree) parent = NULL;
if (!ostree_mutable_tree_lookup (dh->parent, name_dh, &csum, NULL, error))
return FALSE;
{
g_autofree char *csum = NULL;
const char *name = glnx_basename (target);
- glnx_unref_object OstreeMutableTree *parent = NULL;
- glnx_unref_object OstreeMutableTree *subdir = NULL;
+ g_autoptr(OstreeMutableTree) parent = NULL;
+ g_autoptr(OstreeMutableTree) subdir = NULL;
g_autoptr(GPtrArray) components = NULL;
if (!ot_util_path_split_validate (target, &components, error))
{
if (pull_data->gpg_verify)
{
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
g_autoptr(GBytes) signed_data = g_variant_get_data_as_bytes (commit);
if (!detached_metadata)
if (pull_data->gpg_verify)
{
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
result = ostree_repo_verify_commit_for_remote (pull_data->repo,
checksum,
if (is_metalink)
{
- glnx_unref_object OstreeMetalink *metalink = NULL;
+ g_autoptr(OstreeMetalink) metalink = NULL;
GError *local_error = NULL;
/* the metalink uri is buried in the mirrorlist as the first (and only)
GCancellable *cancellable,
GError **error)
{
- glnx_unref_object OstreeFetcher *fetcher = NULL;
+ g_autoptr(OstreeFetcher) fetcher = NULL;
g_autoptr(GMainContext) mainctx = NULL;
gboolean ret = FALSE;
gboolean from_cache = FALSE;
g_autoptr(GHashTable) requested_refs_to_fetch = NULL; /* (element-type OstreeCollectionRef utf8) */
g_autoptr(GHashTable) commits_to_fetch = NULL;
g_autofree char *remote_mode_str = NULL;
- glnx_unref_object OstreeMetalink *metalink = NULL;
+ g_autoptr(OstreeMetalink) metalink = NULL;
OtPullData pull_data_real = { 0, };
OtPullData *pull_data = &pull_data_real;
GKeyFile *remote_config = NULL;
&error))
goto error;
- glnx_unref_object OstreeGpgVerifyResult *verify_result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) verify_result = NULL;
verify_result = ostree_repo_verify_commit_for_remote (self,
commit_metadata->checksum,
/* Verify any summary signatures. */
if (gpg_verify_summary && summary != NULL && signatures != NULL)
{
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
result = ostree_repo_verify_summary (self,
name,
* check if the commit has already been signed with the given key ID.
* We want to avoid storing duplicate signatures in the metadata. */
g_autoptr(GError) local_error = NULL;
- glnx_unref_object OstreeGpgVerifyResult *result
+ g_autoptr(OstreeGpgVerifyResult) result
=_ostree_repo_gpg_verify_with_metadata (self, commit_data, old_metadata,
NULL, NULL, NULL,
cancellable, &local_error);
GCancellable *cancellable,
GError **error)
{
- glnx_unref_object OstreeGpgVerifier *verifier = NULL;
+ g_autoptr(OstreeGpgVerifier) verifier = NULL;
gboolean add_global_keyring_dir = TRUE;
verifier = _ostree_gpg_verifier_new ();
GCancellable *cancellable,
GError **error)
{
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
result = ostree_repo_verify_commit_ext (self, commit_checksum,
keyringdir, extra_keyring,
#include <systemd/sd-journal.h>
#endif
+#include "ostree.h"
#include "ostree-sysroot-private.h"
#include "ostree-sepolicy-private.h"
#include "ostree-deployment-private.h"
GCancellable *cancellable,
GError **error)
{
- glnx_unref_object OstreeSePolicy *sepolicy = NULL;
+ g_autoptr(OstreeSePolicy) sepolicy = NULL;
if (previous_deployment)
{
gboolean bootloader_is_atomic = FALSE;
gboolean boot_was_ro_mount = FALSE;
SyncStats syncstats = { 0, };
- glnx_unref_object OstreeBootloader *bootloader = NULL;
+ g_autoptr(OstreeBootloader) bootloader = NULL;
g_assert (self->loaded);
{
int new_bootversion = self->bootversion ? 0 : 1;
g_autofree char* new_loader_entries_dir = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean show_osname = FALSE;
if (self->booted_deployment)
return FALSE;
OstreeRepo *repo = ostree_sysroot_repo (self);
- glnx_unref_object OstreeDeployment *merge_deployment = NULL;
+ g_autoptr(OstreeDeployment) merge_deployment = NULL;
if (provided_merge_deployment != NULL)
merge_deployment = g_object_ref (provided_merge_deployment);
return FALSE;
g_autofree char *new_bootcsum = NULL;
- glnx_unref_object OstreeDeployment *new_deployment =
+ g_autoptr(OstreeDeployment) new_deployment =
ostree_deployment_new (0, osname, revision, new_deployserial,
new_bootcsum, -1);
ostree_deployment_set_origin (new_deployment, origin);
/* Create an empty boot configuration; we will merge things into
* it as we go.
*/
- glnx_unref_object OstreeBootconfigParser *bootconfig = ostree_bootconfig_parser_new ();
+ g_autoptr(OstreeBootconfigParser) bootconfig = ostree_bootconfig_parser_new ();
ostree_deployment_set_bootconfig (new_deployment, bootconfig);
- glnx_unref_object OstreeSePolicy *sepolicy = NULL;
+ g_autoptr(OstreeSePolicy) sepolicy = NULL;
if (!merge_configuration (self, repo, merge_deployment, new_deployment,
deployment_dfd,
&sepolicy,
{
guint i;
g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
- glnx_unref_object OstreeDeployment *new_deployment = NULL;
+ g_autoptr(OstreeDeployment) new_deployment = NULL;
__attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
g_autofree char *new_options = NULL;
OstreeBootconfigParser *new_bootconfig;
#include <sys/mount.h>
#include <sys/wait.h>
+#include "ostree.h"
#include "ostree-core-private.h"
#include "ostree-repo-private.h"
#include "ostree-sepolicy-private.h"
else
{
g_autoptr(GFile) repo_dir = g_file_resolve_relative_path (self->path, "ostree/repo");
- glnx_unref_object OstreeRepo *repo = ostree_repo_new (repo_dir);
+ g_autoptr(OstreeRepo) repo = ostree_repo_new (repo_dir);
if (!ostree_repo_create (repo, OSTREE_REPO_MODE_BARE,
cancellable, error))
return FALSE;
g_str_has_suffix (dent->d_name, ".conf") &&
S_ISREG (stbuf.st_mode))
{
- glnx_unref_object OstreeBootconfigParser *config = ostree_bootconfig_parser_new ();
+ g_autoptr(OstreeBootconfigParser) config = ostree_bootconfig_parser_new ();
if (!ostree_bootconfig_parser_parse_at (config, dfd_iter.fd, dent->d_name, cancellable, error))
return glnx_prefix_error (error, "Parsing %s", dent->d_name);
cancellable, error))
return FALSE;
- glnx_unref_object OstreeDeployment *ret_deployment
+ g_autoptr(OstreeDeployment) ret_deployment
= ostree_deployment_new (-1, osname, treecsum, deployserial,
bootcsum, treebootserial);
if (origin)
if (ostree_arg == NULL)
return glnx_throw (error, "No ostree= kernel argument found");
- glnx_unref_object OstreeDeployment *deployment = NULL;
+ g_autoptr(OstreeDeployment) deployment = NULL;
if (!parse_deployment (self, ostree_arg, &deployment,
cancellable, error))
return FALSE;
GError **error)
{
gboolean is_active;
- glnx_unref_object OstreeBootloader *ret_loader =
+ g_autoptr(OstreeBootloader) ret_loader =
(OstreeBootloader*)_ostree_bootloader_syslinux_new (sysroot);
if (!_ostree_bootloader_query (ret_loader, &is_active,
cancellable, error))
{
struct stat root_stbuf;
struct stat self_stbuf;
- glnx_unref_object OstreeDeployment *ret_deployment = NULL;
+ g_autoptr(OstreeDeployment) ret_deployment = NULL;
if (stat ("/", &root_stbuf) != 0)
return glnx_throw_errno_prefix (error, "stat /");
{
gboolean ret = FALSE;
__attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
- glnx_unref_object OstreeDeployment *new_deployment = NULL;
+ g_autoptr(OstreeDeployment) new_deployment = NULL;
/* Ensure we have a clean slate */
if (!ostree_sysroot_prepare_cleanup (sysroot, cancellable, error))
GError **error)
{
gboolean ret = FALSE;
- glnx_unref_object OstreeSePolicy *sepolicy = NULL;
+ g_autoptr(OstreeSePolicy) sepolicy = NULL;
OstreeDeploymentUnlockedState current_unlocked =
ostree_deployment_get_unlocked (deployment);
- glnx_unref_object OstreeDeployment *deployment_clone =
+ g_autoptr(OstreeDeployment) deployment_clone =
ostree_deployment_clone (deployment);
- glnx_unref_object OstreeDeployment *merge_deployment = NULL;
+ g_autoptr(OstreeDeployment) merge_deployment = NULL;
GKeyFile *origin_clone = ostree_deployment_get_origin (deployment_clone);
const char hotfix_ovl_options[] = "lowerdir=usr,upperdir=.usr-ovl-upper,workdir=.usr-ovl-work";
const char *ovl_options = NULL;
typedef struct _OstreeTlsCertInteraction OstreeTlsCertInteraction;
typedef struct _OstreeTlsCertInteractionClass OstreeTlsCertInteractionClass;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(OstreeTlsCertInteraction, g_object_unref)
GType _ostree_tls_cert_interaction_get_type (void) G_GNUC_CONST;
ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
gboolean ret = FALSE;
context = g_option_context_new ("Delete untagged deployments and repository objects");
gboolean ret = FALSE;
const char *refspec;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
g_autoptr(GKeyFile) origin = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
- glnx_unref_object OstreeDeployment *new_deployment = NULL;
- glnx_unref_object OstreeDeployment *merge_deployment = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
+ g_autoptr(OstreeDeployment) new_deployment = NULL;
+ g_autoptr(OstreeDeployment) merge_deployment = NULL;
g_autofree char *revision = NULL;
__attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
gboolean ret = FALSE;
- glnx_unref_object OstreeDeployment *deployment = NULL;
+ g_autoptr(OstreeDeployment) deployment = NULL;
g_autoptr(GFile) deployment_dir = NULL;
g_autoptr(GPtrArray) modified = NULL;
g_autoptr(GPtrArray) removed = NULL;
ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
gboolean ret = FALSE;
glnx_fd_close int root_dfd = -1;
- glnx_unref_object OstreeSysroot *target_sysroot = NULL;
+ g_autoptr(OstreeSysroot) target_sysroot = NULL;
guint i;
const char *normal_toplevels[] = {"boot", "dev", "home", "proc", "run", "sys"};
ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
gboolean ret = FALSE;
const char *osname = NULL;
const char *remotename = NULL;
const char *url = NULL;
const char *branch = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
- glnx_unref_object OstreeDeployment *target_deployment = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
+ g_autoptr(OstreeDeployment) target_deployment = NULL;
context = g_option_context_new ("REMOTENAME URL [BRANCH]");
ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
gboolean ret = FALSE;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
OstreeDeployment *booted_deployment = NULL;
g_autoptr(OstreeDeployment) pending_deployment = NULL;
g_autoptr(OstreeDeployment) rollback_deployment = NULL;
const char *ref = ostree_deployment_get_csum (deployment);
OstreeDeploymentUnlockedState unlocked = ostree_deployment_get_unlocked (deployment);
g_autofree char *version = version_of_commit (repo, ref);
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
guint jj, n_signatures;
GError *local_error = NULL;
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
const char *new_provided_refspec = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
g_autofree char *origin_refspec = NULL;
g_autofree char *origin_remote = NULL;
g_autofree char *origin_ref = NULL;
g_autofree char *new_ref = NULL;
g_autofree char *new_refspec = NULL;
const char* remote;
- glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL;
- glnx_unref_object OstreeAsyncProgress *progress = NULL;
+ g_autoptr(OstreeSysrootUpgrader) upgrader = NULL;
+ g_autoptr(OstreeAsyncProgress) progress = NULL;
gboolean changed;
GKeyFile *old_origin;
g_autoptr(GKeyFile) new_origin = NULL;
ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
const char *deploy_index_str;
int deploy_index;
g_autoptr(GPtrArray) current_deployments = NULL;
- glnx_unref_object OstreeDeployment *target_deployment = NULL;
+ g_autoptr(OstreeDeployment) target_deployment = NULL;
context = g_option_context_new ("INDEX - Delete deployment INDEX");
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
OstreeDeployment *booted_deployment = NULL;
OstreeDeploymentUnlockedState target_state;
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
- glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
+ g_autoptr(OstreeSysrootUpgrader) upgrader = NULL;
g_autoptr(GKeyFile) origin = NULL;
- glnx_unref_object OstreeAsyncProgress *progress = NULL;
+ g_autoptr(OstreeAsyncProgress) progress = NULL;
gboolean changed;
OstreeSysrootUpgraderPullFlags upgraderpullflags = 0;
gboolean ret = FALSE;
guint bootversion;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries");
const char *policy_name;
g_autoptr(GFile) subpath = NULL;
const char *prefix = NULL;
- glnx_unref_object OstreeSePolicy *sepolicy = NULL;
+ g_autoptr(OstreeSePolicy) sepolicy = NULL;
g_autoptr(GPtrArray) deployments = NULL;
OstreeDeployment *first_deployment;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
g_autoptr(GFile) deployment_path = NULL;
context = g_option_context_new ("[SUBPATH PREFIX] - relabel all or part of a deployment");
g_autoptr(GPtrArray) deployments = NULL;
OstreeDeployment *first_deployment = NULL;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeSysroot *sysroot = NULL;
+ g_autoptr(OstreeSysroot) sysroot = NULL;
__attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
context = g_option_context_new ("ARGS - set new kernel command line arguments");
ostree_builtin_checkout (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
const char *commit;
const char *destination;
ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
gboolean skip_commit = FALSE;
g_autoptr(GFile) object_to_commit = NULL;
g_autoptr(GFile) root = NULL;
g_autoptr(GVariant) metadata = NULL;
g_autoptr(GVariant) detached_metadata = NULL;
- glnx_unref_object OstreeMutableTree *mtree = NULL;
+ g_autoptr(OstreeMutableTree) mtree = NULL;
g_autofree char *tree_type = NULL;
g_autoptr(GHashTable) mode_adds = NULL;
g_autoptr(GHashTable) mode_overrides = NULL;
ostree_builtin_config (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
const char *op;
const char *section_key;
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
const char *src;
const char *target;
g_autofree char *src_prev = NULL;
ostree_builtin_export (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
const char *rev;
g_autoptr(GFile) root = NULL;
GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
g_autoptr(GPtrArray) refs = NULL; /* (element-type OstreeCollectionRef) */
- glnx_unref_object OstreeAsyncProgress *progress = NULL;
+ g_autoptr(OstreeAsyncProgress) progress = NULL;
gsize i;
g_autoptr(GAsyncResult) find_result = NULL, pull_result = NULL;
g_auto(OstreeRepoFinderResultv) results = NULL;
gboolean
ostree_builtin_fsck (int argc, char **argv, GCancellable *cancellable, GError **error)
{
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean found_corruption = FALSE;
g_autoptr(GOptionContext) context = g_option_context_new ("- Check the repository for consistency");
GError **error)
{
GVariantDict metadata_dict;
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
g_autoptr(GVariant) old_metadata = NULL;
g_autoptr(GVariant) new_metadata = NULL;
g_autoptr(GVariant) signature_data = NULL;
ostree_builtin_gpg_sign (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
g_autofree char *resolved_commit = NULL;
const char *commit;
char **key_ids;
GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
const char *rev;
g_autofree char *checksum = NULL;
ostree_builtin_ls (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
const char *rev;
int i;
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
g_autofree char *formatted_freed_size = NULL;
OstreeRepoPruneFlags pruneflags = 0;
gint n_objects_total;
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
int i;
const char *src_repo_arg;
g_autofree char *src_repo_uri = NULL;
- glnx_unref_object OstreeAsyncProgress *progress = NULL;
+ g_autoptr(OstreeAsyncProgress) progress = NULL;
g_autoptr(GPtrArray) refs_to_fetch = NULL;
OstreeRepoPullFlags pullflags = 0;
if (argc == 2)
{
g_autoptr(GFile) src_repo_path = g_file_new_for_path (src_repo_arg);
- glnx_unref_object OstreeRepo *src_repo = ostree_repo_new (src_repo_path);
+ g_autoptr(OstreeRepo) src_repo = ostree_repo_new (src_repo_path);
g_autoptr(GHashTable) refs_to_clone = NULL;
refs_to_fetch = g_ptr_array_new_with_free_func (g_free);
ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
g_autofree char *remote = NULL;
OstreeRepoPullFlags pullflags = 0;
g_autoptr(GPtrArray) refs_to_fetch = NULL;
g_autoptr(GPtrArray) override_commit_ids = NULL;
- glnx_unref_object OstreeAsyncProgress *progress = NULL;
+ g_autoptr(OstreeAsyncProgress) progress = NULL;
gulong signal_handler_id = 0;
context = g_option_context_new ("REMOTE [BRANCH...] - Download data from remote repository");
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
int i;
context = g_option_context_new ("[PREFIX] - List refs");
GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
g_autoptr(GHashTable) known_refs = NULL;
gboolean ret = FALSE;
const char *ref;
ostree_builtin_rev_parse (int argc, char **argv, GCancellable *cancellable, GError **error)
{
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
const char *rev = "master";
int i;
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
{
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
g_autoptr(GError) local_error = NULL;
g_autoptr(GFile) gpg_homedir = opt_gpg_homedir ? g_file_new_for_path (opt_gpg_homedir) : NULL;
{
g_autoptr(GOptionContext) context = g_option_context_new ("OBJECT - Output a metadata object");
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
return FALSE;
g_autoptr(GPtrArray) delta_names = NULL;
guint i;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
context = g_option_context_new ("LIST - list static delta files");
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
const char *delta_id = NULL;
context = g_option_context_new ("SHOW - Dump information on a delta");
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
const char *delta_id = NULL;
context = g_option_context_new ("DELETE - Remove a delta");
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
context = g_option_context_new ("GENERATE [TO] - Generate static delta files");
if (!ostree_option_context_parse (context, generate_options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
const char *patharg;
g_autoptr(GFile) path = NULL;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
context = g_option_context_new ("APPLY-OFFLINE - Apply static delta file");
if (!ostree_option_context_parse (context, apply_offline_options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
{
gboolean ret = FALSE;
g_autoptr(GOptionContext) context = NULL;
- glnx_unref_object OstreeRepo *repo = NULL;
+ g_autoptr(OstreeRepo) repo = NULL;
OstreeDumpFlags flags = OSTREE_DUMP_NONE;
context = g_option_context_new ("Manage summary metadata");
if (opt_sysroot != NULL)
sysroot_path = g_file_new_for_path (opt_sysroot);
- glnx_unref_object OstreeSysroot *sysroot = ostree_sysroot_new (sysroot_path);
+ g_autoptr(OstreeSysroot) sysroot = ostree_sysroot_new (sysroot_path);
if (flags & OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER)
{
* option for raw signature data like "--raw-signatures". */
if (signature_bytes != NULL && !opt_raw)
{
- glnx_unref_object OstreeGpgVerifyResult *result = NULL;
+ g_autoptr(OstreeGpgVerifyResult) result = NULL;
/* The actual signed summary verification happens above in
* ostree_repo_remote_fetch_summary(). Here we just parse