mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-12 01:49:17 -04:00
common: Replace all flatpak_debug2() with g_debug()
They are now equivalent. Resolves: https://github.com/flatpak/flatpak/issues/5001 Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Simon McVittie
parent
c2c034733e
commit
60e2cceb8c
@@ -372,7 +372,7 @@ flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap,
|
||||
|
||||
fd = glnx_steal_fd (&args_tmpf.fd);
|
||||
|
||||
flatpak_debug2 ("bwrap --args %d = ...", fd);
|
||||
g_debug ("bwrap --args %d = ...", fd);
|
||||
|
||||
for (i = start; i < end; i++)
|
||||
{
|
||||
@@ -380,11 +380,11 @@ flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap,
|
||||
{
|
||||
g_autofree char *quoted = g_shell_quote (bwrap->argv->pdata[i]);
|
||||
|
||||
flatpak_debug2 (" %s", quoted);
|
||||
g_debug (" %s", quoted);
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 (" %s", (const char *) bwrap->argv->pdata[i]);
|
||||
g_debug (" %s", (const char *) bwrap->argv->pdata[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ flatpak_exports_append_bwrap_args (FlatpakExports *exports,
|
||||
|
||||
g_qsort_with_data (keys, n_keys, sizeof (char *), (GCompareDataFunc) flatpak_strcmp0_ptr, NULL);
|
||||
|
||||
flatpak_debug2 ("Converting FlatpakExports to bwrap arguments...");
|
||||
g_debug ("Converting FlatpakExports to bwrap arguments...");
|
||||
|
||||
for (l = eps; l != NULL; l = l->next)
|
||||
{
|
||||
@@ -439,12 +439,12 @@ flatpak_exports_append_bwrap_args (FlatpakExports *exports,
|
||||
|
||||
if (ep->mode == FAKE_MODE_SYMLINK)
|
||||
{
|
||||
flatpak_debug2 ("\"%s\" is meant to be a symlink", path);
|
||||
g_debug ("\"%s\" is meant to be a symlink", path);
|
||||
|
||||
if (path_parent_is_mapped (keys, n_keys, exports->hash, path))
|
||||
{
|
||||
flatpak_debug2 ("Not creating \"%s\" as symlink because its parent is "
|
||||
"already mapped", path);
|
||||
g_debug ("Not creating \"%s\" as symlink because its parent is "
|
||||
"already mapped", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -456,19 +456,19 @@ flatpak_exports_append_bwrap_args (FlatpakExports *exports,
|
||||
g_autofree char *parent = g_path_get_dirname (path);
|
||||
g_autofree char *relative = make_relative (parent, resolved);
|
||||
|
||||
flatpak_debug2 ("Resolved \"%s\" to \"%s\" in host", path, resolved);
|
||||
flatpak_debug2 ("Creating \"%s\" -> \"%s\" in sandbox", path, relative);
|
||||
g_debug ("Resolved \"%s\" to \"%s\" in host", path, resolved);
|
||||
g_debug ("Creating \"%s\" -> \"%s\" in sandbox", path, relative);
|
||||
flatpak_bwrap_add_args (bwrap, "--symlink", relative, path, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Unable to resolve \"%s\" in host, skipping", path);
|
||||
g_debug ("Unable to resolve \"%s\" in host, skipping", path);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ep->mode == FAKE_MODE_TMPFS)
|
||||
{
|
||||
flatpak_debug2 ("\"%s\" is meant to be a tmpfs or empty directory", path);
|
||||
g_debug ("\"%s\" is meant to be a tmpfs or empty directory", path);
|
||||
|
||||
/* Mount a tmpfs to hide the subdirectory, but only if there
|
||||
is a pre-existing dir we can mount the path on. */
|
||||
@@ -477,38 +477,38 @@ flatpak_exports_append_bwrap_args (FlatpakExports *exports,
|
||||
if (!path_parent_is_mapped (keys, n_keys, exports->hash, path))
|
||||
/* If the parent is not mapped, it will be a tmpfs, no need to mount another one */
|
||||
{
|
||||
flatpak_debug2 ("Parent of \"%s\" is not mapped, creating empty directory", path);
|
||||
g_debug ("Parent of \"%s\" is not mapped, creating empty directory", path);
|
||||
flatpak_bwrap_add_args (bwrap, "--dir", path, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Parent of \"%s\" is mapped, creating tmpfs to shadow it", path);
|
||||
g_debug ("Parent of \"%s\" is mapped, creating tmpfs to shadow it", path);
|
||||
flatpak_bwrap_add_args (bwrap, "--tmpfs", path, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Not a directory, skipping: \"%s\"", path);
|
||||
g_debug ("Not a directory, skipping: \"%s\"", path);
|
||||
}
|
||||
}
|
||||
else if (ep->mode == FAKE_MODE_DIR)
|
||||
{
|
||||
flatpak_debug2 ("\"%s\" is meant to be a directory", path);
|
||||
g_debug ("\"%s\" is meant to be a directory", path);
|
||||
|
||||
if (path_is_dir (exports, path))
|
||||
{
|
||||
flatpak_debug2 ("Ensuring \"%s\" is created as a directory", path);
|
||||
g_debug ("Ensuring \"%s\" is created as a directory", path);
|
||||
flatpak_bwrap_add_args (bwrap, "--dir", path, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Not a directory, skipping: \"%s\"", path);
|
||||
g_debug ("Not a directory, skipping: \"%s\"", path);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("\"%s\" is meant to be shared (ro or rw) with the container",
|
||||
path);
|
||||
g_debug ("\"%s\" is meant to be shared (ro or rw) with the container",
|
||||
path);
|
||||
flatpak_bwrap_add_args (bwrap,
|
||||
(ep->mode == FLATPAK_FILESYSTEM_MODE_READ_ONLY) ? "--ro-bind" : "--bind",
|
||||
path, path, NULL);
|
||||
@@ -755,24 +755,24 @@ do_export_path (FlatpakExports *exports,
|
||||
{
|
||||
if (old_ep->mode < mode)
|
||||
{
|
||||
flatpak_debug2 ("Increasing export mode from \"%s\" to \"%s\": %s",
|
||||
export_mode_to_verb (old_ep->mode),
|
||||
export_mode_to_verb (mode),
|
||||
path);
|
||||
g_debug ("Increasing export mode from \"%s\" to \"%s\": %s",
|
||||
export_mode_to_verb (old_ep->mode),
|
||||
export_mode_to_verb (mode),
|
||||
path);
|
||||
ep->mode = mode;
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Not changing export mode from \"%s\" to \"%s\": %s",
|
||||
export_mode_to_verb (old_ep->mode),
|
||||
export_mode_to_verb (mode),
|
||||
path);
|
||||
g_debug ("Not changing export mode from \"%s\" to \"%s\": %s",
|
||||
export_mode_to_verb (old_ep->mode),
|
||||
export_mode_to_verb (mode),
|
||||
path);
|
||||
ep->mode = old_ep->mode;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Will %s: %s", export_mode_to_verb (mode), path);
|
||||
g_debug ("Will %s: %s", export_mode_to_verb (mode), path);
|
||||
ep->mode = mode;
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ _exports_path_expose (FlatpakExports *exports,
|
||||
|
||||
g_return_val_if_fail (is_export_mode (mode), FALSE);
|
||||
|
||||
flatpak_debug2 ("Trying to %s: %s", export_mode_to_verb (mode), path);
|
||||
g_debug ("Trying to %s: %s", export_mode_to_verb (mode), path);
|
||||
|
||||
if (level > 40) /* 40 is the current kernel ELOOP check */
|
||||
{
|
||||
@@ -972,11 +972,11 @@ _exports_path_expose (FlatpakExports *exports,
|
||||
|
||||
if (!path_is_symlink (exports, path))
|
||||
{
|
||||
flatpak_debug2 ("%s is not a symlink", path);
|
||||
g_debug ("%s is not a symlink", path);
|
||||
}
|
||||
else if (never_export_as_symlink (path))
|
||||
{
|
||||
flatpak_debug2 ("%s is a symlink, but we avoid exporting it as such", path);
|
||||
g_debug ("%s is a symlink, but we avoid exporting it as such", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -986,14 +986,14 @@ _exports_path_expose (FlatpakExports *exports,
|
||||
|
||||
if (resolved)
|
||||
{
|
||||
flatpak_debug2 ("%s is a symlink, resolved to %s", path, resolved);
|
||||
g_debug ("%s is a symlink, resolved to %s", path, resolved);
|
||||
|
||||
if (slash)
|
||||
new_target = g_build_filename (resolved, slash + 1, NULL);
|
||||
else
|
||||
new_target = g_strdup (resolved);
|
||||
|
||||
flatpak_debug2 ("Trying to export the target instead: %s", new_target);
|
||||
g_debug ("Trying to export the target instead: %s", new_target);
|
||||
|
||||
if (_exports_path_expose (exports, mode, new_target, level + 1))
|
||||
{
|
||||
@@ -1001,14 +1001,14 @@ _exports_path_expose (FlatpakExports *exports,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
flatpak_debug2 ("Could not export target %s, so ignoring %s",
|
||||
new_target, path);
|
||||
g_debug ("Could not export target %s, so ignoring %s",
|
||||
new_target, path);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("%s is a symlink but we were unable to resolve it: %s",
|
||||
path, error->message);
|
||||
g_debug ("%s is a symlink but we were unable to resolve it: %s",
|
||||
path, error->message);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ flatpak_instance_iterate_all_and_gc (GPtrArray *out_instances)
|
||||
g_info ("Cleaning up unused container id %s", dent->d_name);
|
||||
|
||||
if (!flatpak_instance_gc_per_app_dirs (dent->d_name, &local_error))
|
||||
flatpak_debug2 ("Not cleaning up per-app dir: %s", local_error->message);
|
||||
g_debug ("Not cleaning up per-app dir: %s", local_error->message);
|
||||
|
||||
glnx_shutil_rm_rf_at (iter.fd, dent->d_name, NULL, NULL);
|
||||
continue;
|
||||
|
||||
@@ -517,7 +517,7 @@ traverse_reachable_refs_unlocked (OstreeRepo *repo,
|
||||
if (object_name_bag_contains (reachable, &commit_name))
|
||||
continue;
|
||||
|
||||
flatpak_debug2 ("Finding objects to keep for commit %s", checksum);
|
||||
g_debug ("Finding objects to keep for commit %s", checksum);
|
||||
|
||||
if (!load_extra_commitmeta (repo, checksum, &extra_commitmeta, cancellable, error))
|
||||
return FALSE;
|
||||
@@ -608,8 +608,8 @@ prune_loose_object (OtPruneData *data,
|
||||
{
|
||||
guint64 storage_size = 0;
|
||||
|
||||
flatpak_debug2 ("Pruning unneeded object %s.%s", checksum,
|
||||
ostree_object_type_to_string (objtype));
|
||||
g_debug ("Pruning unneeded object %s.%s", checksum,
|
||||
ostree_object_type_to_string (objtype));
|
||||
|
||||
if (!ostree_repo_query_object_storage_size (data->repo, objtype, checksum,
|
||||
&storage_size, cancellable, error))
|
||||
|
||||
@@ -369,7 +369,7 @@ flatpak_run_add_x11_args (FlatpakBwrap *bwrap,
|
||||
}
|
||||
else
|
||||
{
|
||||
flatpak_debug2 ("Assuming --share=network gives access to remote X11");
|
||||
g_debug ("Assuming --share=network gives access to remote X11");
|
||||
}
|
||||
|
||||
#ifdef ENABLE_XAUTH
|
||||
@@ -3350,8 +3350,8 @@ setup_seccomp (FlatpakBwrap *bwrap,
|
||||
* libseccomp cannot map the syscall number to a name and back to a
|
||||
* number for the non-native architecture. */
|
||||
if (r == -EFAULT)
|
||||
flatpak_debug2 ("Unable to block syscall %d: syscall not known to libseccomp?",
|
||||
scall);
|
||||
g_debug ("Unable to block syscall %d: syscall not known to libseccomp?",
|
||||
scall);
|
||||
else if (r < 0)
|
||||
return flatpak_fail_error (error, FLATPAK_ERROR_SETUP_FAILED, _("Failed to block syscall %d: %s"), scall, flatpak_seccomp_strerror (r));
|
||||
}
|
||||
@@ -3367,8 +3367,8 @@ setup_seccomp (FlatpakBwrap *bwrap,
|
||||
|
||||
/* See above for the meaning of EFAULT. */
|
||||
if (r == -EFAULT)
|
||||
flatpak_debug2 ("Unable to block syscall %d: syscall not known to libseccomp?",
|
||||
scall);
|
||||
g_debug ("Unable to block syscall %d: syscall not known to libseccomp?",
|
||||
scall);
|
||||
else if (r < 0)
|
||||
return flatpak_fail_error (error, FLATPAK_ERROR_SETUP_FAILED, _("Failed to block syscall %d: %s"), scall, flatpak_seccomp_strerror (r));
|
||||
}
|
||||
@@ -3389,8 +3389,8 @@ setup_seccomp (FlatpakBwrap *bwrap,
|
||||
|
||||
/* See above for the meaning of EFAULT. */
|
||||
if (r == -EFAULT)
|
||||
flatpak_debug2 ("Unable to block syscall %d: syscall not known to libseccomp?",
|
||||
scall);
|
||||
g_debug ("Unable to block syscall %d: syscall not known to libseccomp?",
|
||||
scall);
|
||||
else if (r < 0)
|
||||
return flatpak_fail_error (error, FLATPAK_ERROR_SETUP_FAILED, _("Failed to block syscall %d: %s"), scall, flatpak_seccomp_strerror (r));
|
||||
}
|
||||
|
||||
@@ -102,8 +102,6 @@ gboolean flatpak_fail_error (GError **error,
|
||||
const char *fmt,
|
||||
...) G_GNUC_PRINTF (3, 4);
|
||||
|
||||
#define flatpak_debug2(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
||||
|
||||
gint flatpak_strcmp0_ptr (gconstpointer a,
|
||||
gconstpointer b);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user