summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-12-14 15:37:55 +0000
committerSimon McVittie <smcv@debian.org>2022-12-15 16:45:35 +0000
commit60e2cceb8cc12d84bfd0b98e83bc22a4507a4089 (patch)
treec1b9201c8e5b94d96e7ddd8d7f78aed8e67faa9c
parentc2c034733ee77a639da66ae70788707c89e073fb (diff)
downloadflatpak-60e2cceb8cc12d84bfd0b98e83bc22a4507a4089.tar.gz
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>
-rw-r--r--common/flatpak-bwrap.c6
-rw-r--r--common/flatpak-exports.c68
-rw-r--r--common/flatpak-instance.c2
-rw-r--r--common/flatpak-prune.c6
-rw-r--r--common/flatpak-run.c14
-rw-r--r--common/flatpak-utils-private.h2
6 files changed, 48 insertions, 50 deletions
diff --git a/common/flatpak-bwrap.c b/common/flatpak-bwrap.c
index 348b645e..6949c0be 100644
--- a/common/flatpak-bwrap.c
+++ b/common/flatpak-bwrap.c
@@ -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]);
}
}
diff --git a/common/flatpak-exports.c b/common/flatpak-exports.c
index a07e64d5..15acc5b8 100644
--- a/common/flatpak-exports.c
+++ b/common/flatpak-exports.c
@@ -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;
}
}
diff --git a/common/flatpak-instance.c b/common/flatpak-instance.c
index 5e768358..3623043d 100644
--- a/common/flatpak-instance.c
+++ b/common/flatpak-instance.c
@@ -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;
diff --git a/common/flatpak-prune.c b/common/flatpak-prune.c
index 42c6efb9..0e23609f 100644
--- a/common/flatpak-prune.c
+++ b/common/flatpak-prune.c
@@ -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))
diff --git a/common/flatpak-run.c b/common/flatpak-run.c
index 3ed02764..8d613165 100644
--- a/common/flatpak-run.c
+++ b/common/flatpak-run.c
@@ -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));
}
diff --git a/common/flatpak-utils-private.h b/common/flatpak-utils-private.h
index b937c274..ed13bb0c 100644
--- a/common/flatpak-utils-private.h
+++ b/common/flatpak-utils-private.h
@@ -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);