/** * asb_plugin_process_app: */ gboolean asb_plugin_process_app (AsbPlugin *plugin, AsbPackage *pkg, AsbApp *app, const gchar *tmpdir, GError **error) { gchar **filelist; guint i; /* look for a krunner provider */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { g_autoptr(GError) error_local = NULL; g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/metadata", filelist[i])) continue; filename = g_build_filename (tmpdir, filelist[i], NULL); if (!asb_plugin_process_filename (filename, app, &error_local)) { asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_INFO, "Failed to read ostree metadata file %s: %s", filelist[i], error_local->message); g_clear_error (&error_local); } } return TRUE; }
/** * asb_plugin_process: */ GList * asb_plugin_process (AsbPlugin *plugin, AsbPackage *pkg, const gchar *tmpdir, GError **error) { gboolean ret; GError *error_local = NULL; GList *apps = NULL; guint i; gchar **filelist; filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { if (!_asb_plugin_check_filename (filelist[i])) continue; ret = asb_plugin_process_filename (plugin, pkg, filelist[i], &apps, tmpdir, &error_local); if (!ret) { asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_INFO, "Failed to process %s: %s", filelist[i], error_local->message); g_clear_error (&error_local); } } /* no desktop files we care about */ if (apps == NULL) { g_set_error (error, ASB_PLUGIN_ERROR, ASB_PLUGIN_ERROR_FAILED, "nothing interesting in %s", asb_package_get_basename (pkg)); return NULL; } return apps; }
/** * asb_plugin_process: */ GList * asb_plugin_process (AsbPlugin *plugin, AsbPackage *pkg, const gchar *tmpdir, GError **error) { gboolean ret; GList *apps = NULL; guint i; gchar **filelist; filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { if (!_asb_plugin_check_filename (filelist[i])) continue; ret = asb_plugin_process_filename (plugin, pkg, filelist[i], &apps, tmpdir, error); if (!ret) { g_list_free_full (apps, (GDestroyNotify) g_object_unref); apps = NULL; goto out; } } /* no desktop files we care about */ if (apps == NULL) { g_set_error (error, ASB_PLUGIN_ERROR, ASB_PLUGIN_ERROR_FAILED, "nothing interesting in %s", asb_package_get_basename (pkg)); goto out; } out: return apps; }
/** * asb_plugin_process_app: */ gboolean asb_plugin_process_app (AsbPlugin *plugin, AsbPackage *pkg, AsbApp *app, const gchar *tmpdir, GError **error) { gchar **filelist; guint i; /* already set */ if (as_app_has_kudo_kind (AS_APP (app), AS_KUDO_KIND_SEARCH_PROVIDER)) return TRUE; /* look for a krunner provider */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { g_autoptr(GError) error_local = NULL; g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/usr/share/kde4/services/*.desktop", filelist[i])) continue; filename = g_build_filename (tmpdir, filelist[i], NULL); if (!asb_plugin_process_filename (filename, app, tmpdir, &error_local)) { asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_INFO, "Failed to read KDE service file %s: %s", filelist[i], error_local->message); g_clear_error (&error_local); } } return TRUE; }