Ejemplo n.º 1
0
/**
 * 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;
}
Ejemplo n.º 2
0
/**
 * 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 any GIR files */
	filelist = asb_package_get_filelist (pkg);
	for (i = 0; filelist[i] != NULL; i++) {
		if (!_asb_plugin_check_filename (filelist[i]))
			continue;
		if (!asb_plugin_process_gir (app, tmpdir, filelist[i], error))
			return FALSE;
	}
	return TRUE;
}
Ejemplo n.º 3
0
/**
 * 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;
}
Ejemplo n.º 4
0
/**
 * 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_MODERN_TOOLKIT))
		return TRUE;

	/* look for any GIR files */
	filelist = asb_package_get_filelist (pkg);
	for (i = 0; filelist[i] != NULL; i++) {
		if (!_asb_plugin_check_filename (filelist[i]))
			continue;
		if (!asb_plugin_process_gir (app, tmpdir, filelist[i], error))
			return FALSE;
	}
	return TRUE;
}
Ejemplo n.º 5
0
/**
 * asb_plugin_check_filename:
 */
gboolean
asb_plugin_check_filename (AsbPlugin *plugin, const gchar *filename)
{
	return _asb_plugin_check_filename (filename);
}