flatpak-system-helper.c (flatpak-1.15.1.tar.xz) | : | flatpak-system-helper.c (flatpak-1.15.2.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 155 | skipping to change at line 155 | |||
close (pull->backend_exit_socket); | close (pull->backend_exit_socket); | |||
g_slice_free (OngoingPull, pull); | g_slice_free (OngoingPull, pull); | |||
} | } | |||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OngoingPull, ongoing_pull_free); | G_DEFINE_AUTOPTR_CLEANUP_FUNC (OngoingPull, ongoing_pull_free); | |||
static void | static void | |||
skeleton_died_cb (gpointer data) | skeleton_died_cb (gpointer data) | |||
{ | { | |||
g_debug ("skeleton finalized, exiting"); | g_info ("skeleton finalized, exiting"); | |||
g_main_loop_quit (main_loop); | g_main_loop_quit (main_loop); | |||
} | } | |||
static gboolean | static gboolean | |||
unref_skeleton_in_timeout_cb (gpointer user_data) | unref_skeleton_in_timeout_cb (gpointer user_data) | |||
{ | { | |||
static gboolean unreffed = FALSE; | static gboolean unreffed = FALSE; | |||
g_debug ("unreffing helper main ref"); | g_info ("unreffing helper main ref"); | |||
if (!unreffed) | if (!unreffed) | |||
{ | { | |||
g_object_unref (helper); | g_object_unref (helper); | |||
unreffed = TRUE; | unreffed = TRUE; | |||
} | } | |||
return G_SOURCE_REMOVE; | return G_SOURCE_REMOVE; | |||
} | } | |||
static void | static void | |||
skipping to change at line 200 | skipping to change at line 200 | |||
idle_timeout_cb (gpointer user_data) | idle_timeout_cb (gpointer user_data) | |||
{ | { | |||
G_LOCK (cache_dirs_in_use); | G_LOCK (cache_dirs_in_use); | |||
guint ongoing_pulls_len = g_hash_table_size (cache_dirs_in_use); | guint ongoing_pulls_len = g_hash_table_size (cache_dirs_in_use); | |||
G_UNLOCK (cache_dirs_in_use); | G_UNLOCK (cache_dirs_in_use); | |||
if (ongoing_pulls_len != 0) | if (ongoing_pulls_len != 0) | |||
return G_SOURCE_CONTINUE; | return G_SOURCE_CONTINUE; | |||
if (name_owner_id) | if (name_owner_id) | |||
{ | { | |||
g_debug ("Idle - unowning name"); | g_info ("Idle - unowning name"); | |||
unref_skeleton_in_timeout (); | unref_skeleton_in_timeout (); | |||
} | } | |||
return G_SOURCE_REMOVE; | return G_SOURCE_REMOVE; | |||
} | } | |||
G_LOCK_DEFINE_STATIC (idle); | G_LOCK_DEFINE_STATIC (idle); | |||
static void | static void | |||
schedule_idle_callback (void) | schedule_idle_callback (void) | |||
{ | { | |||
static guint idle_timeout_id = 0; | static guint idle_timeout_id = 0; | |||
skipping to change at line 408 | skipping to change at line 408 | |||
gboolean is_update; | gboolean is_update; | |||
gboolean no_deploy; | gboolean no_deploy; | |||
gboolean local_pull; | gboolean local_pull; | |||
gboolean reinstall; | gboolean reinstall; | |||
gboolean update_pinned; | gboolean update_pinned; | |||
g_autofree char *url = NULL; | g_autofree char *url = NULL; | |||
g_autoptr(OngoingPull) ongoing_pull = NULL; | g_autoptr(OngoingPull) ongoing_pull = NULL; | |||
g_autofree gchar *src_dir = NULL; | g_autofree gchar *src_dir = NULL; | |||
g_autoptr(FlatpakDecomposed) ref = NULL; | g_autoptr(FlatpakDecomposed) ref = NULL; | |||
g_debug ("Deploy %s %u %s %s %s", arg_repo_path, arg_flags, arg_ref, arg_origi n, arg_installation); | g_info ("Deploy %s %u %s %s %s", arg_repo_path, arg_flags, arg_ref, arg_origin , arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_DEPLOY_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_DEPLOY_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_DEPLOY_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_DEPLOY_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 729 | skipping to change at line 729 | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_installation, | const gchar *arg_installation, | |||
const gchar *arg_src_dir) | const gchar *arg_src_dir) | |||
{ | { | |||
OngoingPull *ongoing_pull; | OngoingPull *ongoing_pull; | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
uid_t uid; | uid_t uid; | |||
g_debug ("CancelPull %s %u %s", arg_installation, arg_flags, arg_src_dir); | g_info ("CancelPull %s %u %s", arg_installation, arg_flags, arg_src_dir); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_CANCEL_PULL_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_CANCEL_PULL_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
ongoing_pull = take_ongoing_pull_by_dir (arg_src_dir); | ongoing_pull = take_ongoing_pull_by_dir (arg_src_dir); | |||
if (ongoing_pull == NULL) | if (ongoing_pull == NULL) | |||
skipping to change at line 787 | skipping to change at line 787 | |||
const gchar *arg_arch, | const gchar *arg_arch, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_autofree char *new_branch = NULL; | g_autofree char *new_branch = NULL; | |||
g_autofree char *old_branch = NULL; | g_autofree char *old_branch = NULL; | |||
g_autofree char *subset = NULL; | g_autofree char *subset = NULL; | |||
gboolean is_oci; | gboolean is_oci; | |||
g_debug ("DeployAppstream %s %u %s %s %s", arg_repo_path, arg_flags, arg_origi n, arg_arch, arg_installation); | g_info ("DeployAppstream %s %u %s %s %s", arg_repo_path, arg_flags, arg_origin , arg_arch, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_DEPLOY_APPSTREAM_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_DEPLOY_APPSTREAM_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if (strlen (arg_repo_path) > 0) | if (strlen (arg_repo_path) > 0) | |||
{ | { | |||
skipping to change at line 955 | skipping to change at line 955 | |||
handle_uninstall (FlatpakSystemHelper *object, | handle_uninstall (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_ref, | const gchar *arg_ref, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_autoptr(FlatpakDecomposed) ref = NULL; | g_autoptr(FlatpakDecomposed) ref = NULL; | |||
g_debug ("Uninstall %u %s %s", arg_flags, arg_ref, arg_installation); | g_info ("Uninstall %u %s %s", arg_flags, arg_ref, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_UNINSTALL_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_UNINSTALL_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
ref = flatpak_decomposed_new_from_ref (arg_ref, &error); | ref = flatpak_decomposed_new_from_ref (arg_ref, &error); | |||
if (ref == NULL) | if (ref == NULL) | |||
skipping to change at line 1008 | skipping to change at line 1008 | |||
const gchar *arg_bundle_path, | const gchar *arg_bundle_path, | |||
guint32 arg_flags, | guint32 arg_flags, | |||
const gchar *arg_remote, | const gchar *arg_remote, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GFile) bundle_file = g_file_new_for_path (arg_bundle_path); | g_autoptr(GFile) bundle_file = g_file_new_for_path (arg_bundle_path); | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_autoptr(FlatpakDecomposed) ref = NULL; | g_autoptr(FlatpakDecomposed) ref = NULL; | |||
g_debug ("InstallBundle %s %u %s %s", arg_bundle_path, arg_flags, arg_remote, arg_installation); | g_info ("InstallBundle %s %u %s %s", arg_bundle_path, arg_flags, arg_remote, a rg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_INSTALL_BUNDLE_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_INSTALL_BUNDLE_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_INSTALL_BUNDLE_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_INSTALL_BUNDLE_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1058 | skipping to change at line 1058 | |||
GVariant *arg_gpg_key, | GVariant *arg_gpg_key, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_autoptr(GKeyFile) config = g_key_file_new (); | g_autoptr(GKeyFile) config = g_key_file_new (); | |||
g_autofree char *group = g_strdup_printf ("remote \"%s\"", arg_remote); | g_autofree char *group = g_strdup_printf ("remote \"%s\"", arg_remote); | |||
g_autoptr(GBytes) gpg_data = NULL; | g_autoptr(GBytes) gpg_data = NULL; | |||
gboolean force_remove; | gboolean force_remove; | |||
g_debug ("ConfigureRemote %u %s %s", arg_flags, arg_remote, arg_installation); | g_info ("ConfigureRemote %u %s %s", arg_flags, arg_remote, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_CONFIGURE_REMOTE_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_CONFIGURE_REMOTE_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if (*arg_remote == 0 || strchr (arg_remote, '/') != NULL) | if (*arg_remote == 0 || strchr (arg_remote, '/') != NULL) | |||
{ | { | |||
skipping to change at line 1133 | skipping to change at line 1133 | |||
handle_configure (FlatpakSystemHelper *object, | handle_configure (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_key, | const gchar *arg_key, | |||
const gchar *arg_value, | const gchar *arg_value, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_debug ("Configure %u %s=%s %s", arg_flags, arg_key, arg_value, arg_installat ion); | g_info ("Configure %u %s=%s %s", arg_flags, arg_key, arg_value, arg_installati on); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_CONFIGURE_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_CONFIGURE_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_CONFIGURE_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_CONFIGURE_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1199 | skipping to change at line 1199 | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
char *summary_data = NULL; | char *summary_data = NULL; | |||
gsize summary_size; | gsize summary_size; | |||
g_autoptr(GBytes) summary_bytes = NULL; | g_autoptr(GBytes) summary_bytes = NULL; | |||
char *summary_sig_data = NULL; | char *summary_sig_data = NULL; | |||
gsize summary_sig_size; | gsize summary_sig_size; | |||
g_autoptr(GBytes) summary_sig_bytes = NULL; | g_autoptr(GBytes) summary_sig_bytes = NULL; | |||
g_autoptr(FlatpakRemoteState) state = NULL; | g_autoptr(FlatpakRemoteState) state = NULL; | |||
gboolean summary_is_index = (arg_flags & FLATPAK_HELPER_UPDATE_REMOTE_FLAGS_SU MMARY_IS_INDEX) != 0; | gboolean summary_is_index = (arg_flags & FLATPAK_HELPER_UPDATE_REMOTE_FLAGS_SU MMARY_IS_INDEX) != 0; | |||
g_debug ("UpdateRemote %u %s %s %s %s", arg_flags, arg_remote, arg_installatio n, arg_summary_path, arg_summary_sig_path); | g_info ("UpdateRemote %u %s %s %s %s", arg_flags, arg_remote, arg_installation , arg_summary_path, arg_summary_sig_path); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_UPDATE_REMOTE_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_UPDATE_REMOTE_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if (*arg_remote == 0 || strchr (arg_remote, '/') != NULL) | if (*arg_remote == 0 || strchr (arg_remote, '/') != NULL) | |||
{ | { | |||
skipping to change at line 1278 | skipping to change at line 1278 | |||
handle_remove_local_ref (FlatpakSystemHelper *object, | handle_remove_local_ref (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_remote, | const gchar *arg_remote, | |||
const gchar *arg_ref, | const gchar *arg_ref, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_debug ("RemoveLocalRef %u %s %s %s", arg_flags, arg_remote, arg_ref, arg_ins tallation); | g_info ("RemoveLocalRef %u %s %s %s", arg_flags, arg_remote, arg_ref, arg_inst allation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_REMOVE_LOCAL_REF_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_REMOVE_LOCAL_REF_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_REMOVE_LOCAL_REF_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_REMOVE_LOCAL_REF_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1327 | skipping to change at line 1327 | |||
static gboolean | static gboolean | |||
handle_prune_local_repo (FlatpakSystemHelper *object, | handle_prune_local_repo (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_debug ("PruneLocalRepo %u %s", arg_flags, arg_installation); | g_info ("PruneLocalRepo %u %s", arg_flags, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_PRUNE_LOCAL_REPO_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_PRUNE_LOCAL_REPO_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_PRUNE_LOCAL_REPO_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_PRUNE_LOCAL_REPO_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1370 | skipping to change at line 1370 | |||
static gboolean | static gboolean | |||
handle_ensure_repo (FlatpakSystemHelper *object, | handle_ensure_repo (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_autoptr(GError) local_error = NULL; | g_autoptr(GError) local_error = NULL; | |||
g_debug ("EnsureRepo %u %s", arg_flags, arg_installation); | g_info ("EnsureRepo %u %s", arg_flags, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_ENSURE_REPO_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_ENSURE_REPO_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_ENSURE_REPO_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_ENSURE_REPO_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1409 | skipping to change at line 1409 | |||
static gboolean | static gboolean | |||
handle_run_triggers (FlatpakSystemHelper *object, | handle_run_triggers (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_debug ("RunTriggers %u %s", arg_flags, arg_installation); | g_info ("RunTriggers %u %s", arg_flags, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_RUN_TRIGGERS_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_RUN_TRIGGERS_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_RUN_TRIGGERS_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_RUN_TRIGGERS_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1619 | skipping to change at line 1619 | |||
gchar **out_src_dir, | gchar **out_src_dir, | |||
struct passwd *passwd) | struct passwd *passwd) | |||
{ | { | |||
g_autoptr(GFileEnumerator) enumerator = NULL; | g_autoptr(GFileEnumerator) enumerator = NULL; | |||
g_autoptr(GFile) repo_tmpfile = NULL; | g_autoptr(GFile) repo_tmpfile = NULL; | |||
GFileInfo *file_info = NULL; | GFileInfo *file_info = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
const gchar *name; | const gchar *name; | |||
gboolean res = FALSE; | gboolean res = FALSE; | |||
g_debug ("Checking for any temporary cache directory available to reuse"); | g_info ("Checking for any temporary cache directory available to reuse"); | |||
repo_tmpfile = g_file_new_for_path (repo_tmp); | repo_tmpfile = g_file_new_for_path (repo_tmp); | |||
enumerator = g_file_enumerate_children (repo_tmpfile, | enumerator = g_file_enumerate_children (repo_tmpfile, | |||
G_FILE_ATTRIBUTE_STANDARD_NAME "," | G_FILE_ATTRIBUTE_STANDARD_NAME "," | |||
G_FILE_ATTRIBUTE_STANDARD_TYPE, | G_FILE_ATTRIBUTE_STANDARD_TYPE, | |||
G_FILE_QUERY_INFO_NONE, NULL, &error); | G_FILE_QUERY_INFO_NONE, NULL, &error); | |||
if (enumerator == NULL) | if (enumerator == NULL) | |||
{ | { | |||
g_warning ("Failed to enumerate %s: %s", repo_tmp, error->message); | g_warning ("Failed to enumerate %s: %s", repo_tmp, error->message); | |||
return FALSE; | return FALSE; | |||
skipping to change at line 1694 | skipping to change at line 1694 | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
g_autofree gchar *src_dir = NULL; | g_autofree gchar *src_dir = NULL; | |||
g_autofree gchar *flatpak_dir = NULL; | g_autofree gchar *flatpak_dir = NULL; | |||
g_autofree gchar *repo_tmp = NULL; | g_autofree gchar *repo_tmp = NULL; | |||
g_autofree gchar *passwd_buf = NULL; | g_autofree gchar *passwd_buf = NULL; | |||
struct passwd passwd = { NULL }; | struct passwd passwd = { NULL }; | |||
OngoingPull *new_pull; | OngoingPull *new_pull; | |||
uid_t uid; | uid_t uid; | |||
int fd_index = -1; | int fd_index = -1; | |||
g_debug ("GetRevokefsFd %u %s", arg_flags, arg_installation); | g_info ("GetRevokefsFd %u %s", arg_flags, arg_installation); | |||
if (disable_revokefs) | if (disable_revokefs) | |||
{ | { | |||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ER ROR_NOT_SUPPORTED, "RevokeFS disabled"); | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ER ROR_NOT_SUPPORTED, "RevokeFS disabled"); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_GET_REVOKEFS_FD_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_GET_REVOKEFS_FD_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
skipping to change at line 1737 | skipping to change at line 1737 | |||
if (!get_connection_uid (invocation, &uid, &error)) | if (!get_connection_uid (invocation, &uid, &error)) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
flatpak_dir = g_file_get_path (flatpak_dir_get_path (system)); | flatpak_dir = g_file_get_path (flatpak_dir_get_path (system)); | |||
repo_tmp = g_build_filename (flatpak_dir, "repo", "tmp", NULL); | repo_tmp = g_build_filename (flatpak_dir, "repo", "tmp", NULL); | |||
if (reuse_cache_dir_if_available (repo_tmp, &src_dir, &passwd)) | if (reuse_cache_dir_if_available (repo_tmp, &src_dir, &passwd)) | |||
g_debug ("Cache dir %s can be reused", src_dir); | g_info ("Cache dir %s can be reused", src_dir); | |||
else | else | |||
{ | { | |||
/* Create a new cache dir and add it to cache_dirs_in_use. Do all this und er | /* Create a new cache dir and add it to cache_dirs_in_use. Do all this und er | |||
* a lock, so that a different pull does not snatch this directory up usin g | * a lock, so that a different pull does not snatch this directory up usin g | |||
* reuse_cache_dir_if_available. */ | * reuse_cache_dir_if_available. */ | |||
G_LOCK (cache_dirs_in_use); | G_LOCK (cache_dirs_in_use); | |||
src_dir = g_mkdtemp_full (g_build_filename (repo_tmp, "flatpak-cache-XXXXX X", NULL), 0755); | src_dir = g_mkdtemp_full (g_build_filename (repo_tmp, "flatpak-cache-XXXXX X", NULL), 0755); | |||
if (src_dir == NULL) | if (src_dir == NULL) | |||
{ | { | |||
G_UNLOCK (cache_dirs_in_use); | G_UNLOCK (cache_dirs_in_use); | |||
skipping to change at line 1797 | skipping to change at line 1797 | |||
static gboolean | static gboolean | |||
handle_update_summary (FlatpakSystemHelper *object, | handle_update_summary (FlatpakSystemHelper *object, | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
gboolean delete_summary; | gboolean delete_summary; | |||
g_debug ("UpdateSummary %u %s", arg_flags, arg_installation); | g_info ("UpdateSummary %u %s", arg_flags, arg_installation); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_UPDATE_SUMMARY_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_UPDATE_SUMMARY_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_UPDATE_SUMMARY_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_UPDATE_SUMMARY_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 1843 | skipping to change at line 1843 | |||
GDBusMethodInvocation *invocation, | GDBusMethodInvocation *invocation, | |||
guint arg_flags, | guint arg_flags, | |||
const gchar *arg_origin, | const gchar *arg_origin, | |||
const gchar *arg_installation) | const gchar *arg_installation) | |||
{ | { | |||
g_autoptr(FlatpakDir) system = NULL; | g_autoptr(FlatpakDir) system = NULL; | |||
g_autoptr(GError) error = NULL; | g_autoptr(GError) error = NULL; | |||
gboolean only_cached; | gboolean only_cached; | |||
gboolean is_oci; | gboolean is_oci; | |||
g_debug ("GenerateOciSummary %u %s %s", arg_flags, arg_origin, arg_installatio n); | g_info ("GenerateOciSummary %u %s %s", arg_flags, arg_origin, arg_installation ); | |||
system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_GENERATE_OCI_SUMMARY_FLAGS_NO_INTERACTION) != 0, &error); | system = dir_get_system (arg_installation, get_sender_pid (invocation), (arg_f lags & FLATPAK_HELPER_GENERATE_OCI_SUMMARY_FLAGS_NO_INTERACTION) != 0, &error); | |||
if (system == NULL) | if (system == NULL) | |||
{ | { | |||
g_dbus_method_invocation_return_gerror (invocation, error); | g_dbus_method_invocation_return_gerror (invocation, error); | |||
return G_DBUS_METHOD_INVOCATION_HANDLED; | return G_DBUS_METHOD_INVOCATION_HANDLED; | |||
} | } | |||
if ((arg_flags & ~FLATPAK_HELPER_GENERATE_OCI_SUMMARY_FLAGS_ALL) != 0) | if ((arg_flags & ~FLATPAK_HELPER_GENERATE_OCI_SUMMARY_FLAGS_ALL) != 0) | |||
{ | { | |||
skipping to change at line 2204 | skipping to change at line 2204 | |||
return authorized; | return authorized; | |||
} | } | |||
static void | static void | |||
on_bus_acquired (GDBusConnection *connection, | on_bus_acquired (GDBusConnection *connection, | |||
const gchar *name, | const gchar *name, | |||
gpointer user_data) | gpointer user_data) | |||
{ | { | |||
GError *error = NULL; | GError *error = NULL; | |||
g_debug ("Bus acquired, creating skeleton"); | g_info ("Bus acquired, creating skeleton"); | |||
g_dbus_connection_set_exit_on_close (connection, FALSE); | g_dbus_connection_set_exit_on_close (connection, FALSE); | |||
helper = flatpak_system_helper_skeleton_new (); | helper = flatpak_system_helper_skeleton_new (); | |||
flatpak_system_helper_set_version (FLATPAK_SYSTEM_HELPER (helper), 2); | flatpak_system_helper_set_version (FLATPAK_SYSTEM_HELPER (helper), 2); | |||
g_object_set_data_full (G_OBJECT (helper), "track-alive", GINT_TO_POINTER (42) , skeleton_died_cb); | g_object_set_data_full (G_OBJECT (helper), "track-alive", GINT_TO_POINTER (42) , skeleton_died_cb); | |||
g_dbus_interface_skeleton_set_flags (G_DBUS_INTERFACE_SKELETON (helper), | g_dbus_interface_skeleton_set_flags (G_DBUS_INTERFACE_SKELETON (helper), | |||
skipping to change at line 2252 | skipping to change at line 2252 | |||
g_warning ("error: %s", error->message); | g_warning ("error: %s", error->message); | |||
g_error_free (error); | g_error_free (error); | |||
} | } | |||
} | } | |||
static void | static void | |||
on_name_acquired (GDBusConnection *connection, | on_name_acquired (GDBusConnection *connection, | |||
const gchar *name, | const gchar *name, | |||
gpointer user_data) | gpointer user_data) | |||
{ | { | |||
g_debug ("Name acquired"); | g_info ("Name acquired"); | |||
} | } | |||
static void | static void | |||
on_name_lost (GDBusConnection *connection, | on_name_lost (GDBusConnection *connection, | |||
const gchar *name, | const gchar *name, | |||
gpointer user_data) | gpointer user_data) | |||
{ | { | |||
g_debug ("Name lost"); | g_info ("Name lost"); | |||
unref_skeleton_in_timeout (); | unref_skeleton_in_timeout (); | |||
} | } | |||
static void | static void | |||
binary_file_changed_cb (GFileMonitor *file_monitor, | binary_file_changed_cb (GFileMonitor *file_monitor, | |||
GFile *file, | GFile *file, | |||
GFile *other_file, | GFile *other_file, | |||
GFileMonitorEvent event_type, | GFileMonitorEvent event_type, | |||
gpointer data) | gpointer data) | |||
{ | { | |||
static gboolean got_it = FALSE; | static gboolean got_it = FALSE; | |||
if (!got_it) | if (!got_it) | |||
{ | { | |||
g_debug ("binary file changed"); | g_info ("binary file changed"); | |||
unref_skeleton_in_timeout (); | unref_skeleton_in_timeout (); | |||
} | } | |||
got_it = TRUE; | got_it = TRUE; | |||
} | } | |||
static void | static void | |||
message_handler (const gchar *log_domain, | message_handler (const gchar *log_domain, | |||
GLogLevelFlags log_level, | GLogLevelFlags log_level, | |||
const gchar *message, | const gchar *message, | |||
gpointer user_data) | gpointer user_data) | |||
{ | { | |||
/* Make this look like normal console output */ | /* Make this look like normal console output */ | |||
if (log_level & G_LOG_LEVEL_DEBUG) | if (log_level & (G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO)) | |||
g_printerr ("FH: %s\n", message); | g_printerr ("FH: %s\n", message); | |||
else | else | |||
g_printerr ("%s: %s\n", g_get_prgname (), message); | g_printerr ("%s: %s\n", g_get_prgname (), message); | |||
} | } | |||
static gboolean | static gboolean | |||
opt_verbose_cb (const gchar *option_name, | opt_verbose_cb (const gchar *option_name, | |||
const gchar *value, | const gchar *value, | |||
gpointer data, | gpointer data, | |||
GError **error) | GError **error) | |||
skipping to change at line 2373 | skipping to change at line 2373 | |||
if (show_version) | if (show_version) | |||
{ | { | |||
g_print (PACKAGE_STRING "\n"); | g_print (PACKAGE_STRING "\n"); | |||
return 0; | return 0; | |||
} | } | |||
flatpak_disable_fancy_output (); | flatpak_disable_fancy_output (); | |||
if (opt_verbose > 0) | if (opt_verbose > 0) | |||
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL); | g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, message_handler, NULL); | |||
if (opt_verbose > 1) | if (opt_verbose > 1) | |||
g_log_set_handler (G_LOG_DOMAIN "2", G_LOG_LEVEL_DEBUG, message_handler, NUL L); | g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL); | |||
if (opt_ostree_verbose) | if (opt_ostree_verbose) | |||
g_log_set_handler ("OSTree", G_LOG_LEVEL_DEBUG, message_handler, NULL); | g_log_set_handler ("OSTree", G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO, message_h andler, NULL); | |||
if (!on_session_bus) | if (!on_session_bus) | |||
{ | { | |||
authority = polkit_authority_get_sync (NULL, &error); | authority = polkit_authority_get_sync (NULL, &error); | |||
if (authority == NULL) | if (authority == NULL) | |||
{ | { | |||
g_printerr ("Can't get polkit authority: %s\n", error->message); | g_printerr ("Can't get polkit authority: %s\n", error->message); | |||
return 1; | return 1; | |||
} | } | |||
} | } | |||
End of changes. 28 change blocks. | ||||
28 lines changed or deleted | 28 lines changed or added |