/* database.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from database.vala, do not modify */

/*
 *  pamac-vala
 *
 *  Copyright (C) 2019-2023 Guillaume Benoit <guillaume@manjaro.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a get of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "pamac.h"
#include <glib-object.h>
#include <alpm.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <libsoup/soup.h>
#include <gio/gio.h>
#include <alpm_list.h>
#include <fnmatch.h>
#include <glib/gi18n-lib.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define TYPE_ALPM_CONFIG (alpm_config_get_type ())
#define ALPM_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALPM_CONFIG, AlpmConfig))
#define ALPM_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALPM_CONFIG, AlpmConfigClass))
#define IS_ALPM_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALPM_CONFIG))
#define IS_ALPM_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALPM_CONFIG))
#define ALPM_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALPM_CONFIG, AlpmConfigClass))

typedef struct _AlpmConfig AlpmConfig;
typedef struct _AlpmConfigClass AlpmConfigClass;

#define PAMAC_TYPE_AUR_PACKAGE_LINKED (pamac_aur_package_linked_get_type ())
#define PAMAC_AUR_PACKAGE_LINKED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR_PACKAGE_LINKED, PamacAURPackageLinked))
#define PAMAC_AUR_PACKAGE_LINKED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_AUR_PACKAGE_LINKED, PamacAURPackageLinkedClass))
#define PAMAC_IS_AUR_PACKAGE_LINKED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR_PACKAGE_LINKED))
#define PAMAC_IS_AUR_PACKAGE_LINKED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_AUR_PACKAGE_LINKED))
#define PAMAC_AUR_PACKAGE_LINKED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_AUR_PACKAGE_LINKED, PamacAURPackageLinkedClass))

typedef struct _PamacAURPackageLinked PamacAURPackageLinked;
typedef struct _PamacAURPackageLinkedClass PamacAURPackageLinkedClass;

#define PAMAC_TYPE_ALPM_PACKAGE_LINKED (pamac_alpm_package_linked_get_type ())
#define PAMAC_ALPM_PACKAGE_LINKED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_ALPM_PACKAGE_LINKED, PamacAlpmPackageLinked))
#define PAMAC_ALPM_PACKAGE_LINKED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_ALPM_PACKAGE_LINKED, PamacAlpmPackageLinkedClass))
#define PAMAC_IS_ALPM_PACKAGE_LINKED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_ALPM_PACKAGE_LINKED))
#define PAMAC_IS_ALPM_PACKAGE_LINKED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_ALPM_PACKAGE_LINKED))
#define PAMAC_ALPM_PACKAGE_LINKED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_ALPM_PACKAGE_LINKED, PamacAlpmPackageLinkedClass))

typedef struct _PamacAlpmPackageLinked PamacAlpmPackageLinked;
typedef struct _PamacAlpmPackageLinkedClass PamacAlpmPackageLinkedClass;

#define PAMAC_TYPE_AUR_PLUGIN (pamac_aur_plugin_get_type ())
#define PAMAC_AUR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR_PLUGIN, PamacAURPlugin))
#define PAMAC_IS_AUR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR_PLUGIN))
#define PAMAC_AUR_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PAMAC_TYPE_AUR_PLUGIN, PamacAURPluginIface))

typedef struct _PamacAURPlugin PamacAURPlugin;
typedef struct _PamacAURPluginIface PamacAURPluginIface;

#define PAMAC_TYPE_AUR_INFOS (pamac_aur_infos_get_type ())
#define PAMAC_AUR_INFOS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR_INFOS, PamacAURInfos))
#define PAMAC_AUR_INFOS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_AUR_INFOS, PamacAURInfosClass))
#define PAMAC_IS_AUR_INFOS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR_INFOS))
#define PAMAC_IS_AUR_INFOS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_AUR_INFOS))
#define PAMAC_AUR_INFOS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_AUR_INFOS, PamacAURInfosClass))

typedef struct _PamacAURInfos PamacAURInfos;
typedef struct _PamacAURInfosClass PamacAURInfosClass;

#define PAMAC_TYPE_APPSTREAM_PLUGIN (pamac_appstream_plugin_get_type ())
#define PAMAC_APPSTREAM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_APPSTREAM_PLUGIN, PamacAppstreamPlugin))
#define PAMAC_IS_APPSTREAM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_APPSTREAM_PLUGIN))
#define PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PAMAC_TYPE_APPSTREAM_PLUGIN, PamacAppstreamPluginIface))

typedef struct _PamacAppstreamPlugin PamacAppstreamPlugin;
typedef struct _PamacAppstreamPluginIface PamacAppstreamPluginIface;

#define PAMAC_TYPE_APP (pamac_app_get_type ())
#define PAMAC_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_APP, PamacApp))
#define PAMAC_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_APP, PamacAppClass))
#define PAMAC_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_APP))
#define PAMAC_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_APP))
#define PAMAC_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_APP, PamacAppClass))

typedef struct _PamacApp PamacApp;
typedef struct _PamacAppClass PamacAppClass;

#define PAMAC_TYPE_SNAP_PLUGIN (pamac_snap_plugin_get_type ())
#define PAMAC_SNAP_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_SNAP_PLUGIN, PamacSnapPlugin))
#define PAMAC_IS_SNAP_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_SNAP_PLUGIN))
#define PAMAC_SNAP_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PAMAC_TYPE_SNAP_PLUGIN, PamacSnapPluginIface))

typedef struct _PamacSnapPlugin PamacSnapPlugin;
typedef struct _PamacSnapPluginIface PamacSnapPluginIface;

#define PAMAC_TYPE_FLATPAK_PLUGIN (pamac_flatpak_plugin_get_type ())
#define PAMAC_FLATPAK_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_FLATPAK_PLUGIN, PamacFlatpakPlugin))
#define PAMAC_IS_FLATPAK_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_FLATPAK_PLUGIN))
#define PAMAC_FLATPAK_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PAMAC_TYPE_FLATPAK_PLUGIN, PamacFlatpakPluginIface))

typedef struct _PamacFlatpakPlugin PamacFlatpakPlugin;
typedef struct _PamacFlatpakPluginIface PamacFlatpakPluginIface;
enum  {
	PAMAC_DATABASE_0_PROPERTY,
	PAMAC_DATABASE_CONFIG_PROPERTY,
	PAMAC_DATABASE_CONTEXT_PROPERTY,
	PAMAC_DATABASE_DBS_MISSING_PROPERTY,
	PAMAC_DATABASE_NUM_PROPERTIES
};
static GParamSpec* pamac_database_properties[PAMAC_DATABASE_NUM_PROPERTIES];
#define _alpm_config_unref0(var) ((var == NULL) ? NULL : (var = (alpm_config_unref (var), NULL)))
#define _alpm_release0(var) ((var == NULL) ? NULL : (var = (alpm_release (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
typedef struct _PamacDatabaseGetMirrorsCountriesAsyncData PamacDatabaseGetMirrorsCountriesAsyncData;
typedef struct _Block2Data Block2Data;
typedef struct _PamacDatabaseGetMirrorsChoosenCountryAsyncData PamacDatabaseGetMirrorsChoosenCountryAsyncData;
#define _alpm_dep_free0(var) ((var == NULL) ? NULL : (var = (alpm_dep_free (var), NULL)))
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;
typedef struct _PamacDatabaseGetCleanCacheDetailsAsyncData PamacDatabaseGetCleanCacheDetailsAsyncData;
typedef struct _Block5Data Block5Data;
typedef struct _PamacDatabaseGetBuildFilesDetailsAsyncData PamacDatabaseGetBuildFilesDetailsAsyncData;
typedef struct _AlpmConfigPrivate AlpmConfigPrivate;
typedef struct _Block6Data Block6Data;
typedef struct _PamacDatabaseGetUninstalledOptdepsAsyncData PamacDatabaseGetUninstalledOptdepsAsyncData;

#define PAMAC_TYPE_ALPM_PACKAGE_STATIC (pamac_alpm_package_static_get_type ())
#define PAMAC_ALPM_PACKAGE_STATIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_ALPM_PACKAGE_STATIC, PamacAlpmPackageStatic))
#define PAMAC_ALPM_PACKAGE_STATIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_ALPM_PACKAGE_STATIC, PamacAlpmPackageStaticClass))
#define PAMAC_IS_ALPM_PACKAGE_STATIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_ALPM_PACKAGE_STATIC))
#define PAMAC_IS_ALPM_PACKAGE_STATIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_ALPM_PACKAGE_STATIC))
#define PAMAC_ALPM_PACKAGE_STATIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_ALPM_PACKAGE_STATIC, PamacAlpmPackageStaticClass))

typedef struct _PamacAlpmPackageStatic PamacAlpmPackageStatic;
typedef struct _PamacAlpmPackageStaticClass PamacAlpmPackageStaticClass;
typedef struct _Block7Data Block7Data;
typedef struct _PamacDatabaseGetInstalledPkgsAsyncData PamacDatabaseGetInstalledPkgsAsyncData;
typedef struct _Block8Data Block8Data;
typedef struct _PamacDatabaseGetInstalledAppsAsyncData PamacDatabaseGetInstalledAppsAsyncData;
#define _alpm_list_free0(var) ((var == NULL) ? NULL : (var = (alpm_list_free (var), NULL)))
typedef struct _Block9Data Block9Data;
typedef struct _PamacDatabaseGetExplicitlyInstalledPkgsAsyncData PamacDatabaseGetExplicitlyInstalledPkgsAsyncData;
typedef struct _Block10Data Block10Data;
typedef struct _PamacDatabaseGetForeignPkgsAsyncData PamacDatabaseGetForeignPkgsAsyncData;
typedef struct _Block11Data Block11Data;
typedef struct _PamacDatabaseGetOrphansAsyncData PamacDatabaseGetOrphansAsyncData;
#define _g_uri_unref0(var) ((var == NULL) ? NULL : (var = (g_uri_unref (var), NULL)))
typedef struct _PamacDatabaseGetUrlStreamData PamacDatabaseGetUrlStreamData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _Block12Data Block12Data;
typedef struct _PamacDatabaseSearchInstalledPkgsAsyncData PamacDatabaseSearchInstalledPkgsAsyncData;
typedef struct _Block13Data Block13Data;
typedef struct _PamacDatabaseSearchReposPkgsAsyncData PamacDatabaseSearchReposPkgsAsyncData;
typedef struct _Block14Data Block14Data;
typedef struct _PamacDatabaseSearchPkgsAsyncData PamacDatabaseSearchPkgsAsyncData;
typedef struct _Block15Data Block15Data;
typedef struct _PamacDatabaseSearchAurPkgsAsyncData PamacDatabaseSearchAurPkgsAsyncData;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
typedef struct _Block16Data Block16Data;
typedef struct _Block17Data Block17Data;
typedef struct _PamacDatabaseGetCategoryPkgsAsyncData PamacDatabaseGetCategoryPkgsAsyncData;
typedef struct _Block18Data Block18Data;
typedef struct _PamacDatabaseGetRepoPkgsAsyncData PamacDatabaseGetRepoPkgsAsyncData;
typedef struct _Block19Data Block19Data;
typedef struct _PamacDatabaseGetGroupPkgsAsyncData PamacDatabaseGetGroupPkgsAsyncData;
typedef struct _Block20Data Block20Data;
typedef struct _PamacDatabaseGetPkgFilesAsyncData PamacDatabaseGetPkgFilesAsyncData;
typedef struct _Block21Data Block21Data;
typedef struct _PamacDatabaseCloneBuildFilesAsyncData PamacDatabaseCloneBuildFilesAsyncData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block22Data Block22Data;
typedef struct _PamacDatabaseRegenerateSrcinfoAsyncData PamacDatabaseRegenerateSrcinfoAsyncData;
typedef struct _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;
typedef struct _PamacDatabaseGetAurPkgAsyncData PamacDatabaseGetAurPkgAsyncData;
typedef struct _Block25Data Block25Data;
typedef struct _PamacDatabaseGetAurPkgsAsyncData PamacDatabaseGetAurPkgsAsyncData;
typedef struct _Block26Data Block26Data;
typedef struct _PamacDatabaseRefreshTmpFilesDbsAsyncData PamacDatabaseRefreshTmpFilesDbsAsyncData;
typedef struct _Block27Data Block27Data;
typedef struct _PamacDatabaseGetUpdatesAsyncData PamacDatabaseGetUpdatesAsyncData;
typedef struct _Block28Data Block28Data;
typedef struct _PamacDatabaseGetAurUpdatesAsyncData PamacDatabaseGetAurUpdatesAsyncData;
typedef struct _Block29Data Block29Data;
typedef struct _PamacDatabaseSearchSnapsAsyncData PamacDatabaseSearchSnapsAsyncData;
typedef struct _Block30Data Block30Data;
typedef struct _Block31Data Block31Data;
typedef struct _PamacDatabaseGetSnapAsyncData PamacDatabaseGetSnapAsyncData;
typedef struct _Block32Data Block32Data;
typedef struct _PamacDatabaseGetInstalledSnapsAsyncData PamacDatabaseGetInstalledSnapsAsyncData;
typedef struct _Block33Data Block33Data;
typedef struct _Block34Data Block34Data;
typedef struct _PamacDatabaseGetInstalledSnapIconAsyncData PamacDatabaseGetInstalledSnapIconAsyncData;
typedef struct _Block35Data Block35Data;
typedef struct _Block36Data Block36Data;
typedef struct _PamacDatabaseGetCategorySnapsAsyncData PamacDatabaseGetCategorySnapsAsyncData;
typedef struct _Block37Data Block37Data;
typedef struct _PamacDatabaseRefreshFlatpakAppstreamDataAsyncData PamacDatabaseRefreshFlatpakAppstreamDataAsyncData;
typedef struct _Block38Data Block38Data;
typedef struct _PamacDatabaseGetInstalledFlatpaksAsyncData PamacDatabaseGetInstalledFlatpaksAsyncData;
typedef struct _Block39Data Block39Data;
typedef struct _Block40Data Block40Data;
typedef struct _PamacDatabaseSearchFlatpaksAsyncData PamacDatabaseSearchFlatpaksAsyncData;
typedef struct _Block41Data Block41Data;
typedef struct _Block42Data Block42Data;
typedef struct _PamacDatabaseGetFlatpakAsyncData PamacDatabaseGetFlatpakAsyncData;
typedef struct _Block43Data Block43Data;
typedef struct _Block44Data Block44Data;
typedef struct _PamacDatabaseGetCategoryFlatpaksAsyncData PamacDatabaseGetCategoryFlatpaksAsyncData;
enum  {
	PAMAC_DATABASE_GET_UPDATES_PROGRESS_SIGNAL,
	PAMAC_DATABASE_EMIT_WARNING_SIGNAL,
	PAMAC_DATABASE_NUM_SIGNALS
};
static guint pamac_database_signals[PAMAC_DATABASE_NUM_SIGNALS] = {0};

struct _PamacAURPluginIface {
	GTypeInterface parent_iface;
	void (*set_real_build_dir) (PamacAURPlugin* self, const gchar* config_aur_build_dir);
	const gchar* (*get_real_build_dir) (PamacAURPlugin* self);
	PamacAURInfos* (*get_infos) (PamacAURPlugin* self, const gchar* pkgname);
	GPtrArray* (*get_multi_infos) (PamacAURPlugin* self, GPtrArray* pkgnames);
	GPtrArray* (*get_providers) (PamacAURPlugin* self, const gchar* depend);
	GPtrArray* (*search) (PamacAURPlugin* self, const gchar* search_string);
};

struct _PamacAppstreamPluginIface {
	GTypeInterface parent_iface;
	void (*load) (PamacAppstreamPlugin* self, GPtrArray* repos_names);
	GPtrArray* (*get_apps) (PamacAppstreamPlugin* self);
	GPtrArray* (*search) (PamacAppstreamPlugin* self, gchar** search_tokens, gint search_tokens_length1);
	GPtrArray* (*get_pkgname_apps) (PamacAppstreamPlugin* self, const gchar* pkgname);
	GHashTable* (*get_category_apps) (PamacAppstreamPlugin* self, const gchar* category);
};

struct _PamacSnapPluginIface {
	GTypeInterface parent_iface;
	void (*search_snaps) (PamacSnapPlugin* self, const gchar* search_string, GPtrArray** pkgs);
	void (*search_uninstalled_snaps_sync) (PamacSnapPlugin* self, const gchar* search_string, GPtrArray** pkgs);
	gboolean (*is_installed_snap) (PamacSnapPlugin* self, const gchar* name);
	PamacSnapPackage* (*get_snap) (PamacSnapPlugin* self, const gchar* name);
	PamacSnapPackage* (*get_snap_by_app_id) (PamacSnapPlugin* self, const gchar* app_id);
	void (*get_installed_snaps) (PamacSnapPlugin* self, GPtrArray** pkgs);
	gchar* (*get_installed_snap_icon) (PamacSnapPlugin* self, const gchar* name, GError** error);
	void (*get_category_snaps) (PamacSnapPlugin* self, const gchar* category, GPtrArray** pkgs);
	gboolean (*trans_run) (PamacSnapPlugin* self, const gchar* sender, gchar** to_install, gint to_install_length1, gchar** to_remove, gint to_remove_length1);
	gboolean (*switch_channel) (PamacSnapPlugin* self, const gchar* sender, const gchar* name, const gchar* channel);
	void (*trans_cancel) (PamacSnapPlugin* self, const gchar* sender);
	void (*refresh) (PamacSnapPlugin* self);
};

struct _PamacFlatpakPluginIface {
	GTypeInterface parent_iface;
	gboolean (*refresh_appstream_data) (PamacFlatpakPlugin* self);
	void (*load_appstream_data) (PamacFlatpakPlugin* self);
	void (*get_remotes_names) (PamacFlatpakPlugin* self, GPtrArray** remotes_names);
	void (*search_flatpaks) (PamacFlatpakPlugin* self, const gchar* search_string, GPtrArray** pkgs);
	void (*search_uninstalled_flatpaks_sync) (PamacFlatpakPlugin* self, gchar** search_terms, gint search_terms_length1, GPtrArray** pkgs);
	gboolean (*is_installed_flatpak) (PamacFlatpakPlugin* self, const gchar* name);
	PamacFlatpakPackage* (*get_flatpak_by_app_id) (PamacFlatpakPlugin* self, const gchar* app_id);
	PamacFlatpakPackage* (*get_flatpak) (PamacFlatpakPlugin* self, const gchar* id);
	void (*get_installed_flatpaks) (PamacFlatpakPlugin* self, GPtrArray** pkgs);
	void (*get_category_flatpaks) (PamacFlatpakPlugin* self, const gchar* category, GPtrArray** pkgs);
	void (*get_flatpak_updates) (PamacFlatpakPlugin* self, GPtrArray** pkgs);
	gboolean (*trans_run) (PamacFlatpakPlugin* self, const gchar* sender, gchar** to_install, gint to_install_length1, gchar** to_remove, gint to_remove_length1, gchar** to_upgrade, gint to_upgrade_length1);
	void (*trans_cancel) (PamacFlatpakPlugin* self, const gchar* sender);
	void (*refresh) (PamacFlatpakPlugin* self);
	guint64 (*get_refresh_period) (PamacFlatpakPlugin* self);
	void (*set_refresh_period) (PamacFlatpakPlugin* self, guint64 value);
};

struct _PamacDatabasePrivate {
	AlpmConfig* alpm_config;
	GRecMutex __lock_alpm_config;
	alpm_handle_t* alpm_handle;
	alpm_handle_t* files_handle;
	GHashTable* aur_vcs_pkgs;
	GHashTable* pkgs_cache;
	GHashTable* aur_pkgs_cache;
	GPtrArray* mirrors_countries;
	gchar* mirrors_choosen_country;
	GPtrArray* groups_names;
	GPtrArray* repos_names;
	GPtrArray* categories_names;
	PamacAURPlugin* aur_plugin;
	PamacAppstreamPlugin* appstream_plugin;
	PamacSnapPlugin* snap_plugin;
	PamacFlatpakPlugin* flatpak_plugin;
	SoupSession* soup_session;
	PamacConfig* _config;
	GMainContext* _context;
	gboolean _dbs_missing;
};

struct _Block1Data {
	int _ref_count_;
	PamacDatabase* self;
	gpointer _async_data_;
};

struct _PamacDatabaseGetMirrorsCountriesAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block1Data* _data1_;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block2Data {
	int _ref_count_;
	PamacDatabase* self;
	gpointer _async_data_;
};

struct _PamacDatabaseGetMirrorsChoosenCountryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	const gchar* result;
	Block2Data* _data2_;
	gchar* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GError* _inner_error0_;
};

struct _Block3Data {
	int _ref_count_;
	GPtrArray* self;
	GCompareFunc compare_func;
};

struct _Block4Data {
	int _ref_count_;
	PamacDatabase* self;
	GHashTable* filenames_size;
	gpointer _async_data_;
};

struct _PamacDatabaseGetCleanCacheDetailsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GHashTable* result;
	Block4Data* _data4_;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GThread* _tmp3_;
	GThread* _tmp4_;
	GError* e;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GHashTable* _tmp7_;
	GError* _inner_error0_;
};

struct _Block5Data {
	int _ref_count_;
	PamacDatabase* self;
	GHashTable* filenames_size;
	gpointer _async_data_;
};

struct _PamacDatabaseGetBuildFilesDetailsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GHashTable* result;
	Block5Data* _data5_;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GThread* _tmp3_;
	GThread* _tmp4_;
	GError* e;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GHashTable* _tmp7_;
	GError* _inner_error0_;
};

struct _AlpmConfig {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AlpmConfigPrivate * priv;
	gchar* dbpath;
	gboolean checkspace;
	GHashTable* ignorepkgs;
	GHashTable* holdpkgs;
	GHashTable* syncfirsts;
};

struct _AlpmConfigClass {
	GTypeClass parent_class;
	void (*finalize) (AlpmConfig *self);
};

struct _Block6Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* optdeps;
	gchar* pkgname_copy;
	gpointer _async_data_;
};

struct _PamacDatabaseGetUninstalledOptdepsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* pkgname;
	GPtrArray* result;
	Block6Data* _data6_;
	GPtrArray* _tmp0_;
	gchar* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block7Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetInstalledPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block7Data* _data7_;
	GPtrArray* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GPtrArray* _tmp5_;
	GError* _inner_error0_;
};

struct _Block8Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetInstalledAppsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block8Data* _data8_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	GPtrArray* _tmp8_;
	GPtrArray* _tmp9_;
	GError* _inner_error0_;
};

struct _Block9Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetExplicitlyInstalledPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block9Data* _data9_;
	GPtrArray* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GPtrArray* _tmp5_;
	GError* _inner_error0_;
};

struct _Block10Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetForeignPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block10Data* _data10_;
	GPtrArray* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GPtrArray* _tmp5_;
	GError* _inner_error0_;
};

struct _Block11Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetOrphansAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block11Data* _data11_;
	GPtrArray* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GPtrArray* _tmp5_;
	GError* _inner_error0_;
};

struct _PamacDatabaseGetUrlStreamData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* url;
	GInputStream* result;
	GUri* uri;
	GUri* _tmp0_;
	SoupMessage* message;
	GUri* _tmp1_;
	SoupMessage* _tmp2_;
	GInputStream* _tmp3_;
	SoupSession* _tmp4_;
	SoupMessage* _tmp5_;
	GInputStream* _tmp6_;
	GInputStream* _tmp7_;
	GError* e;
	GError* _tmp8_;
	GError* _tmp9_;
	GError* _inner_error0_;
};

struct _Block12Data {
	int _ref_count_;
	PamacDatabase* self;
	gchar* search_string_down;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseSearchInstalledPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* search_string;
	GPtrArray* result;
	Block12Data* _data12_;
	gchar* _tmp0_;
	GPtrArray* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block13Data {
	int _ref_count_;
	PamacDatabase* self;
	gchar* search_string_down;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseSearchReposPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* search_string;
	GPtrArray* result;
	Block13Data* _data13_;
	gchar* _tmp0_;
	GPtrArray* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block14Data {
	int _ref_count_;
	PamacDatabase* self;
	gchar* search_string_down;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseSearchPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* search_string;
	GPtrArray* result;
	Block14Data* _data14_;
	gchar* _tmp0_;
	GPtrArray* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block15Data {
	int _ref_count_;
	PamacDatabase* self;
	gchar* search_string_down;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseSearchAurPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* search_string;
	GPtrArray* result;
	Block15Data* _data15_;
	gchar* _tmp0_;
	GPtrArray* _tmp1_;
	PamacConfig* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	GError* _inner_error0_;
};

struct _Block16Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _Block17Data {
	int _ref_count_;
	Block16Data * _data16_;
	gchar* category_copy;
};

struct _PamacDatabaseGetCategoryPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* category;
	GPtrArray* result;
	Block16Data* _data16_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	Block17Data* _data17_;
	gchar* _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	GError* _inner_error0_;
};

struct _Block18Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gchar* repo_copy;
	gpointer _async_data_;
};

struct _PamacDatabaseGetRepoPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* repo;
	GPtrArray* result;
	Block18Data* _data18_;
	GPtrArray* _tmp0_;
	gchar* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block19Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gchar* group_name_copy;
	gpointer _async_data_;
};

struct _PamacDatabaseGetGroupPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* group_name;
	GPtrArray* result;
	Block19Data* _data19_;
	GPtrArray* _tmp0_;
	gchar* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GError* e;
	GError* _tmp4_;
	const gchar* _tmp5_;
	GPtrArray* _tmp6_;
	GError* _inner_error0_;
};

struct _Block20Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* files;
	gchar* pkgname;
	alpm_pkg_t* local_pkg;
	gpointer _async_data_;
};

struct _PamacDatabaseGetPkgFilesAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* pkgname;
	alpm_pkg_t* local_pkg;
	GPtrArray* result;
	Block20Data* _data20_;
	GPtrArray* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GPtrArray* _tmp5_;
	GError* _inner_error0_;
};

struct _Block21Data {
	int _ref_count_;
	PamacDatabase* self;
	GFile* file;
	gchar* pkgname_copy;
	gboolean overwrite_files;
	GCancellable* cancellable;
	gpointer _async_data_;
};

struct _PamacDatabaseCloneBuildFilesAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* pkgname;
	gboolean overwrite_files;
	GCancellable* cancellable;
	GFile* result;
	Block21Data* _data21_;
	gchar* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GFile* _tmp5_;
	GError* _inner_error0_;
};

struct _Block22Data {
	int _ref_count_;
	PamacDatabase* self;
	gboolean success;
	gchar* pkgname_copy;
	GCancellable* cancellable;
	gpointer _async_data_;
};

struct _PamacDatabaseRegenerateSrcinfoAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* pkgname;
	GCancellable* cancellable;
	gboolean result;
	Block22Data* _data22_;
	gchar* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	GError* _inner_error0_;
};

struct _Block23Data {
	int _ref_count_;
	PamacDatabase* self;
	PamacAURPackage* pkg;
	gpointer _async_data_;
};

struct _Block24Data {
	int _ref_count_;
	Block23Data * _data23_;
	gchar* pkgname_copy;
};

struct _PamacDatabaseGetAurPkgAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* pkgname;
	PamacAURPackage* result;
	Block23Data* _data23_;
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	Block24Data* _data24_;
	gchar* _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	PamacAURPackage* _tmp8_;
	GError* _inner_error0_;
};

struct _Block25Data {
	int _ref_count_;
	PamacDatabase* self;
	GHashTable* data;
	GPtrArray* pkgnames;
	gpointer _async_data_;
};

struct _PamacDatabaseGetAurPkgsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* pkgnames;
	GHashTable* result;
	Block25Data* _data25_;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	PamacConfig* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GHashTable* _tmp6_;
	GHashTable* _tmp7_;
	GThread* _tmp8_;
	GThread* _tmp9_;
	GError* e;
	GError* _tmp10_;
	const gchar* _tmp11_;
	GHashTable* _tmp12_;
	GHashTable* _tmp13_;
	GError* _inner_error0_;
};

struct _Block26Data {
	int _ref_count_;
	PamacDatabase* self;
	gpointer _async_data_;
};

struct _PamacDatabaseRefreshTmpFilesDbsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	Block26Data* _data26_;
	GThread* _tmp0_;
	GThread* _tmp1_;
	GError* e;
	GError* _tmp2_;
	const gchar* _tmp3_;
	GError* _inner_error0_;
};

struct _Block27Data {
	int _ref_count_;
	PamacDatabase* self;
	PamacUpdates* updates;
	gpointer _async_data_;
};

struct _PamacDatabaseGetUpdatesAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	PamacUpdates* result;
	Block27Data* _data27_;
	PamacUpdates* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	PamacUpdates* _tmp5_;
	GError* _inner_error0_;
};

struct _Block28Data {
	int _ref_count_;
	PamacDatabase* self;
	PamacUpdates* updates;
	GHashTable* ignorepkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetAurUpdatesAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GHashTable* ignorepkgs;
	PamacUpdates* result;
	Block28Data* _data28_;
	PamacUpdates* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GError* e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	PamacUpdates* _tmp5_;
	GError* _inner_error0_;
};

struct _Block29Data {
	int _ref_count_;
	PamacDatabase* self;
	gchar* search_string_down;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseSearchSnapsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* search_string;
	GPtrArray* result;
	Block29Data* _data29_;
	gchar* _tmp0_;
	GPtrArray* _tmp1_;
	PamacConfig* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	GError* _inner_error0_;
};

struct _Block30Data {
	int _ref_count_;
	PamacDatabase* self;
	PamacSnapPackage* pkg;
	gpointer _async_data_;
};

struct _Block31Data {
	int _ref_count_;
	Block30Data * _data30_;
	gchar* name_copy;
};

struct _PamacDatabaseGetSnapAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* name;
	PamacSnapPackage* result;
	Block30Data* _data30_;
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	Block31Data* _data31_;
	gchar* _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	PamacSnapPackage* _tmp8_;
	GError* _inner_error0_;
};

struct _Block32Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetInstalledSnapsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block32Data* _data32_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	GPtrArray* _tmp8_;
	GPtrArray* _tmp9_;
	GError* _inner_error0_;
};

struct _Block33Data {
	int _ref_count_;
	PamacDatabase* self;
	gchar* icon;
	gpointer _async_data_;
};

struct _Block34Data {
	int _ref_count_;
	Block33Data * _data33_;
	gchar* name_copy;
};

struct _PamacDatabaseGetInstalledSnapIconAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* name;
	gchar* result;
	Block33Data* _data33_;
	gchar* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	Block34Data* _data34_;
	gchar* _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	GError* _inner_error0_;
};

struct _Block35Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _Block36Data {
	int _ref_count_;
	Block35Data * _data35_;
	gchar* category_copy;
};

struct _PamacDatabaseGetCategorySnapsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* category;
	GPtrArray* result;
	Block35Data* _data35_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	Block36Data* _data36_;
	gchar* _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	GError* _inner_error0_;
};

struct _Block37Data {
	int _ref_count_;
	PamacDatabase* self;
	gpointer _async_data_;
};

struct _PamacDatabaseRefreshFlatpakAppstreamDataAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	Block37Data* _data37_;
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GThread* _tmp3_;
	GThread* _tmp4_;
	GError* e;
	GError* _tmp5_;
	const gchar* _tmp6_;
	GError* _inner_error0_;
};

struct _Block38Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _PamacDatabaseGetInstalledFlatpaksAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	GPtrArray* result;
	Block38Data* _data38_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	GPtrArray* _tmp8_;
	GPtrArray* _tmp9_;
	GError* _inner_error0_;
};

struct _Block39Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _Block40Data {
	int _ref_count_;
	Block39Data * _data39_;
	gchar* search_string_down;
};

struct _PamacDatabaseSearchFlatpaksAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* search_string;
	GPtrArray* result;
	Block39Data* _data39_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	Block40Data* _data40_;
	gchar* _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	GError* _inner_error0_;
};

struct _Block41Data {
	int _ref_count_;
	PamacDatabase* self;
	PamacFlatpakPackage* pkg;
	gpointer _async_data_;
};

struct _Block42Data {
	int _ref_count_;
	Block41Data * _data41_;
	gchar* id_copy;
};

struct _PamacDatabaseGetFlatpakAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* id;
	PamacFlatpakPackage* result;
	Block41Data* _data41_;
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	Block42Data* _data42_;
	gchar* _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* e;
	GError* _tmp6_;
	const gchar* _tmp7_;
	PamacFlatpakPackage* _tmp8_;
	GError* _inner_error0_;
};

struct _Block43Data {
	int _ref_count_;
	PamacDatabase* self;
	GPtrArray* pkgs;
	gpointer _async_data_;
};

struct _Block44Data {
	int _ref_count_;
	Block43Data * _data43_;
	gchar* category_copy;
};

struct _PamacDatabaseGetCategoryFlatpaksAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PamacDatabase* self;
	gchar* category;
	GPtrArray* result;
	Block43Data* _data43_;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	Block44Data* _data44_;
	gchar* _tmp4_;
	GThread* _tmp5_;
	GThread* _tmp6_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GPtrArray* _tmp10_;
	GError* _inner_error0_;
};

static gint PamacDatabase_private_offset;
static gpointer pamac_database_parent_class = NULL;

VALA_EXTERN gpointer alpm_config_ref (gpointer instance);
VALA_EXTERN void alpm_config_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_alpm_config (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_alpm_config (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_alpm_config (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_alpm_config (const GValue* value);
VALA_EXTERN GType alpm_config_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_aur_package_linked_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_alpm_package_linked_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_aur_infos_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_aur_plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_app_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_appstream_plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_snap_plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_flatpak_plugin_get_type (void) G_GNUC_CONST ;
static gint _alpm_pkg_vercmp_gcompare_func (gconstpointer a,
                                     gconstpointer b);
VALA_EXTERN void pamac_database_refresh (PamacDatabase* self);
VALA_EXTERN void alpm_config_reload (AlpmConfig* self);
VALA_EXTERN alpm_handle_t* alpm_config_get_handle (AlpmConfig* self,
                                       gboolean files_db,
                                       gboolean tmp_db,
                                       gboolean copy_dbs);
VALA_EXTERN void alpm_config_register_syncdbs (AlpmConfig* self,
                                   alpm_handle_t* handle);
VALA_EXTERN void pamac_snap_plugin_refresh (PamacSnapPlugin* self);
VALA_EXTERN void pamac_flatpak_plugin_refresh (PamacFlatpakPlugin* self);
VALA_EXTERN alpm_handle_t* pamac_database_get_tmp_handle (PamacDatabase* self);
static void pamac_database_get_mirrors_countries_async_data_free (gpointer _data);
static gboolean pamac_database_get_mirrors_countries_async_co (PamacDatabaseGetMirrorsCountriesAsyncData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gint ___lambda5_ (Block1Data* _data1_);
static void _g_free0_ (gpointer var);
VALA_EXTERN GMainContext* pamac_database_get_context (PamacDatabase* self);
static gboolean _pamac_database_get_mirrors_countries_async_co_gsource_func (gpointer self);
static gpointer ____lambda5__gthread_func (gpointer self);
static void pamac_database_get_mirrors_choosen_country_async_data_free (gpointer _data);
static gboolean pamac_database_get_mirrors_choosen_country_async_co (PamacDatabaseGetMirrorsChoosenCountryAsyncData* _data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gint ___lambda6_ (Block2Data* _data2_);
static gboolean _pamac_database_get_mirrors_choosen_country_async_co_gsource_func (gpointer self);
static gpointer ____lambda6__gthread_func (gpointer self);
static void pamac_database_get_clean_cache_details_real (PamacDatabase* self,
                                                  GHashTable** filenames_size);
static void _g_ptr_array_unref0_ (gpointer var);
static guint64* _uint64_dup (guint64* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gint ___lambda0__gcompare_data_func (gconstpointer a,
                                     gconstpointer b,
                                     gpointer self);
static gint ____lambda7_ (const gchar* version1,
                   const gchar* version2);
static gint _____lambda7__gcompare_func (gconstpointer a,
                                  gconstpointer b);
static void pamac_database_get_clean_cache_details_async_data_free (gpointer _data);
static gboolean pamac_database_get_clean_cache_details_async_co (PamacDatabaseGetCleanCacheDetailsAsyncData* _data_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static gint ___lambda8_ (Block4Data* _data4_);
static gboolean _pamac_database_get_clean_cache_details_async_co_gsource_func (gpointer self);
static gpointer ____lambda8__gthread_func (gpointer self);
VALA_EXTERN const gchar* pamac_aur_plugin_get_real_build_dir (PamacAURPlugin* self);
VALA_EXTERN GPtrArray* pamac_database_get_aur_providers (PamacDatabase* self,
                                             const gchar* pkgname);
VALA_EXTERN GPtrArray* pamac_aur_plugin_get_providers (PamacAURPlugin* self,
                                           const gchar* depend);
static void pamac_database_get_build_files_details_real (PamacDatabase* self,
                                                  GHashTable** filenames_size);
static void pamac_database_get_build_files_details_async_data_free (gpointer _data);
static gboolean pamac_database_get_build_files_details_async_co (PamacDatabaseGetBuildFilesDetailsAsyncData* _data_);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static gint ___lambda9_ (Block5Data* _data5_);
static gboolean _pamac_database_get_build_files_details_async_co_gsource_func (gpointer self);
static gpointer ____lambda9__gthread_func (gpointer self);
VALA_EXTERN alpm_pkg_t* pamac_database_intern_get_local_pkg (PamacDatabase* self,
                                                 const gchar* pkgname);
static PamacAlpmPackage* pamac_database_initialise_pkg (PamacDatabase* self,
                                                 alpm_pkg_t* alpm_pkg,
                                                 alpm_pkg_t* sync_pkg);
static void pamac_database_get_uninstalled_optdeps_async_data_free (gpointer _data);
VALA_EXTERN void pamac_database_get_uninstalled_optdeps_async (PamacDatabase* self,
                                                   const gchar* pkgname,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
VALA_EXTERN GPtrArray* pamac_database_get_uninstalled_optdeps_finish (PamacDatabase* self,
                                                          GAsyncResult* _res_);
static gboolean pamac_database_get_uninstalled_optdeps_async_co (PamacDatabaseGetUninstalledOptdepsAsyncData* _data_);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static gint ___lambda10_ (Block6Data* _data6_);
static alpm_pkg_t* pamac_database_get_syncpkg (PamacDatabase* self,
                                        alpm_handle_t* handle,
                                        const gchar* pkgname);
static gboolean _pamac_database_get_uninstalled_optdeps_async_co_gsource_func (gpointer self);
static gpointer ____lambda10__gthread_func (gpointer self);
VALA_EXTERN GType pamac_alpm_package_static_get_type (void) G_GNUC_CONST ;
static PamacAlpmPackageStatic* pamac_database_initialise_pkg_data (PamacDatabase* self,
                                                            alpm_pkg_t* local_pkg,
                                                            alpm_pkg_t* sync_pkg);
VALA_EXTERN PamacAlpmPackageStatic* pamac_alpm_package_static_new (alpm_pkg_t* alpm_pkg,
                                                       alpm_pkg_t* local_pkg,
                                                       alpm_pkg_t* sync_pkg);
VALA_EXTERN PamacAlpmPackageStatic* pamac_alpm_package_static_construct (GType object_type,
                                                             alpm_pkg_t* alpm_pkg,
                                                             alpm_pkg_t* local_pkg,
                                                             alpm_pkg_t* sync_pkg);
VALA_EXTERN GPtrArray* pamac_appstream_plugin_get_pkgname_apps (PamacAppstreamPlugin* self,
                                                    const gchar* pkgname);
VALA_EXTERN void pamac_alpm_package_linked_set_app (PamacAlpmPackageLinked* self,
                                        PamacApp* app);
VALA_EXTERN PamacAlpmPackageLinked* pamac_alpm_package_linked_new_from_alpm (alpm_pkg_t* alpm_pkg,
                                                                 PamacDatabase* database);
VALA_EXTERN PamacAlpmPackageLinked* pamac_alpm_package_linked_construct_from_alpm (GType object_type,
                                                                       alpm_pkg_t* alpm_pkg,
                                                                       PamacDatabase* database);
VALA_EXTERN void pamac_alpm_package_linked_set_sync_pkg (PamacAlpmPackageLinked* self,
                                             alpm_pkg_t* sync_pkg);
VALA_EXTERN void pamac_alpm_package_linked_set_local_pkg (PamacAlpmPackageLinked* self,
                                              alpm_pkg_t* local_pkg);
VALA_EXTERN PamacAURInfos* pamac_aur_plugin_get_infos (PamacAURPlugin* self,
                                           const gchar* pkgname);
VALA_EXTERN void pamac_package_set_repo (PamacPackage* self,
                             const gchar* value);
static void pamac_database_initialise_pkgs (PamacDatabase* self,
                                     alpm_list_t* alpm_pkgs,
                                     GPtrArray** pkgs);
static void _g_object_unref0_ (gpointer var);
VALA_EXTERN const gchar* pamac_app_get_id (PamacApp* self);
VALA_EXTERN GPtrArray* pamac_aur_plugin_get_multi_infos (PamacAURPlugin* self,
                                             GPtrArray* pkgnames);
VALA_EXTERN const gchar* pamac_aur_infos_get_name (PamacAURInfos* self);
static void pamac_database_get_installed_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_installed_pkgs_async_co (PamacDatabaseGetInstalledPkgsAsyncData* _data_);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gint ___lambda11_ (Block7Data* _data7_);
static gboolean _pamac_database_get_installed_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda11__gthread_func (gpointer self);
static void pamac_database_get_installed_apps_async_data_free (gpointer _data);
static gboolean pamac_database_get_installed_apps_async_co (PamacDatabaseGetInstalledAppsAsyncData* _data_);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static gint ____lambda12_ (Block8Data* _data8_);
VALA_EXTERN GPtrArray* pamac_appstream_plugin_get_apps (PamacAppstreamPlugin* self);
VALA_EXTERN const gchar* pamac_app_get_pkgname (PamacApp* self);
static gboolean _pamac_database_get_installed_apps_async_co_gsource_func (gpointer self);
static gpointer _____lambda12__gthread_func (gpointer self);
static void pamac_database_get_explicitly_installed_pkgs_real (PamacDatabase* self,
                                                        GPtrArray** pkgs);
static void pamac_database_get_explicitly_installed_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_explicitly_installed_pkgs_async_co (PamacDatabaseGetExplicitlyInstalledPkgsAsyncData* _data_);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static gint ___lambda13_ (Block9Data* _data9_);
static gboolean _pamac_database_get_explicitly_installed_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda13__gthread_func (gpointer self);
static void pamac_database_get_foreign_pkgs_real (PamacDatabase* self,
                                           GPtrArray** pkgs);
static gboolean pamac_database_is_syncpkg (PamacDatabase* self,
                                    const gchar* pkgname);
static void pamac_database_get_foreign_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_foreign_pkgs_async_co (PamacDatabaseGetForeignPkgsAsyncData* _data_);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static gint ___lambda14_ (Block10Data* _data10_);
static gboolean _pamac_database_get_foreign_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda14__gthread_func (gpointer self);
static void pamac_database_get_orphans_real (PamacDatabase* self,
                                      GPtrArray** pkgs);
static void _g_free_alpm_list_fn_free (gconstpointer a);
static void pamac_database_get_orphans_async_data_free (gpointer _data);
static gboolean pamac_database_get_orphans_async_co (PamacDatabaseGetOrphansAsyncData* _data_);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static gint ___lambda15_ (Block11Data* _data11_);
static gboolean _pamac_database_get_orphans_async_co_gsource_func (gpointer self);
static gpointer ____lambda15__gthread_func (gpointer self);
VALA_EXTERN alpm_pkg_t* pamac_database_intern_get_syncpkg (PamacDatabase* self,
                                               const gchar* pkgname);
static alpm_pkg_t* pamac_database_find_dbs_satisfier (PamacDatabase* self,
                                               const gchar* depstring);
VALA_EXTERN PamacFlatpakPackage* pamac_flatpak_plugin_get_flatpak_by_app_id (PamacFlatpakPlugin* self,
                                                                 const gchar* app_id);
VALA_EXTERN PamacSnapPackage* pamac_snap_plugin_get_snap_by_app_id (PamacSnapPlugin* self,
                                                        const gchar* app_id);
static void pamac_database_get_url_stream_data_free (gpointer _data);
static gboolean pamac_database_get_url_stream_co (PamacDatabaseGetUrlStreamData* _data_);
static void pamac_database_get_url_stream_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static alpm_list_t* pamac_database_custom_db_search (PamacDatabase* self,
                                              alpm_db_t* db,
                                              alpm_list_t* needles);
static alpm_list_t* pamac_database_search_local_db (PamacDatabase* self,
                                             const gchar* search_string);
static alpm_list_t* pamac_database_search_sync_dbs (PamacDatabase* self,
                                             const gchar* search_string);
VALA_EXTERN gint alpm_pkg_compare_name (alpm_pkg_t* pkg_a,
                            alpm_pkg_t* pkg_b);
static void pamac_database_search_installed_pkgs_real (PamacDatabase* self,
                                                const gchar* search_string,
                                                GPtrArray** pkgs);
VALA_EXTERN GPtrArray* pamac_appstream_plugin_search (PamacAppstreamPlugin* self,
                                          gchar** search_tokens,
                                          gint search_tokens_length1);
static void pamac_database_search_installed_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_search_installed_pkgs_async_co (PamacDatabaseSearchInstalledPkgsAsyncData* _data_);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static gint ___lambda16_ (Block12Data* _data12_);
static gboolean _pamac_database_search_installed_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda16__gthread_func (gpointer self);
static void pamac_database_search_repos_pkgs_real (PamacDatabase* self,
                                            const gchar* search_string,
                                            GPtrArray** pkgs);
static void pamac_database_search_repos_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_search_repos_pkgs_async_co (PamacDatabaseSearchReposPkgsAsyncData* _data_);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static gint ___lambda17_ (Block13Data* _data13_);
static gboolean _pamac_database_search_repos_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda17__gthread_func (gpointer self);
static alpm_list_t* pamac_database_search_all_dbs (PamacDatabase* self,
                                            const gchar* search_string);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static void pamac_database_search_pkgs_real (PamacDatabase* self,
                                      const gchar* search_string,
                                      GPtrArray** pkgs);
static void pamac_database_search_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_search_pkgs_async_co (PamacDatabaseSearchPkgsAsyncData* _data_);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static gint ___lambda18_ (Block14Data* _data14_);
static gboolean _pamac_database_search_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda18__gthread_func (gpointer self);
static void pamac_database_search_aur_pkgs_real (PamacDatabase* self,
                                          const gchar* search_string,
                                          GPtrArray** pkgs);
VALA_EXTERN GPtrArray* pamac_aur_plugin_search (PamacAURPlugin* self,
                                    const gchar* search_string);
VALA_EXTERN PamacAURPackageLinked* pamac_aur_package_linked_new (void);
VALA_EXTERN PamacAURPackageLinked* pamac_aur_package_linked_construct (GType object_type);
VALA_EXTERN void pamac_aur_package_linked_initialise_from_aur_infos (PamacAURPackageLinked* self,
                                                         PamacAURInfos* aur_infos,
                                                         alpm_pkg_t* local_pkg,
                                                         PamacDatabase* database,
                                                         gboolean is_update);
static void pamac_database_search_aur_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_search_aur_pkgs_async_co (PamacDatabaseSearchAurPkgsAsyncData* _data_);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static gint ____lambda19_ (Block15Data* _data15_);
static gboolean _pamac_database_search_aur_pkgs_async_co_gsource_func (gpointer self);
static gpointer _____lambda19__gthread_func (gpointer self);
static GPtrArray* pamac_database_get_apps_pkgs (PamacDatabase* self,
                                         GHashTable* apps);
static void pamac_database_get_category_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_category_pkgs_async_co (PamacDatabaseGetCategoryPkgsAsyncData* _data_);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static gint ____lambda20_ (Block17Data* _data17_);
VALA_EXTERN GHashTable* pamac_appstream_plugin_get_category_apps (PamacAppstreamPlugin* self,
                                                      const gchar* category);
static gboolean _pamac_database_get_category_pkgs_async_co_gsource_func (gpointer self);
static gpointer _____lambda20__gthread_func (gpointer self);
static void pamac_database_get_repo_pkgs_real (PamacDatabase* self,
                                        const gchar* repo,
                                        GPtrArray** pkgs);
static void pamac_database_get_repo_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_repo_pkgs_async_co (PamacDatabaseGetRepoPkgsAsyncData* _data_);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static gint ___lambda21_ (Block18Data* _data18_);
static gboolean _pamac_database_get_repo_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda21__gthread_func (gpointer self);
static void pamac_database_get_group_pkgs_real (PamacDatabase* self,
                                         const gchar* group_name,
                                         GPtrArray** pkgs);
VALA_EXTERN gint pkg_compare_name (PamacPackage* pkg_a,
                       PamacPackage* pkg_b);
static gint _pkg_compare_name_gcompare_func (gconstpointer a,
                                      gconstpointer b);
static void pamac_database_get_group_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_group_pkgs_async_co (PamacDatabaseGetGroupPkgsAsyncData* _data_);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static gint ___lambda22_ (Block19Data* _data19_);
static gboolean _pamac_database_get_group_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda22__gthread_func (gpointer self);
static void pamac_database_get_pkg_files_real (PamacDatabase* self,
                                        const gchar* pkgname,
                                        alpm_pkg_t* local_pkg,
                                        GPtrArray** files);
VALA_EXTERN GPtrArray* pamac_database_get_pkg_files (PamacDatabase* self,
                                         const gchar* pkgname,
                                         alpm_pkg_t* local_pkg);
static void pamac_database_get_pkg_files_async_data_free (gpointer _data);
VALA_EXTERN void pamac_database_get_pkg_files_async (PamacDatabase* self,
                                         const gchar* pkgname,
                                         alpm_pkg_t* local_pkg,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN GPtrArray* pamac_database_get_pkg_files_finish (PamacDatabase* self,
                                                GAsyncResult* _res_);
static gboolean pamac_database_get_pkg_files_async_co (PamacDatabaseGetPkgFilesAsyncData* _data_);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static gint ___lambda4_ (Block20Data* _data20_);
static gboolean _pamac_database_get_pkg_files_async_co_gsource_func (gpointer self);
static gpointer ____lambda4__gthread_func (gpointer self);
static gint pamac_database_launch_subprocess (PamacDatabase* self,
                                       GSubprocessLauncher* launcher,
                                       GPtrArray* cmdline,
                                       GCancellable* cancellable);
static GPtrArray* pamac_database_get_dynamic_user_cmdline (PamacDatabase* self,
                                                    const gchar* cwd);
static gpointer _g_strdup_gcopy_func (gconstpointer src,
                               gpointer self);
static void pamac_database_clone_build_files_async_data_free (gpointer _data);
static gboolean pamac_database_clone_build_files_async_co (PamacDatabaseCloneBuildFilesAsyncData* _data_);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static gint ___lambda23_ (Block21Data* _data21_);
static gboolean _pamac_database_clone_build_files_async_co_gsource_func (gpointer self);
static gpointer ____lambda23__gthread_func (gpointer self);
static void pamac_database_regenerate_srcinfo_async_data_free (gpointer _data);
static gboolean pamac_database_regenerate_srcinfo_async_co (PamacDatabaseRegenerateSrcinfoAsyncData* _data_);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static gint ___lambda24_ (Block22Data* _data22_);
static gboolean _pamac_database_regenerate_srcinfo_async_co_gsource_func (gpointer self);
static gpointer ____lambda24__gthread_func (gpointer self);
static void pamac_database_get_aur_pkg_async_data_free (gpointer _data);
static gboolean pamac_database_get_aur_pkg_async_co (PamacDatabaseGetAurPkgAsyncData* _data_);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static gint ____lambda25_ (Block24Data* _data24_);
static gboolean _pamac_database_get_aur_pkg_async_co_gsource_func (gpointer self);
static gpointer _____lambda25__gthread_func (gpointer self);
static void pamac_database_get_aur_pkgs_real (PamacDatabase* self,
                                       GPtrArray* pkgnames,
                                       GHashTable** data);
static void pamac_database_get_aur_pkgs_async_data_free (gpointer _data);
static gboolean pamac_database_get_aur_pkgs_async_co (PamacDatabaseGetAurPkgsAsyncData* _data_);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static gint ___lambda26_ (Block25Data* _data25_);
static gboolean _pamac_database_get_aur_pkgs_async_co_gsource_func (gpointer self);
static gpointer ____lambda26__gthread_func (gpointer self);
static void pamac_database_refresh_tmp_files_dbs_async_data_free (gpointer _data);
static gboolean pamac_database_refresh_tmp_files_dbs_async_co (PamacDatabaseRefreshTmpFilesDbsAsyncData* _data_);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static gint ___lambda27_ (Block26Data* _data26_);
static gboolean _pamac_database_refresh_tmp_files_dbs_async_co_gsource_func (gpointer self);
static gpointer ____lambda27__gthread_func (gpointer self);
static gint64 pamac_database_get_last_refresh_age (PamacDatabase* self);
static void pamac_database_get_updates_real (PamacDatabase* self,
                                      PamacUpdates** updates);
VALA_EXTERN void pamac_flatpak_plugin_get_flatpak_updates (PamacFlatpakPlugin* self,
                                               GPtrArray** pkgs);
static void pamac_database_refresh_vcs_sources (PamacDatabase* self,
                                         GPtrArray* vcs_local_pkgs);
static gboolean ____lambda28_ (PamacDatabase* self);
static gboolean _____lambda28__gsource_func (gpointer self);
static void pamac_database_get_aur_updates_real (PamacDatabase* self,
                                          GPtrArray* aur_infos_list,
                                          GPtrArray* vcs_local_pkgs,
                                          PamacUpdates** updates);
static gboolean ____lambda29_ (PamacDatabase* self);
static gboolean _____lambda29__gsource_func (gpointer self);
static gboolean ____lambda30_ (PamacDatabase* self);
static gboolean _____lambda30__gsource_func (gpointer self);
VALA_EXTERN PamacUpdates* pamac_updates_new (void);
VALA_EXTERN PamacUpdates* pamac_updates_construct (GType object_type);
static void pamac_database_get_updates_async_data_free (gpointer _data);
static gboolean pamac_database_get_updates_async_co (PamacDatabaseGetUpdatesAsyncData* _data_);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static gint ___lambda31_ (Block27Data* _data27_);
static gboolean _pamac_database_get_updates_async_co_gsource_func (gpointer self);
static gpointer ____lambda31__gthread_func (gpointer self);
VALA_EXTERN const gchar* pamac_aur_infos_get_packagebase (PamacAURInfos* self);
static GHashTable* pamac_database_get_vcs_last_version (PamacDatabase* self,
                                                 GPtrArray* vcs_local_pkgs);
VALA_EXTERN const gchar* pamac_aur_infos_get_version (PamacAURInfos* self);
VALA_EXTERN void pamac_package_set_version (PamacPackage* self,
                                const gchar* value);
VALA_EXTERN GDateTime* pamac_aur_infos_get_outofdate (PamacAURInfos* self);
static void pamac_database_get_aur_updates_async_data_free (gpointer _data);
VALA_EXTERN void pamac_database_get_aur_updates_async (PamacDatabase* self,
                                           GHashTable* ignorepkgs,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN PamacUpdates* pamac_database_get_aur_updates_finish (PamacDatabase* self,
                                                     GAsyncResult* _res_);
static gboolean pamac_database_get_aur_updates_async_co (PamacDatabaseGetAurUpdatesAsyncData* _data_);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static gint ___lambda32_ (Block28Data* _data28_);
static gboolean _pamac_database_get_aur_updates_async_co_gsource_func (gpointer self);
static gpointer ____lambda32__gthread_func (gpointer self);
static void pamac_database_search_snaps_async_data_free (gpointer _data);
static gboolean pamac_database_search_snaps_async_co (PamacDatabaseSearchSnapsAsyncData* _data_);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
static gint ____lambda33_ (Block29Data* _data29_);
VALA_EXTERN void pamac_snap_plugin_search_snaps (PamacSnapPlugin* self,
                                     const gchar* search_string,
                                     GPtrArray** pkgs);
static gboolean _pamac_database_search_snaps_async_co_gsource_func (gpointer self);
static gpointer _____lambda33__gthread_func (gpointer self);
VALA_EXTERN gboolean pamac_snap_plugin_is_installed_snap (PamacSnapPlugin* self,
                                              const gchar* name);
static void pamac_database_get_snap_async_data_free (gpointer _data);
static gboolean pamac_database_get_snap_async_co (PamacDatabaseGetSnapAsyncData* _data_);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static gint ____lambda34_ (Block31Data* _data31_);
VALA_EXTERN PamacSnapPackage* pamac_snap_plugin_get_snap (PamacSnapPlugin* self,
                                              const gchar* name);
static gboolean _pamac_database_get_snap_async_co_gsource_func (gpointer self);
static gpointer _____lambda34__gthread_func (gpointer self);
static void pamac_database_get_installed_snaps_async_data_free (gpointer _data);
static gboolean pamac_database_get_installed_snaps_async_co (PamacDatabaseGetInstalledSnapsAsyncData* _data_);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static gint ____lambda35_ (Block32Data* _data32_);
VALA_EXTERN void pamac_snap_plugin_get_installed_snaps (PamacSnapPlugin* self,
                                            GPtrArray** pkgs);
static gboolean _pamac_database_get_installed_snaps_async_co_gsource_func (gpointer self);
static gpointer _____lambda35__gthread_func (gpointer self);
static void pamac_database_get_installed_snap_icon_async_data_free (gpointer _data);
static gboolean pamac_database_get_installed_snap_icon_async_co (PamacDatabaseGetInstalledSnapIconAsyncData* _data_);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static gint ____lambda36_ (Block34Data* _data34_);
VALA_EXTERN gchar* pamac_snap_plugin_get_installed_snap_icon (PamacSnapPlugin* self,
                                                  const gchar* name,
                                                  GError** error);
static gboolean _pamac_database_get_installed_snap_icon_async_co_gsource_func (gpointer self);
static gpointer _____lambda36__gthread_func (gpointer self);
static void pamac_database_get_category_snaps_async_data_free (gpointer _data);
static gboolean pamac_database_get_category_snaps_async_co (PamacDatabaseGetCategorySnapsAsyncData* _data_);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
static gint ____lambda37_ (Block36Data* _data36_);
VALA_EXTERN void pamac_snap_plugin_get_category_snaps (PamacSnapPlugin* self,
                                           const gchar* category,
                                           GPtrArray** pkgs);
static gboolean _pamac_database_get_category_snaps_async_co_gsource_func (gpointer self);
static gpointer _____lambda37__gthread_func (gpointer self);
VALA_EXTERN gboolean pamac_flatpak_plugin_refresh_appstream_data (PamacFlatpakPlugin* self);
static void pamac_database_refresh_flatpak_appstream_data_async_data_free (gpointer _data);
static gboolean pamac_database_refresh_flatpak_appstream_data_async_co (PamacDatabaseRefreshFlatpakAppstreamDataAsyncData* _data_);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static gint ____lambda38_ (Block37Data* _data37_);
static gboolean _pamac_database_refresh_flatpak_appstream_data_async_co_gsource_func (gpointer self);
static gpointer _____lambda38__gthread_func (gpointer self);
VALA_EXTERN void pamac_flatpak_plugin_get_remotes_names (PamacFlatpakPlugin* self,
                                             GPtrArray** remotes_names);
static void pamac_database_get_installed_flatpaks_async_data_free (gpointer _data);
static gboolean pamac_database_get_installed_flatpaks_async_co (PamacDatabaseGetInstalledFlatpaksAsyncData* _data_);
static Block38Data* block38_data_ref (Block38Data* _data38_);
static void block38_data_unref (void * _userdata_);
static gint ____lambda39_ (Block38Data* _data38_);
VALA_EXTERN void pamac_flatpak_plugin_get_installed_flatpaks (PamacFlatpakPlugin* self,
                                                  GPtrArray** pkgs);
static gboolean _pamac_database_get_installed_flatpaks_async_co_gsource_func (gpointer self);
static gpointer _____lambda39__gthread_func (gpointer self);
static void pamac_database_search_flatpaks_async_data_free (gpointer _data);
static gboolean pamac_database_search_flatpaks_async_co (PamacDatabaseSearchFlatpaksAsyncData* _data_);
static Block39Data* block39_data_ref (Block39Data* _data39_);
static void block39_data_unref (void * _userdata_);
static Block40Data* block40_data_ref (Block40Data* _data40_);
static void block40_data_unref (void * _userdata_);
static gint ____lambda40_ (Block40Data* _data40_);
VALA_EXTERN void pamac_flatpak_plugin_search_flatpaks (PamacFlatpakPlugin* self,
                                           const gchar* search_string,
                                           GPtrArray** pkgs);
static gboolean _pamac_database_search_flatpaks_async_co_gsource_func (gpointer self);
static gpointer _____lambda40__gthread_func (gpointer self);
VALA_EXTERN gboolean pamac_flatpak_plugin_is_installed_flatpak (PamacFlatpakPlugin* self,
                                                    const gchar* name);
static void pamac_database_get_flatpak_async_data_free (gpointer _data);
static gboolean pamac_database_get_flatpak_async_co (PamacDatabaseGetFlatpakAsyncData* _data_);
static Block41Data* block41_data_ref (Block41Data* _data41_);
static void block41_data_unref (void * _userdata_);
static Block42Data* block42_data_ref (Block42Data* _data42_);
static void block42_data_unref (void * _userdata_);
static gint ____lambda41_ (Block42Data* _data42_);
VALA_EXTERN PamacFlatpakPackage* pamac_flatpak_plugin_get_flatpak (PamacFlatpakPlugin* self,
                                                       const gchar* id);
static gboolean _pamac_database_get_flatpak_async_co_gsource_func (gpointer self);
static gpointer _____lambda41__gthread_func (gpointer self);
static void pamac_database_get_category_flatpaks_async_data_free (gpointer _data);
static gboolean pamac_database_get_category_flatpaks_async_co (PamacDatabaseGetCategoryFlatpaksAsyncData* _data_);
static Block43Data* block43_data_ref (Block43Data* _data43_);
static void block43_data_unref (void * _userdata_);
static Block44Data* block44_data_ref (Block44Data* _data44_);
static void block44_data_unref (void * _userdata_);
static gint ____lambda42_ (Block44Data* _data44_);
VALA_EXTERN void pamac_flatpak_plugin_get_category_flatpaks (PamacFlatpakPlugin* self,
                                                 const gchar* category,
                                                 GPtrArray** pkgs);
static gboolean _pamac_database_get_category_flatpaks_async_co_gsource_func (gpointer self);
static gpointer _____lambda42__gthread_func (gpointer self);
static void pamac_database_set_context (PamacDatabase* self,
                                 GMainContext* value);
VALA_EXTERN gboolean pamac_database_get_dbs_missing (PamacDatabase* self);
static void pamac_database_set_dbs_missing (PamacDatabase* self,
                                     gboolean value);
static GObject * pamac_database_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties);
VALA_EXTERN AlpmConfig* pamac_config_get_alpm_config (PamacConfig* self);
VALA_EXTERN gchar* get_user_agent (void);
VALA_EXTERN void cb_evt (void* ctx,
             alpm_event_t* data);
static void _cb_evt_alpm_cb_event (void* ctx,
                            alpm_event_t* data);
VALA_EXTERN PamacAURPlugin* pamac_config_get_aur_plugin (PamacConfig* self);
VALA_EXTERN void pamac_aur_plugin_set_real_build_dir (PamacAURPlugin* self,
                                          const gchar* config_aur_build_dir);
static void _pamac_database_____lambda43_ (PamacDatabase* self);
static void __pamac_database_____lambda43__g_object_notify (GObject* _sender,
                                                     GParamSpec* pspec,
                                                     gpointer self);
VALA_EXTERN PamacAppstreamPlugin* pamac_config_get_appstream_plugin (PamacConfig* self);
VALA_EXTERN void pamac_appstream_plugin_load (PamacAppstreamPlugin* self,
                                  GPtrArray* repos_names);
VALA_EXTERN PamacSnapPlugin* pamac_config_get_snap_plugin (PamacConfig* self);
VALA_EXTERN PamacFlatpakPlugin* pamac_config_get_flatpak_plugin (PamacConfig* self);
VALA_EXTERN void pamac_flatpak_plugin_set_refresh_period (PamacFlatpakPlugin* self,
                                              guint64 value);
VALA_EXTERN void pamac_flatpak_plugin_load_appstream_data (PamacFlatpakPlugin* self);
static void pamac_database_finalize (GObject * obj);
static GType pamac_database_get_type_once (void);
static void _vala_pamac_database_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_pamac_database_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
pamac_database_get_instance_private (PamacDatabase* self)
{
	return G_STRUCT_MEMBER_P (self, PamacDatabase_private_offset);
}

static gint
_alpm_pkg_vercmp_gcompare_func (gconstpointer a,
                                gconstpointer b)
{
	gint result;
	result = alpm_pkg_vercmp ((const gchar*) a, (const gchar*) b);
	return result;
}

PamacDatabase*
pamac_database_construct (GType object_type,
                          PamacConfig* config)
{
	PamacDatabase * self = NULL;
	g_return_val_if_fail (config != NULL, NULL);
	self = (PamacDatabase*) g_object_new (object_type, "config", config, NULL);
	return self;
}

PamacDatabase*
pamac_database_new (PamacConfig* config)
{
	return pamac_database_construct (PAMAC_TYPE_DATABASE, config);
}

static gconstpointer
_vala_hash_set_next_value (GHashTableIter *self)
{
	void* vi = NULL;
	GHashTableIter* htp = NULL;
	void* _tmp0_;
	gconstpointer value = NULL;
	gconstpointer _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	gboolean _tmp3_;
	gconstpointer result;
	vi = &(*self);
	_tmp0_ = vi;
	htp = _tmp0_;
	_tmp3_ = g_hash_table_iter_next (htp, (gpointer*) (&_tmp2_), (gpointer*) NULL);
	value = _tmp2_;
	if (_tmp3_) {
		gconstpointer _tmp4_;
		_tmp4_ = value;
		_tmp1_ = _tmp4_;
	} else {
		_tmp1_ = NULL;
	}
	result = _tmp1_;
	return result;
}

void
pamac_database_refresh (PamacDatabase* self)
{
	PamacConfig* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	PamacConfig* _tmp28_;
	gboolean _tmp29_;
	gboolean _tmp30_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			AlpmConfig* _tmp1_;
			AlpmConfig* _tmp2_;
			alpm_handle_t* _tmp3_;
			alpm_handle_t* _tmp4_;
			GHashTable* _tmp20_;
			GHashTable* _tmp21_;
			GHashTable* _tmp22_;
			_tmp1_ = self->priv->alpm_config;
			alpm_config_reload (_tmp1_);
			_tmp2_ = self->priv->alpm_config;
			_tmp3_ = alpm_config_get_handle (_tmp2_, FALSE, FALSE, TRUE);
			_alpm_release0 (self->priv->alpm_handle);
			self->priv->alpm_handle = _tmp3_;
			_tmp4_ = self->priv->alpm_handle;
			if (_tmp4_ == NULL) {
				{
					AlpmConfig* _tmp5_;
					_tmp5_ = self->priv->alpm_config;
					g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
				}
				return;
			} else {
				AlpmConfig* _tmp14_;
				alpm_handle_t* _tmp15_;
				AlpmConfig* _tmp16_;
				alpm_handle_t* _tmp17_;
				AlpmConfig* _tmp18_;
				alpm_handle_t* _tmp19_;
				{
					GHashTableIter _name_it = {0};
					PamacConfig* _tmp6_;
					GHashTable* _tmp7_;
					GHashTable* _tmp8_;
					GHashTableIter _tmp9_ = {0};
					const gchar* name = NULL;
					_tmp6_ = self->priv->_config;
					_tmp7_ = pamac_config_get_ignorepkgs (_tmp6_);
					_tmp8_ = _tmp7_;
					g_hash_table_iter_init (&_tmp9_, _tmp8_);
					_name_it = _tmp9_;
					while (TRUE) {
						gconstpointer _tmp10_;
						const gchar* _tmp11_;
						alpm_handle_t* _tmp12_;
						const gchar* _tmp13_;
						_tmp10_ = _vala_hash_set_next_value (&_name_it);
						name = (const gchar*) _tmp10_;
						_tmp11_ = name;
						if (!(_tmp11_ != NULL)) {
							break;
						}
						_tmp12_ = self->priv->alpm_handle;
						_tmp13_ = name;
						alpm_option_add_ignorepkg (_tmp12_, _tmp13_);
					}
				}
				_tmp14_ = self->priv->alpm_config;
				_tmp15_ = self->priv->alpm_handle;
				alpm_config_register_syncdbs (_tmp14_, _tmp15_);
				_tmp16_ = self->priv->alpm_config;
				_tmp17_ = alpm_config_get_handle (_tmp16_, TRUE, FALSE, TRUE);
				_alpm_release0 (self->priv->files_handle);
				self->priv->files_handle = _tmp17_;
				_tmp18_ = self->priv->alpm_config;
				_tmp19_ = self->priv->files_handle;
				alpm_config_register_syncdbs (_tmp18_, _tmp19_);
			}
			_tmp20_ = self->priv->aur_vcs_pkgs;
			g_hash_table_remove_all (_tmp20_);
			_tmp21_ = self->priv->pkgs_cache;
			g_hash_table_remove_all (_tmp21_);
			_tmp22_ = self->priv->aur_pkgs_cache;
			g_hash_table_remove_all (_tmp22_);
		}
		__finally0:
		{
			AlpmConfig* _tmp23_;
			_tmp23_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp24_ = self->priv->_config;
	_tmp25_ = pamac_config_get_enable_snap (_tmp24_);
	_tmp26_ = _tmp25_;
	if (_tmp26_) {
		PamacSnapPlugin* _tmp27_;
		_tmp27_ = self->priv->snap_plugin;
		pamac_snap_plugin_refresh (_tmp27_);
	}
	_tmp28_ = self->priv->_config;
	_tmp29_ = pamac_config_get_enable_flatpak (_tmp28_);
	_tmp30_ = _tmp29_;
	if (_tmp30_) {
		PamacFlatpakPlugin* _tmp31_;
		_tmp31_ = self->priv->flatpak_plugin;
		pamac_flatpak_plugin_refresh (_tmp31_);
	}
}

alpm_handle_t*
pamac_database_get_tmp_handle (PamacDatabase* self)
{
	GError* _inner_error0_ = NULL;
	alpm_handle_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* tmp_handle = NULL;
			AlpmConfig* _tmp1_;
			alpm_handle_t* _tmp2_;
			alpm_handle_t* _tmp3_;
			_tmp1_ = self->priv->alpm_config;
			_tmp2_ = alpm_config_get_handle (_tmp1_, FALSE, TRUE, TRUE);
			tmp_handle = _tmp2_;
			_tmp3_ = tmp_handle;
			if (_tmp3_ != NULL) {
				AlpmConfig* _tmp4_;
				alpm_handle_t* _tmp5_;
				_tmp4_ = self->priv->alpm_config;
				_tmp5_ = tmp_handle;
				alpm_config_register_syncdbs (_tmp4_, _tmp5_);
			}
			result = tmp_handle;
			{
				AlpmConfig* _tmp6_;
				_tmp6_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp7_;
			_tmp7_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

static void
pamac_database_get_mirrors_countries_async_data_free (gpointer _data)
{
	PamacDatabaseGetMirrorsCountriesAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetMirrorsCountriesAsyncData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
pamac_database_get_mirrors_countries_async (PamacDatabase* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	PamacDatabaseGetMirrorsCountriesAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetMirrorsCountriesAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_mirrors_countries_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_mirrors_countries_async_co (_data_);
}

GPtrArray*
pamac_database_get_mirrors_countries_finish (PamacDatabase* self,
                                             GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetMirrorsCountriesAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		PamacDatabase* self;
		self = _data1_->self;
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static gboolean
_pamac_database_get_mirrors_countries_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_mirrors_countries_async_co (self);
	return result;
}

static gint
___lambda5_ (Block1Data* _data1_)
{
	PamacDatabase* self;
	GMainContext* _tmp13_;
	GError* _inner_error0_ = NULL;
	gint result;
	self = _data1_->self;
	{
		gchar* countries_str = NULL;
		gint status = 0;
		gchar* _tmp0_ = NULL;
		gint _tmp1_ = 0;
		g_spawn_command_line_sync ("pacman-mirrors -l", &_tmp0_, NULL, &_tmp1_, &_inner_error0_);
		_g_free0 (countries_str);
		countries_str = _tmp0_;
		status = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp2_ = -1;
			_g_free0 (countries_str);
			if (_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp2_;
		}
		if (status == 0) {
			GPtrArray* _tmp3_;
			gchar** _tmp4_;
			gchar** _tmp5_;
			_tmp3_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
			_g_ptr_array_unref0 (self->priv->mirrors_countries);
			self->priv->mirrors_countries = _tmp3_;
			_tmp5_ = _tmp4_ = g_strsplit (countries_str, "\n", 0);
			{
				gchar** country_collection = NULL;
				gint country_collection_length1 = 0;
				gint _country_collection_size_ = 0;
				gint country_it = 0;
				country_collection = _tmp5_;
				country_collection_length1 = _vala_array_length (_tmp4_);
				for (country_it = 0; country_it < country_collection_length1; country_it = country_it + 1) {
					const gchar* country = NULL;
					country = country_collection[country_it];
					{
						const gchar* _tmp6_;
						_tmp6_ = country;
						if (g_strcmp0 (_tmp6_, "") != 0) {
							GPtrArray* _tmp7_;
							const gchar* _tmp8_;
							gchar* _tmp9_;
							_tmp7_ = self->priv->mirrors_countries;
							_tmp8_ = country;
							_tmp9_ = g_strdup (_tmp8_);
							g_ptr_array_add (_tmp7_, _tmp9_);
						}
					}
				}
				country_collection = (_vala_array_free (country_collection, country_collection_length1, (GDestroyNotify) g_free), NULL);
			}
		}
		_g_free0 (countries_str);
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp10_ = e;
		_tmp11_ = _tmp10_->message;
		g_warning ("database.vala:188: %s", _tmp11_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gint _tmp12_ = -1;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp12_;
	}
	_tmp13_ = self->priv->_context;
	g_main_context_invoke_full (_tmp13_, G_PRIORITY_DEFAULT, _pamac_database_get_mirrors_countries_async_co_gsource_func, _data1_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda5__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda5_ (self));
	block1_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_mirrors_countries_async_co (PamacDatabaseGetMirrorsCountriesAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->mirrors_countries;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->mirrors_countries;
		_data_->result = _data_->_tmp1_;
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp2_ = g_thread_try_new ("get_mirrors_countries", ____lambda5__gthread_func, block1_data_ref (_data_->_data1_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:195: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->self->priv->mirrors_countries;
	_data_->result = _data_->_tmp6_;
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_mirrors_choosen_country_async_data_free (gpointer _data)
{
	PamacDatabaseGetMirrorsChoosenCountryAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetMirrorsChoosenCountryAsyncData, _data_);
}

void
pamac_database_get_mirrors_choosen_country_async (PamacDatabase* self,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	PamacDatabaseGetMirrorsChoosenCountryAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetMirrorsChoosenCountryAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_mirrors_choosen_country_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_mirrors_choosen_country_async_co (_data_);
}

const gchar*
pamac_database_get_mirrors_choosen_country_finish (PamacDatabase* self,
                                                   GAsyncResult* _res_)
{
	const gchar* result;
	PamacDatabaseGetMirrorsChoosenCountryAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		PamacDatabase* self;
		self = _data2_->self;
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gboolean
_pamac_database_get_mirrors_choosen_country_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_mirrors_choosen_country_async_co (self);
	return result;
}

static gint
___lambda6_ (Block2Data* _data2_)
{
	PamacDatabase* self;
	GMainContext* _tmp11_;
	GError* _inner_error0_ = NULL;
	gint result;
	self = _data2_->self;
	{
		gchar* countries_str = NULL;
		gint status = 0;
		gchar* _tmp0_ = NULL;
		gint _tmp1_ = 0;
		g_spawn_command_line_sync ("pacman-mirrors -lc", &_tmp0_, NULL, &_tmp1_, &_inner_error0_);
		_g_free0 (countries_str);
		countries_str = _tmp0_;
		status = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp2_ = -1;
			_g_free0 (countries_str);
			if (_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp2_;
		}
		if (status == 0) {
			gchar** _tmp3_;
			gchar** _tmp4_;
			gchar** _tmp5_;
			gint _tmp5__length1;
			const gchar* _tmp6_;
			gchar* _tmp7_;
			_tmp4_ = _tmp3_ = g_strsplit (countries_str, "\n", 2);
			_tmp5_ = _tmp4_;
			_tmp5__length1 = _vala_array_length (_tmp3_);
			_tmp6_ = _tmp5_[0];
			_tmp7_ = g_strdup (_tmp6_);
			_g_free0 (self->priv->mirrors_choosen_country);
			self->priv->mirrors_choosen_country = _tmp7_;
			_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
		}
		_g_free0 (countries_str);
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = e;
		_tmp9_ = _tmp8_->message;
		g_warning ("database.vala:216: %s", _tmp9_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gint _tmp10_ = -1;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp10_;
	}
	_tmp11_ = self->priv->_context;
	g_main_context_invoke_full (_tmp11_, G_PRIORITY_DEFAULT, _pamac_database_get_mirrors_choosen_country_async_co_gsource_func, _data2_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda6__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda6_ (self));
	block2_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_mirrors_choosen_country_async_co (PamacDatabaseGetMirrorsChoosenCountryAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data2_ = g_slice_new0 (Block2Data);
	_data_->_data2_->_ref_count_ = 1;
	_data_->_data2_->self = g_object_ref (_data_->self);
	_data_->_data2_->_async_data_ = _data_;
	_data_->_tmp0_ = g_strdup ("");
	_g_free0 (_data_->self->priv->mirrors_choosen_country);
	_data_->self->priv->mirrors_choosen_country = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_mirrors_choosen_country", ____lambda6__gthread_func, block2_data_ref (_data_->_data2_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:223: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block2_data_unref (_data_->_data2_);
		_data_->_data2_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _data_->self->priv->mirrors_choosen_country;
	_data_->result = _data_->_tmp5_;
	block2_data_unref (_data_->_data2_);
	_data_->_data2_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gchar*
pamac_database_get_alpm_dep_name (PamacDatabase* self,
                                  const gchar* dep_string)
{
	alpm_depend_t* _tmp0_;
	alpm_depend_t* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (dep_string != NULL, NULL);
	_tmp0_ = alpm_dep_from_string (dep_string);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->name;
	_tmp3_ = g_strdup (_tmp2_);
	_tmp4_ = _tmp3_;
	_alpm_dep_free0 (_tmp1_);
	result = _tmp4_;
	return result;
}

static void
_g_ptr_array_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL));
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static gint
string_last_index_of_char (const gchar* self,
                           gunichar c,
                           gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = g_utf8_strrchr (((gchar*) self) + start_index, (gssize) -1, c);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

static guint64*
_uint64_dup (guint64* self)
{
	guint64* dup;
	dup = g_new0 (guint64, 1);
	memcpy (dup, self, sizeof (guint64));
	return dup;
}

static gpointer
__uint64_dup0 (gpointer self)
{
	return self ? _uint64_dup (self) : NULL;
}

static gint
vala_g_ptr_array_get_length (GPtrArray* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = (gint) self->len;
	return result;
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		GPtrArray* self;
		self = _data3_->self;
		_g_ptr_array_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gint
__lambda0_ (Block3Data* _data3_,
            gconstpointer** a,
            gconstpointer** b)
{
	GPtrArray* self;
	gint result;
	self = _data3_->self;
	result = _data3_->compare_func ((gconstpointer**) (*a), (gconstpointer**) (*b));
	return result;
}

static gint
___lambda0__gcompare_data_func (gconstpointer a,
                                gconstpointer b,
                                gpointer self)
{
	gint result;
	result = __lambda0_ (self, a, b);
	return result;
}

static void
vala_g_ptr_array_sort (GPtrArray* self,
                       GCompareFunc compare_func)
{
	Block3Data* _data3_;
	g_return_if_fail (self != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_ptr_array_ref (self);
	_data3_->compare_func = compare_func;
	g_ptr_array_sort_with_data (self, ___lambda0__gcompare_data_func, _data3_);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static gint
____lambda7_ (const gchar* version1,
              const gchar* version2)
{
	gint result;
	g_return_val_if_fail (version1 != NULL, 0);
	g_return_val_if_fail (version2 != NULL, 0);
	result = alpm_pkg_vercmp (version2, version1);
	return result;
}

static gint
_____lambda7__gcompare_func (gconstpointer a,
                             gconstpointer b)
{
	gint result;
	result = ____lambda7_ ((const gchar*) a, (const gchar*) b);
	return result;
}

static void
pamac_database_get_clean_cache_details_real (PamacDatabase* self,
                                             GHashTable** filenames_size)
{
	GHashTable* pkg_version_filenames = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* pkg_versions = NULL;
	GHashFunc _tmp3_;
	GEqualFunc _tmp4_;
	GHashTable* _tmp5_;
	PamacConfig* _tmp98_;
	guint64 _tmp99_;
	guint64 _tmp100_;
	GHashTableIter iter = {0};
	GHashTable* _tmp101_;
	const gchar* name = NULL;
	GPtrArray* versions = NULL;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*filenames_size != NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_ptr_array_unref0_);
	pkg_version_filenames = _tmp2_;
	_tmp3_ = g_str_hash;
	_tmp4_ = g_str_equal;
	_tmp5_ = g_hash_table_new_full (_tmp3_, _tmp4_, _g_free0_, _g_ptr_array_unref0_);
	pkg_versions = _tmp5_;
	{
		AlpmConfig* _tmp6_;
		_tmp6_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* cachedirs_names = NULL;
			alpm_handle_t* _tmp7_;
			alpm_list_t* _tmp8_;
			alpm_list_t* _tmp9_;
			_tmp7_ = self->priv->alpm_handle;
			_tmp8_ = alpm_option_get_cachedirs (_tmp7_);
			_tmp9_ = _tmp8_;
			cachedirs_names = _tmp9_;
			while (TRUE) {
				alpm_list_t* _tmp10_;
				const gchar* cachedir_name = NULL;
				alpm_list_t* _tmp11_;
				gconstpointer _tmp12_;
				GFile* cachedir = NULL;
				const gchar* _tmp13_;
				GFile* _tmp14_;
				_tmp10_ = cachedirs_names;
				if (!(_tmp10_ != NULL)) {
					break;
				}
				_tmp11_ = cachedirs_names;
				_tmp12_ = _tmp11_->data;
				cachedir_name = (const gchar*) _tmp12_;
				_tmp13_ = cachedir_name;
				_tmp14_ = g_file_new_for_path (_tmp13_);
				cachedir = _tmp14_;
				{
					GFileEnumerator* enumerator = NULL;
					GFile* _tmp15_;
					GFileEnumerator* _tmp16_;
					GFileInfo* info = NULL;
					_tmp15_ = cachedir;
					_tmp16_ = g_file_enumerate_children (_tmp15_, "standard::*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
					enumerator = _tmp16_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch1_g_error;
					}
					while (TRUE) {
						GFileInfo* _tmp17_ = NULL;
						GFileEnumerator* _tmp18_;
						GFileInfo* _tmp19_;
						GFileInfo* _tmp20_;
						GFileInfo* _tmp21_;
						GFileInfo* _tmp22_;
						const gchar* filename = NULL;
						GFileInfo* _tmp23_;
						const gchar* _tmp24_;
						gchar* absolute_filename = NULL;
						const gchar* _tmp25_;
						const gchar* _tmp26_;
						gchar* _tmp27_;
						gchar* name_version_release = NULL;
						const gchar* _tmp28_;
						const gchar* _tmp29_;
						gchar* _tmp30_;
						const gchar* _tmp31_;
						gint release_index = 0;
						const gchar* _tmp32_;
						gchar* name_version = NULL;
						const gchar* _tmp33_;
						gchar* _tmp34_;
						const gchar* _tmp35_;
						gint version_index = 0;
						const gchar* _tmp36_;
						gchar* name = NULL;
						const gchar* _tmp37_;
						gchar* _tmp38_;
						const gchar* _tmp39_;
						gboolean _tmp40_ = FALSE;
						PamacConfig* _tmp41_;
						gboolean _tmp42_;
						gboolean _tmp43_;
						const gchar* _tmp45_;
						gchar* _tmp46_;
						GFileInfo* _tmp47_;
						guint64 _tmp48_;
						guint64* _tmp49_;
						GHashTable* _tmp50_;
						const gchar* _tmp51_;
						_tmp18_ = enumerator;
						_tmp19_ = g_file_enumerator_next_file (_tmp18_, NULL, &_inner_error0_);
						_tmp17_ = _tmp19_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (info);
							_g_object_unref0 (enumerator);
							goto __catch1_g_error;
						}
						_tmp20_ = _tmp17_;
						_tmp17_ = NULL;
						_g_object_unref0 (info);
						info = _tmp20_;
						_tmp21_ = info;
						if (!(_tmp21_ != NULL)) {
							_g_object_unref0 (_tmp17_);
							break;
						}
						_tmp22_ = info;
						if (g_file_info_get_file_type (_tmp22_) != G_FILE_TYPE_REGULAR) {
							_g_object_unref0 (_tmp17_);
							continue;
						}
						_tmp23_ = info;
						_tmp24_ = g_file_info_get_name (_tmp23_);
						filename = _tmp24_;
						_tmp25_ = cachedir_name;
						_tmp26_ = filename;
						_tmp27_ = g_strdup_printf ("%s%s", _tmp25_, _tmp26_);
						absolute_filename = _tmp27_;
						_tmp28_ = filename;
						_tmp29_ = filename;
						_tmp30_ = string_slice (_tmp28_, (glong) 0, (glong) string_last_index_of_char (_tmp29_, (gunichar) '-', 0));
						name_version_release = _tmp30_;
						_tmp31_ = name_version_release;
						if (_tmp31_ == NULL) {
							_g_free0 (name_version_release);
							_g_free0 (absolute_filename);
							_g_object_unref0 (_tmp17_);
							continue;
						}
						_tmp32_ = name_version_release;
						release_index = string_last_index_of_char (_tmp32_, (gunichar) '-', 0);
						_tmp33_ = name_version_release;
						_tmp34_ = string_slice (_tmp33_, (glong) 0, (glong) release_index);
						name_version = _tmp34_;
						_tmp35_ = name_version;
						if (_tmp35_ == NULL) {
							_g_free0 (name_version);
							_g_free0 (name_version_release);
							_g_free0 (absolute_filename);
							_g_object_unref0 (_tmp17_);
							continue;
						}
						_tmp36_ = name_version;
						version_index = string_last_index_of_char (_tmp36_, (gunichar) '-', 0);
						_tmp37_ = name_version;
						_tmp38_ = string_slice (_tmp37_, (glong) 0, (glong) version_index);
						name = _tmp38_;
						_tmp39_ = name;
						if (_tmp39_ == NULL) {
							_g_free0 (name);
							_g_free0 (name_version);
							_g_free0 (name_version_release);
							_g_free0 (absolute_filename);
							_g_object_unref0 (_tmp17_);
							continue;
						}
						_tmp41_ = self->priv->_config;
						_tmp42_ = pamac_config_get_clean_rm_only_uninstalled (_tmp41_);
						_tmp43_ = _tmp42_;
						if (_tmp43_) {
							const gchar* _tmp44_;
							_tmp44_ = name;
							_tmp40_ = pamac_database_is_installed_pkg (self, _tmp44_);
						} else {
							_tmp40_ = FALSE;
						}
						if (_tmp40_) {
							_g_free0 (name);
							_g_free0 (name_version);
							_g_free0 (name_version_release);
							_g_free0 (absolute_filename);
							_g_object_unref0 (_tmp17_);
							continue;
						}
						_tmp45_ = absolute_filename;
						_tmp46_ = g_strdup (_tmp45_);
						_tmp47_ = info;
						_tmp48_ = (guint64) g_file_info_get_size (_tmp47_);
						_tmp49_ = __uint64_dup0 (&_tmp48_);
						g_hash_table_insert (*filenames_size, _tmp46_, _tmp49_);
						_tmp50_ = pkg_versions;
						_tmp51_ = name;
						if (g_hash_table_contains (_tmp50_, _tmp51_)) {
							GHashTable* _tmp52_;
							const gchar* _tmp53_;
							_tmp52_ = pkg_version_filenames;
							_tmp53_ = name_version_release;
							if (g_hash_table_contains (_tmp52_, _tmp53_)) {
								GPtrArray* filenames = NULL;
								GHashTable* _tmp54_;
								const gchar* _tmp55_;
								gconstpointer _tmp56_;
								GPtrArray* _tmp57_;
								gchar* _tmp58_;
								_tmp54_ = pkg_version_filenames;
								_tmp55_ = name_version_release;
								_tmp56_ = g_hash_table_lookup (_tmp54_, _tmp55_);
								filenames = (GPtrArray*) _tmp56_;
								_tmp57_ = filenames;
								_tmp58_ = absolute_filename;
								absolute_filename = NULL;
								g_ptr_array_add (_tmp57_, _tmp58_);
							} else {
								GPtrArray* versions = NULL;
								GHashTable* _tmp59_;
								const gchar* _tmp60_;
								gconstpointer _tmp61_;
								gchar* version_release = NULL;
								const gchar* _tmp62_;
								const gchar* _tmp63_;
								gint _tmp64_;
								gint _tmp65_;
								gchar* _tmp66_;
								const gchar* _tmp67_;
								GPtrArray* _tmp68_;
								gchar* _tmp69_;
								GPtrArray* filenames = NULL;
								GPtrArray* _tmp70_;
								GPtrArray* _tmp71_;
								gchar* _tmp72_;
								GHashTable* _tmp73_;
								gchar* _tmp74_;
								GPtrArray* _tmp75_;
								_tmp59_ = pkg_versions;
								_tmp60_ = name;
								_tmp61_ = g_hash_table_lookup (_tmp59_, _tmp60_);
								versions = (GPtrArray*) _tmp61_;
								_tmp62_ = name_version_release;
								_tmp63_ = name_version_release;
								_tmp64_ = strlen (_tmp63_);
								_tmp65_ = _tmp64_;
								_tmp66_ = string_slice (_tmp62_, (glong) (version_index + 1), (glong) _tmp65_);
								version_release = _tmp66_;
								_tmp67_ = version_release;
								if (_tmp67_ == NULL) {
									_g_free0 (version_release);
									_g_free0 (name);
									_g_free0 (name_version);
									_g_free0 (name_version_release);
									_g_free0 (absolute_filename);
									_g_object_unref0 (_tmp17_);
									continue;
								}
								_tmp68_ = versions;
								_tmp69_ = version_release;
								version_release = NULL;
								g_ptr_array_add (_tmp68_, _tmp69_);
								_tmp70_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
								filenames = _tmp70_;
								_tmp71_ = filenames;
								_tmp72_ = absolute_filename;
								absolute_filename = NULL;
								g_ptr_array_add (_tmp71_, _tmp72_);
								_tmp73_ = pkg_version_filenames;
								_tmp74_ = name_version_release;
								name_version_release = NULL;
								_tmp75_ = filenames;
								filenames = NULL;
								g_hash_table_insert (_tmp73_, _tmp74_, _tmp75_);
								_g_ptr_array_unref0 (filenames);
								_g_free0 (version_release);
							}
						} else {
							GPtrArray* versions = NULL;
							GPtrArray* _tmp76_;
							gchar* version_release = NULL;
							const gchar* _tmp77_;
							const gchar* _tmp78_;
							gint _tmp79_;
							gint _tmp80_;
							gchar* _tmp81_;
							const gchar* _tmp82_;
							GPtrArray* _tmp83_;
							gchar* _tmp84_;
							GHashTable* _tmp85_;
							const gchar* _tmp86_;
							gchar* _tmp87_;
							GPtrArray* _tmp88_;
							GPtrArray* filenames = NULL;
							GPtrArray* _tmp89_;
							GPtrArray* _tmp90_;
							gchar* _tmp91_;
							GHashTable* _tmp92_;
							gchar* _tmp93_;
							GPtrArray* _tmp94_;
							_tmp76_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
							versions = _tmp76_;
							_tmp77_ = name_version_release;
							_tmp78_ = name_version_release;
							_tmp79_ = strlen (_tmp78_);
							_tmp80_ = _tmp79_;
							_tmp81_ = string_slice (_tmp77_, (glong) (version_index + 1), (glong) _tmp80_);
							version_release = _tmp81_;
							_tmp82_ = version_release;
							if (_tmp82_ == NULL) {
								_g_free0 (version_release);
								_g_ptr_array_unref0 (versions);
								_g_free0 (name);
								_g_free0 (name_version);
								_g_free0 (name_version_release);
								_g_free0 (absolute_filename);
								_g_object_unref0 (_tmp17_);
								continue;
							}
							_tmp83_ = versions;
							_tmp84_ = version_release;
							version_release = NULL;
							g_ptr_array_add (_tmp83_, _tmp84_);
							_tmp85_ = pkg_versions;
							_tmp86_ = name;
							_tmp87_ = g_strdup (_tmp86_);
							_tmp88_ = versions;
							versions = NULL;
							g_hash_table_insert (_tmp85_, _tmp87_, _tmp88_);
							_tmp89_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
							filenames = _tmp89_;
							_tmp90_ = filenames;
							_tmp91_ = absolute_filename;
							absolute_filename = NULL;
							g_ptr_array_add (_tmp90_, _tmp91_);
							_tmp92_ = pkg_version_filenames;
							_tmp93_ = name_version_release;
							name_version_release = NULL;
							_tmp94_ = filenames;
							filenames = NULL;
							g_hash_table_insert (_tmp92_, _tmp93_, _tmp94_);
							_g_ptr_array_unref0 (filenames);
							_g_free0 (version_release);
							_g_ptr_array_unref0 (versions);
						}
						_g_free0 (name);
						_g_free0 (name_version);
						_g_free0 (name_version_release);
						_g_free0 (absolute_filename);
						_g_object_unref0 (_tmp17_);
					}
					_g_object_unref0 (info);
					_g_object_unref0 (enumerator);
				}
				goto __finally1;
				__catch1_g_error:
				{
					GError* e = NULL;
					GError* _tmp95_;
					const gchar* _tmp96_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp95_ = e;
					_tmp96_ = _tmp95_->message;
					g_warning ("database.vala:299: %s", _tmp96_);
					_g_error_free0 (e);
				}
				__finally1:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (cachedir);
					_g_hash_table_unref0 (pkg_versions);
					_g_hash_table_unref0 (pkg_version_filenames);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				cachedirs_names = alpm_list_next (cachedirs_names);
				_g_object_unref0 (cachedir);
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp97_;
			_tmp97_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_hash_table_unref0 (pkg_versions);
			_g_hash_table_unref0 (pkg_version_filenames);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp98_ = self->priv->_config;
	_tmp99_ = pamac_config_get_clean_keep_num_pkgs (_tmp98_);
	_tmp100_ = _tmp99_;
	if (_tmp100_ == ((guint64) 0)) {
		_g_hash_table_unref0 (pkg_versions);
		_g_hash_table_unref0 (pkg_version_filenames);
		return;
	}
	_tmp101_ = pkg_versions;
	g_hash_table_iter_init (&iter, _tmp101_);
	while (TRUE) {
		gconstpointer _tmp102_ = NULL;
		gconstpointer _tmp103_ = NULL;
		gboolean _tmp104_;
		GPtrArray* _tmp105_;
		gint _tmp106_;
		gint _tmp107_;
		PamacConfig* _tmp108_;
		guint64 _tmp109_;
		guint64 _tmp110_;
		guint i = 0U;
		guint length = 0U;
		GPtrArray* _tmp112_;
		gint _tmp113_;
		gint _tmp114_;
		_tmp104_ = g_hash_table_iter_next (&iter, (gpointer*) (&_tmp102_), (gpointer*) (&_tmp103_));
		name = (const gchar*) _tmp102_;
		versions = (GPtrArray*) _tmp103_;
		if (!_tmp104_) {
			break;
		}
		_tmp105_ = versions;
		_tmp106_ = vala_g_ptr_array_get_length (_tmp105_);
		_tmp107_ = _tmp106_;
		_tmp108_ = self->priv->_config;
		_tmp109_ = pamac_config_get_clean_keep_num_pkgs (_tmp108_);
		_tmp110_ = _tmp109_;
		if (((guint64) _tmp107_) > _tmp110_) {
			GPtrArray* _tmp111_;
			_tmp111_ = versions;
			vala_g_ptr_array_sort (_tmp111_, _____lambda7__gcompare_func);
		}
		_tmp112_ = versions;
		_tmp113_ = vala_g_ptr_array_get_length (_tmp112_);
		_tmp114_ = _tmp113_;
		length = (guint) _tmp114_;
		{
			gboolean _tmp115_ = FALSE;
			i = (guint) 0;
			_tmp115_ = TRUE;
			while (TRUE) {
				PamacConfig* _tmp117_;
				guint64 _tmp118_;
				guint64 _tmp119_;
				GPtrArray* filenames = NULL;
				GHashTable* _tmp120_;
				const gchar* _tmp121_;
				GPtrArray* _tmp122_;
				gconstpointer _tmp123_;
				gchar* _tmp124_;
				gchar* _tmp125_;
				gconstpointer _tmp126_;
				GPtrArray* _tmp127_;
				GPtrArray* _tmp128_;
				if (!_tmp115_) {
					guint _tmp116_;
					_tmp116_ = i;
					i = _tmp116_ + 1;
				}
				_tmp115_ = FALSE;
				if (!(i < length)) {
					break;
				}
				_tmp117_ = self->priv->_config;
				_tmp118_ = pamac_config_get_clean_keep_num_pkgs (_tmp117_);
				_tmp119_ = _tmp118_;
				if (((guint64) i) == _tmp119_) {
					break;
				}
				_tmp120_ = pkg_version_filenames;
				_tmp121_ = name;
				_tmp122_ = versions;
				_tmp123_ = g_ptr_array_index (_tmp122_, i);
				_tmp124_ = g_strdup_printf ("%s-%s", _tmp121_, (const gchar*) _tmp123_);
				_tmp125_ = _tmp124_;
				_tmp126_ = g_hash_table_lookup (_tmp120_, _tmp125_);
				_tmp127_ = (GPtrArray*) _tmp126_;
				_g_free0 (_tmp125_);
				filenames = _tmp127_;
				_tmp128_ = filenames;
				if (_tmp128_ != NULL) {
					GPtrArray* _tmp129_;
					_tmp129_ = filenames;
					{
						GPtrArray* filename_collection = NULL;
						guint filename_index = 0U;
						filename_collection = _tmp129_;
						for (filename_index = 0; filename_index < filename_collection->len; filename_index = filename_index + 1) {
							const gchar* filename = NULL;
							filename = (const gchar*) g_ptr_array_index (filename_collection, filename_index);
							{
								const gchar* _tmp130_;
								_tmp130_ = filename;
								g_hash_table_remove (*filenames_size, _tmp130_);
							}
						}
					}
				}
			}
		}
	}
	_g_hash_table_unref0 (pkg_versions);
	_g_hash_table_unref0 (pkg_version_filenames);
}

GHashTable*
pamac_database_get_clean_cache_details (PamacDatabase* self)
{
	GHashTable* filenames_size = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	filenames_size = _tmp2_;
	pamac_database_get_clean_cache_details_real (self, &filenames_size);
	result = filenames_size;
	return result;
}

static void
pamac_database_get_clean_cache_details_async_data_free (gpointer _data)
{
	PamacDatabaseGetCleanCacheDetailsAsyncData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetCleanCacheDetailsAsyncData, _data_);
}

void
pamac_database_get_clean_cache_details_async (PamacDatabase* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	PamacDatabaseGetCleanCacheDetailsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetCleanCacheDetailsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_clean_cache_details_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_clean_cache_details_async_co (_data_);
}

GHashTable*
pamac_database_get_clean_cache_details_finish (PamacDatabase* self,
                                               GAsyncResult* _res_)
{
	GHashTable* result;
	PamacDatabaseGetCleanCacheDetailsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		PamacDatabase* self;
		self = _data4_->self;
		_g_hash_table_unref0 (_data4_->filenames_size);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static gboolean
_pamac_database_get_clean_cache_details_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_clean_cache_details_async_co (self);
	return result;
}

static gint
___lambda8_ (Block4Data* _data4_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data4_->self;
	pamac_database_get_clean_cache_details_real (self, &_data4_->filenames_size);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_clean_cache_details_async_co_gsource_func, _data4_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda8__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda8_ (self));
	block4_data_unref (self);
	return result;
}

static gpointer
_g_hash_table_ref0 (gpointer self)
{
	return self ? g_hash_table_ref (self) : NULL;
}

static gboolean
pamac_database_get_clean_cache_details_async_co (PamacDatabaseGetCleanCacheDetailsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data4_ = g_slice_new0 (Block4Data);
	_data_->_data4_->_ref_count_ = 1;
	_data_->_data4_->self = g_object_ref (_data_->self);
	_data_->_data4_->_async_data_ = _data_;
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_free0_);
	_data_->_data4_->filenames_size = _data_->_tmp2_;
	{
		_data_->_tmp3_ = g_thread_try_new ("get_clean_cache_details", ____lambda8__gthread_func, block4_data_ref (_data_->_data4_), &_data_->_inner_error0_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_g_thread_unref0 (_data_->_tmp4_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp5_ = _data_->e;
		_data_->_tmp6_ = _data_->_tmp5_->message;
		g_warning ("database.vala:351: %s", _data_->_tmp6_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block4_data_unref (_data_->_data4_);
		_data_->_data4_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _g_hash_table_ref0 (_data_->_data4_->filenames_size);
	_data_->result = _data_->_tmp7_;
	block4_data_unref (_data_->_data4_);
	_data_->_data4_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

const gchar*
pamac_database_get_real_aur_build_dir (PamacDatabase* self)
{
	PamacAURPlugin* _tmp0_;
	const gchar* _tmp1_;
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->aur_plugin;
	_tmp1_ = pamac_aur_plugin_get_real_build_dir (_tmp0_);
	result = _tmp1_;
	return result;
}

GPtrArray*
pamac_database_get_aur_providers (PamacDatabase* self,
                                  const gchar* pkgname)
{
	PamacAURPlugin* _tmp0_;
	GPtrArray* _tmp1_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	_tmp0_ = self->priv->aur_plugin;
	_tmp1_ = pamac_aur_plugin_get_providers (_tmp0_, pkgname);
	result = _tmp1_;
	return result;
}

static void
pamac_database_get_build_files_details_real (PamacDatabase* self,
                                             GHashTable** filenames_size)
{
	const gchar* real_aur_build_dir = NULL;
	const gchar* _tmp0_;
	GFile* build_directory = NULL;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*filenames_size != NULL);
	_tmp0_ = pamac_database_get_real_aur_build_dir (self);
	real_aur_build_dir = _tmp0_;
	_tmp1_ = real_aur_build_dir;
	_tmp2_ = g_file_new_for_path (_tmp1_);
	build_directory = _tmp2_;
	_tmp3_ = build_directory;
	if (!g_file_query_exists (_tmp3_, NULL)) {
		_g_object_unref0 (build_directory);
		return;
	}
	{
		GFileEnumerator* enumerator = NULL;
		GFile* _tmp4_;
		GFileEnumerator* _tmp5_;
		GFileInfo* info = NULL;
		_tmp4_ = build_directory;
		_tmp5_ = g_file_enumerate_children (_tmp4_, "standard::*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
		enumerator = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		while (TRUE) {
			GFileInfo* _tmp6_ = NULL;
			GFileEnumerator* _tmp7_;
			GFileInfo* _tmp8_;
			GFileInfo* _tmp9_;
			GFileInfo* _tmp10_;
			GFileInfo* _tmp11_;
			const gchar* _tmp12_;
			gchar* absolute_filename = NULL;
			GFile* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			GFileInfo* _tmp16_;
			const gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			GFile* child = NULL;
			const gchar* _tmp20_;
			GFile* _tmp21_;
			guint64 disk_usage = 0ULL;
			GFile* _tmp22_;
			guint64 _tmp23_ = 0ULL;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			guint64* _tmp26_;
			_tmp7_ = enumerator;
			_tmp8_ = g_file_enumerator_next_file (_tmp7_, NULL, &_inner_error0_);
			_tmp6_ = _tmp8_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (info);
				_g_object_unref0 (enumerator);
				goto __catch0_g_error;
			}
			_tmp9_ = _tmp6_;
			_tmp6_ = NULL;
			_g_object_unref0 (info);
			info = _tmp9_;
			_tmp10_ = info;
			if (!(_tmp10_ != NULL)) {
				_g_object_unref0 (_tmp6_);
				break;
			}
			_tmp11_ = info;
			_tmp12_ = g_file_info_get_name (_tmp11_);
			if (g_strcmp0 (_tmp12_, "packages-meta-ext-v1.json.gz") == 0) {
				_g_object_unref0 (_tmp6_);
				continue;
			}
			_tmp13_ = build_directory;
			_tmp14_ = g_file_get_path (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = info;
			_tmp17_ = g_file_info_get_name (_tmp16_);
			_tmp18_ = g_build_filename (_tmp15_, _tmp17_, NULL);
			_tmp19_ = _tmp18_;
			_g_free0 (_tmp15_);
			absolute_filename = _tmp19_;
			_tmp20_ = absolute_filename;
			_tmp21_ = g_file_new_for_path (_tmp20_);
			child = _tmp21_;
			_tmp22_ = child;
			g_file_measure_disk_usage (_tmp22_, G_FILE_MEASURE_NONE, NULL, NULL, NULL, &_tmp23_, NULL, NULL, &_inner_error0_);
			disk_usage = _tmp23_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (child);
				_g_free0 (absolute_filename);
				_g_object_unref0 (_tmp6_);
				_g_object_unref0 (info);
				_g_object_unref0 (enumerator);
				goto __catch0_g_error;
			}
			_tmp24_ = absolute_filename;
			_tmp25_ = g_strdup (_tmp24_);
			_tmp26_ = __uint64_dup0 (&disk_usage);
			g_hash_table_insert (*filenames_size, _tmp25_, _tmp26_);
			_g_object_unref0 (child);
			_g_free0 (absolute_filename);
			_g_object_unref0 (_tmp6_);
		}
		_g_object_unref0 (info);
		_g_object_unref0 (enumerator);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp27_;
		const gchar* _tmp28_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp27_ = e;
		_tmp28_ = _tmp27_->message;
		g_warning ("database.vala:384: %s", _tmp28_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (build_directory);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (build_directory);
}

GHashTable*
pamac_database_get_build_files_details (PamacDatabase* self)
{
	GHashTable* filenames_size = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	filenames_size = _tmp2_;
	pamac_database_get_build_files_details_real (self, &filenames_size);
	result = filenames_size;
	return result;
}

static void
pamac_database_get_build_files_details_async_data_free (gpointer _data)
{
	PamacDatabaseGetBuildFilesDetailsAsyncData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetBuildFilesDetailsAsyncData, _data_);
}

void
pamac_database_get_build_files_details_async (PamacDatabase* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	PamacDatabaseGetBuildFilesDetailsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetBuildFilesDetailsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_build_files_details_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_build_files_details_async_co (_data_);
}

GHashTable*
pamac_database_get_build_files_details_finish (PamacDatabase* self,
                                               GAsyncResult* _res_)
{
	GHashTable* result;
	PamacDatabaseGetBuildFilesDetailsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		PamacDatabase* self;
		self = _data5_->self;
		_g_hash_table_unref0 (_data5_->filenames_size);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static gboolean
_pamac_database_get_build_files_details_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_build_files_details_async_co (self);
	return result;
}

static gint
___lambda9_ (Block5Data* _data5_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data5_->self;
	pamac_database_get_build_files_details_real (self, &_data5_->filenames_size);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_build_files_details_async_co_gsource_func, _data5_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda9__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda9_ (self));
	block5_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_build_files_details_async_co (PamacDatabaseGetBuildFilesDetailsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data5_ = g_slice_new0 (Block5Data);
	_data_->_data5_->_ref_count_ = 1;
	_data_->_data5_->self = g_object_ref (_data_->self);
	_data_->_data5_->_async_data_ = _data_;
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_free0_);
	_data_->_data5_->filenames_size = _data_->_tmp2_;
	{
		_data_->_tmp3_ = g_thread_try_new ("get_build_files_details", ____lambda9__gthread_func, block5_data_ref (_data_->_data5_), &_data_->_inner_error0_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_g_thread_unref0 (_data_->_tmp4_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp5_ = _data_->e;
		_data_->_tmp6_ = _data_->_tmp5_->message;
		g_warning ("database.vala:404: %s", _data_->_tmp6_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block5_data_unref (_data_->_data5_);
		_data_->_data5_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _g_hash_table_ref0 (_data_->_data5_->filenames_size);
	_data_->result = _data_->_tmp7_;
	block5_data_unref (_data_->_data5_);
	_data_->_data5_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gboolean
pamac_database_is_installed_pkg (PamacDatabase* self,
                                 const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pkgname != NULL, FALSE);
	{
		AlpmConfig* _tmp0_;
		gboolean _tmp7_ = FALSE;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_pkg_t* _tmp4_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkg (_tmp3_, pkgname);
			result = _tmp4_ != NULL;
			{
				AlpmConfig* _tmp5_;
				_tmp5_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp6_;
			_tmp6_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp7_;
	}
}

alpm_pkg_t*
pamac_database_intern_get_local_pkg (PamacDatabase* self,
                                     const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	alpm_pkg_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_pkg_t* _tmp4_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkg (_tmp3_, pkgname);
			result = _tmp4_;
			{
				AlpmConfig* _tmp5_;
				_tmp5_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp6_;
			_tmp6_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

PamacAlpmPackage*
pamac_database_get_installed_pkg (PamacDatabase* self,
                                  const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	PamacAlpmPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_pkg_t* _tmp4_;
			PamacAlpmPackage* _tmp5_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkg (_tmp3_, pkgname);
			_tmp5_ = pamac_database_initialise_pkg (self, _tmp4_, NULL);
			result = _tmp5_;
			{
				AlpmConfig* _tmp6_;
				_tmp6_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp7_;
			_tmp7_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

gboolean
pamac_database_has_installed_satisfier (PamacDatabase* self,
                                        const gchar* depstring)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (depstring != NULL, FALSE);
	{
		AlpmConfig* _tmp0_;
		gboolean _tmp9_ = FALSE;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_list_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_pkg_t* _tmp6_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkgcache (_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp6_ = alpm_find_satisfier (_tmp5_, depstring);
			result = _tmp6_ != NULL;
			{
				AlpmConfig* _tmp7_;
				_tmp7_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp8_;
			_tmp8_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp9_;
	}
}

PamacAlpmPackage*
pamac_database_get_installed_satisfier (PamacDatabase* self,
                                        const gchar* depstring)
{
	GError* _inner_error0_ = NULL;
	PamacAlpmPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (depstring != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_list_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_pkg_t* _tmp6_;
			PamacAlpmPackage* _tmp7_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkgcache (_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp6_ = alpm_find_satisfier (_tmp5_, depstring);
			_tmp7_ = pamac_database_initialise_pkg (self, _tmp6_, NULL);
			result = _tmp7_;
			{
				AlpmConfig* _tmp8_;
				_tmp8_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp9_;
			_tmp9_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

GPtrArray*
pamac_database_get_installed_pkgs_by_glob (PamacDatabase* self,
                                           const gchar* glob)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (glob != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	{
		AlpmConfig* _tmp1_;
		_tmp1_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* pkgcache = NULL;
			alpm_handle_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_db_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_list_t* _tmp6_;
			_tmp2_ = self->priv->alpm_handle;
			_tmp3_ = alpm_get_localdb (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp5_ = alpm_db_get_pkgcache (_tmp4_);
			_tmp6_ = _tmp5_;
			pkgcache = _tmp6_;
			while (TRUE) {
				alpm_list_t* _tmp7_;
				alpm_pkg_t* local_pkg = NULL;
				alpm_list_t* _tmp8_;
				gconstpointer _tmp9_;
				alpm_pkg_t* _tmp10_;
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				_tmp7_ = pkgcache;
				if (!(_tmp7_ != NULL)) {
					break;
				}
				_tmp8_ = pkgcache;
				_tmp9_ = _tmp8_->data;
				local_pkg = (alpm_pkg_t*) _tmp9_;
				_tmp10_ = local_pkg;
				_tmp11_ = alpm_pkg_get_name (_tmp10_);
				_tmp12_ = _tmp11_;
				if (fnmatch (glob, _tmp12_, 0) == 0) {
					GPtrArray* _tmp13_;
					alpm_pkg_t* _tmp14_;
					PamacAlpmPackage* _tmp15_;
					_tmp13_ = pkgs;
					_tmp14_ = local_pkg;
					_tmp15_ = pamac_database_initialise_pkg (self, _tmp14_, NULL);
					g_ptr_array_add (_tmp13_, _tmp15_);
				}
				pkgcache = alpm_list_next (pkgcache);
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp16_;
			_tmp16_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (pkgs);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = pkgs;
	return result;
}

gboolean
pamac_database_should_hold (PamacDatabase* self,
                            const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pkgname != NULL, FALSE);
	{
		AlpmConfig* _tmp0_;
		gboolean _tmp5_ = FALSE;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			AlpmConfig* _tmp1_;
			GHashTable* _tmp2_;
			_tmp1_ = self->priv->alpm_config;
			_tmp2_ = _tmp1_->holdpkgs;
			result = g_hash_table_contains (_tmp2_, pkgname);
			{
				AlpmConfig* _tmp3_;
				_tmp3_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp4_;
			_tmp4_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp5_;
	}
}

static void
pamac_database_get_uninstalled_optdeps_async_data_free (gpointer _data)
{
	PamacDatabaseGetUninstalledOptdepsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->pkgname);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetUninstalledOptdepsAsyncData, _data_);
}

void
pamac_database_get_uninstalled_optdeps_async (PamacDatabase* self,
                                              const gchar* pkgname,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	PamacDatabaseGetUninstalledOptdepsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetUninstalledOptdepsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_uninstalled_optdeps_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (pkgname);
	_g_free0 (_data_->pkgname);
	_data_->pkgname = _tmp1_;
	pamac_database_get_uninstalled_optdeps_async_co (_data_);
}

GPtrArray*
pamac_database_get_uninstalled_optdeps_finish (PamacDatabase* self,
                                               GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetUninstalledOptdepsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		PamacDatabase* self;
		self = _data6_->self;
		_g_free0 (_data6_->pkgname_copy);
		_g_ptr_array_unref0 (_data6_->optdeps);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static gboolean
_pamac_database_get_uninstalled_optdeps_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_uninstalled_optdeps_async_co (self);
	return result;
}

static gint
___lambda10_ (Block6Data* _data6_)
{
	PamacDatabase* self;
	GMainContext* _tmp22_;
	GError* _inner_error0_ = NULL;
	gint result;
	self = _data6_->self;
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_pkg_t* pkg = NULL;
			alpm_handle_t* _tmp1_;
			alpm_pkg_t* _tmp2_;
			alpm_pkg_t* _tmp3_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = pamac_database_get_syncpkg (self, _tmp1_, _data6_->pkgname_copy);
			pkg = _tmp2_;
			_tmp3_ = pkg;
			if (_tmp3_ != NULL) {
				alpm_list_t* optdepends = NULL;
				alpm_pkg_t* _tmp4_;
				alpm_list_t* _tmp5_;
				alpm_list_t* _tmp6_;
				_tmp4_ = pkg;
				_tmp5_ = alpm_pkg_get_optdepends (_tmp4_);
				_tmp6_ = _tmp5_;
				optdepends = _tmp6_;
				while (TRUE) {
					alpm_list_t* _tmp7_;
					gchar* optdep = NULL;
					alpm_list_t* _tmp8_;
					gconstpointer _tmp9_;
					gchar* _tmp10_;
					alpm_pkg_t* satisfier = NULL;
					alpm_handle_t* _tmp11_;
					alpm_db_t* _tmp12_;
					alpm_db_t* _tmp13_;
					alpm_list_t* _tmp14_;
					alpm_list_t* _tmp15_;
					const gchar* _tmp16_;
					alpm_pkg_t* _tmp17_;
					alpm_pkg_t* _tmp18_;
					_tmp7_ = optdepends;
					if (!(_tmp7_ != NULL)) {
						break;
					}
					_tmp8_ = optdepends;
					_tmp9_ = _tmp8_->data;
					_tmp10_ = alpm_dep_compute_string ((alpm_depend_t*) _tmp9_);
					optdep = _tmp10_;
					_tmp11_ = self->priv->alpm_handle;
					_tmp12_ = alpm_get_localdb (_tmp11_);
					_tmp13_ = _tmp12_;
					_tmp14_ = alpm_db_get_pkgcache (_tmp13_);
					_tmp15_ = _tmp14_;
					_tmp16_ = optdep;
					_tmp17_ = alpm_find_satisfier (_tmp15_, _tmp16_);
					satisfier = _tmp17_;
					_tmp18_ = satisfier;
					if (_tmp18_ == NULL) {
						gchar* _tmp19_;
						_tmp19_ = optdep;
						optdep = NULL;
						g_ptr_array_add (_data6_->optdeps, _tmp19_);
					}
					optdepends = alpm_list_next (optdepends);
					_g_free0 (optdep);
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp20_;
			_tmp20_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp21_ = -1;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp21_;
		}
	}
	_tmp22_ = self->priv->_context;
	g_main_context_invoke_full (_tmp22_, G_PRIORITY_DEFAULT, _pamac_database_get_uninstalled_optdeps_async_co_gsource_func, _data6_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda10__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda10_ (self));
	block6_data_unref (self);
	return result;
}

static gpointer
_g_ptr_array_ref0 (gpointer self)
{
	return self ? g_ptr_array_ref (self) : NULL;
}

static gboolean
pamac_database_get_uninstalled_optdeps_async_co (PamacDatabaseGetUninstalledOptdepsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data6_ = g_slice_new0 (Block6Data);
	_data_->_data6_->_ref_count_ = 1;
	_data_->_data6_->self = g_object_ref (_data_->self);
	_data_->_data6_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	_data_->_data6_->optdeps = _data_->_tmp0_;
	_data_->_tmp1_ = g_strdup (_data_->pkgname);
	_data_->_data6_->pkgname_copy = _data_->_tmp1_;
	{
		_data_->_tmp2_ = g_thread_try_new ("get_uninstalled_optdeps", ____lambda10__gthread_func, block6_data_ref (_data_->_data6_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:485: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block6_data_unref (_data_->_data6_);
		_data_->_data6_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _g_ptr_array_ref0 (_data_->_data6_->optdeps);
	_data_->result = _data_->_tmp6_;
	block6_data_unref (_data_->_data6_);
	_data_->_data6_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static PamacAlpmPackageStatic*
pamac_database_initialise_pkg_data (PamacDatabase* self,
                                    alpm_pkg_t* local_pkg,
                                    alpm_pkg_t* sync_pkg)
{
	PamacAlpmPackageStatic* pkg = NULL;
	PamacAlpmPackageStatic* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	PamacAlpmPackageStatic* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = pamac_alpm_package_static_new (sync_pkg, local_pkg, sync_pkg);
	pkg = _tmp0_;
	_tmp1_ = self->priv->_config;
	_tmp2_ = pamac_config_get_enable_appstream (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		GPtrArray* matching_apps = NULL;
		PamacAppstreamPlugin* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		GPtrArray* _tmp7_;
		GPtrArray* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		_tmp4_ = self->priv->appstream_plugin;
		_tmp5_ = alpm_pkg_get_name (sync_pkg);
		_tmp6_ = _tmp5_;
		_tmp7_ = pamac_appstream_plugin_get_pkgname_apps (_tmp4_, _tmp6_);
		matching_apps = _tmp7_;
		_tmp8_ = matching_apps;
		_tmp9_ = vala_g_ptr_array_get_length (_tmp8_);
		_tmp10_ = _tmp9_;
		if (_tmp10_ == 1) {
			PamacAlpmPackageStatic* _tmp11_;
			GPtrArray* _tmp12_;
			gconstpointer _tmp13_;
			_tmp11_ = pkg;
			_tmp12_ = matching_apps;
			_tmp13_ = g_ptr_array_index (_tmp12_, (guint) 0);
			pamac_alpm_package_linked_set_app ((PamacAlpmPackageLinked*) _tmp11_, (PamacApp*) _tmp13_);
		}
		_g_ptr_array_unref0 (matching_apps);
	}
	result = pkg;
	return result;
}

static PamacAlpmPackage*
pamac_database_initialise_pkg (PamacDatabase* self,
                               alpm_pkg_t* alpm_pkg,
                               alpm_pkg_t* sync_pkg)
{
	PamacAlpmPackageLinked* pkg = NULL;
	const gchar* pkgname = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GHashTable* _tmp2_;
	const gchar* _tmp3_;
	gconstpointer _tmp4_;
	PamacAlpmPackageLinked* _tmp5_;
	PamacAlpmPackageLinked* new_pkg = NULL;
	PamacAlpmPackageLinked* _tmp7_;
	PamacConfig* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	GHashTable* _tmp41_;
	PamacAlpmPackageLinked* _tmp42_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	PamacAlpmPackageLinked* _tmp50_;
	GHashTable* _tmp51_;
	PamacAlpmPackageLinked* _tmp52_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	PamacAlpmPackageLinked* _tmp55_;
	PamacAlpmPackageLinked* _tmp56_;
	PamacAlpmPackageLinked* _tmp57_;
	PamacAlpmPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (alpm_pkg == NULL) {
		result = NULL;
		return result;
	}
	pkg = NULL;
	_tmp0_ = alpm_pkg_get_name (alpm_pkg);
	_tmp1_ = _tmp0_;
	pkgname = _tmp1_;
	_tmp2_ = self->priv->pkgs_cache;
	_tmp3_ = pkgname;
	_tmp4_ = g_hash_table_lookup (_tmp2_, _tmp3_);
	pkg = (PamacAlpmPackageLinked*) _tmp4_;
	_tmp5_ = pkg;
	if (_tmp5_ != NULL) {
		PamacAlpmPackageLinked* _tmp6_;
		_tmp6_ = pkg;
		result = (PamacAlpmPackage*) _tmp6_;
		return result;
	}
	_tmp7_ = pamac_alpm_package_linked_new_from_alpm (alpm_pkg, self);
	new_pkg = _tmp7_;
	if (sync_pkg != NULL) {
		PamacAlpmPackageLinked* _tmp8_;
		_tmp8_ = new_pkg;
		pamac_alpm_package_linked_set_sync_pkg (_tmp8_, sync_pkg);
	} else {
		gboolean _tmp9_ = FALSE;
		PamacConfig* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp10_ = self->priv->_config;
		_tmp11_ = pamac_config_get_enable_aur (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_) {
			alpm_pkgfrom_t _tmp13_;
			alpm_pkgfrom_t _tmp14_;
			_tmp13_ = alpm_pkg_get_origin (alpm_pkg);
			_tmp14_ = _tmp13_;
			_tmp9_ = _tmp14_ == ALPM_PKG_FROM_LOCALDB;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			alpm_pkg_t* found_sync_pkg = NULL;
			alpm_handle_t* _tmp15_;
			const gchar* _tmp16_;
			alpm_pkg_t* _tmp17_;
			PamacAlpmPackageLinked* _tmp18_;
			alpm_pkg_t* _tmp19_;
			PamacAlpmPackageLinked* _tmp20_;
			alpm_pkg_t* _tmp21_;
			_tmp15_ = self->priv->alpm_handle;
			_tmp16_ = pkgname;
			_tmp17_ = pamac_database_get_syncpkg (self, _tmp15_, _tmp16_);
			found_sync_pkg = _tmp17_;
			_tmp18_ = new_pkg;
			_tmp19_ = found_sync_pkg;
			pamac_alpm_package_linked_set_sync_pkg (_tmp18_, _tmp19_);
			_tmp20_ = new_pkg;
			pamac_alpm_package_linked_set_local_pkg (_tmp20_, alpm_pkg);
			_tmp21_ = found_sync_pkg;
			if (_tmp21_ == NULL) {
				PamacAURPlugin* _tmp22_;
				const gchar* _tmp23_;
				const gchar* _tmp24_;
				PamacAURInfos* _tmp25_;
				PamacAURInfos* _tmp26_;
				gboolean _tmp27_;
				_tmp22_ = self->priv->aur_plugin;
				_tmp23_ = alpm_pkg_get_name (alpm_pkg);
				_tmp24_ = _tmp23_;
				_tmp25_ = pamac_aur_plugin_get_infos (_tmp22_, _tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = _tmp26_ != NULL;
				_g_object_unref0 (_tmp26_);
				if (_tmp27_) {
					PamacAlpmPackageLinked* _tmp28_;
					_tmp28_ = new_pkg;
					pamac_package_set_repo ((PamacPackage*) _tmp28_, g_dgettext (NULL, "AUR"));
				}
			}
		}
	}
	_tmp29_ = self->priv->_config;
	_tmp30_ = pamac_config_get_enable_appstream (_tmp29_);
	_tmp31_ = _tmp30_;
	if (_tmp31_) {
		GPtrArray* matching_apps = NULL;
		PamacAppstreamPlugin* _tmp32_;
		const gchar* _tmp33_;
		GPtrArray* _tmp34_;
		GPtrArray* _tmp35_;
		gint _tmp36_;
		gint _tmp37_;
		_tmp32_ = self->priv->appstream_plugin;
		_tmp33_ = pkgname;
		_tmp34_ = pamac_appstream_plugin_get_pkgname_apps (_tmp32_, _tmp33_);
		matching_apps = _tmp34_;
		_tmp35_ = matching_apps;
		_tmp36_ = vala_g_ptr_array_get_length (_tmp35_);
		_tmp37_ = _tmp36_;
		if (_tmp37_ == 1) {
			PamacAlpmPackageLinked* _tmp38_;
			GPtrArray* _tmp39_;
			gconstpointer _tmp40_;
			_tmp38_ = new_pkg;
			_tmp39_ = matching_apps;
			_tmp40_ = g_ptr_array_index (_tmp39_, (guint) 0);
			pamac_alpm_package_linked_set_app (_tmp38_, (PamacApp*) _tmp40_);
		}
		_g_ptr_array_unref0 (matching_apps);
	}
	_tmp41_ = self->priv->pkgs_cache;
	_tmp42_ = new_pkg;
	_tmp43_ = pamac_package_get_id ((PamacPackage*) _tmp42_);
	_tmp44_ = _tmp43_;
	if (g_hash_table_contains (_tmp41_, _tmp44_)) {
		GHashTable* _tmp45_;
		PamacAlpmPackageLinked* _tmp46_;
		const gchar* _tmp47_;
		const gchar* _tmp48_;
		gconstpointer _tmp49_;
		_tmp45_ = self->priv->pkgs_cache;
		_tmp46_ = new_pkg;
		_tmp47_ = pamac_package_get_id ((PamacPackage*) _tmp46_);
		_tmp48_ = _tmp47_;
		_tmp49_ = g_hash_table_lookup (_tmp45_, _tmp48_);
		result = (PamacAlpmPackage*) ((PamacAlpmPackageLinked*) _tmp49_);
		_g_object_unref0 (new_pkg);
		return result;
	}
	_tmp50_ = new_pkg;
	pkg = _tmp50_;
	_tmp51_ = self->priv->pkgs_cache;
	_tmp52_ = new_pkg;
	_tmp53_ = pamac_package_get_id ((PamacPackage*) _tmp52_);
	_tmp54_ = _tmp53_;
	_tmp55_ = new_pkg;
	_tmp56_ = _g_object_ref0 (_tmp55_);
	g_hash_table_replace (_tmp51_, _tmp54_, _tmp56_);
	_tmp57_ = pkg;
	result = (PamacAlpmPackage*) _tmp57_;
	_g_object_unref0 (new_pkg);
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static void
pamac_database_initialise_pkgs (PamacDatabase* self,
                                alpm_list_t* alpm_pkgs,
                                GPtrArray** pkgs)
{
	GHashTable* data = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GPtrArray* foreign_pkgnames = NULL;
	GPtrArray* _tmp3_;
	GPtrArray* _tmp101_;
	gint _tmp102_;
	gint _tmp103_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*pkgs != NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, NULL, _g_object_unref0_);
	data = _tmp2_;
	_tmp3_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	foreign_pkgnames = _tmp3_;
	while (TRUE) {
		alpm_pkg_t* alpm_pkg = NULL;
		gconstpointer _tmp4_;
		const gchar* pkgname = NULL;
		alpm_pkg_t* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		PamacAlpmPackageLinked* pkg = NULL;
		GHashTable* _tmp8_;
		const gchar* _tmp9_;
		gconstpointer _tmp10_;
		PamacAlpmPackageLinked* _tmp11_;
		PamacAlpmPackageLinked* _tmp12_;
		alpm_pkg_t* _tmp14_;
		PamacAlpmPackageLinked* _tmp15_;
		gboolean _tmp16_ = FALSE;
		PamacConfig* _tmp17_;
		gboolean _tmp18_;
		gboolean _tmp19_;
		PamacConfig* _tmp38_;
		gboolean _tmp39_;
		gboolean _tmp40_;
		PamacAlpmPackageLinked* _tmp100_;
		if (!(alpm_pkgs != NULL)) {
			break;
		}
		_tmp4_ = alpm_pkgs->data;
		alpm_pkg = (alpm_pkg_t*) _tmp4_;
		_tmp5_ = alpm_pkg;
		_tmp6_ = alpm_pkg_get_name (_tmp5_);
		_tmp7_ = _tmp6_;
		pkgname = _tmp7_;
		_tmp8_ = self->priv->pkgs_cache;
		_tmp9_ = pkgname;
		_tmp10_ = g_hash_table_lookup (_tmp8_, _tmp9_);
		_tmp11_ = _g_object_ref0 ((PamacAlpmPackageLinked*) _tmp10_);
		pkg = _tmp11_;
		_tmp12_ = pkg;
		if (_tmp12_ != NULL) {
			PamacAlpmPackageLinked* _tmp13_;
			_tmp13_ = pkg;
			g_ptr_array_add (*pkgs, (PamacAlpmPackage*) _tmp13_);
			alpm_pkgs = alpm_list_next (alpm_pkgs);
			_g_object_unref0 (pkg);
			continue;
		}
		_tmp14_ = alpm_pkg;
		_tmp15_ = pamac_alpm_package_linked_new_from_alpm (_tmp14_, self);
		_g_object_unref0 (pkg);
		pkg = _tmp15_;
		_tmp17_ = self->priv->_config;
		_tmp18_ = pamac_config_get_enable_aur (_tmp17_);
		_tmp19_ = _tmp18_;
		if (_tmp19_) {
			alpm_pkg_t* _tmp20_;
			alpm_pkgfrom_t _tmp21_;
			alpm_pkgfrom_t _tmp22_;
			_tmp20_ = alpm_pkg;
			_tmp21_ = alpm_pkg_get_origin (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp16_ = _tmp22_ == ALPM_PKG_FROM_LOCALDB;
		} else {
			_tmp16_ = FALSE;
		}
		if (_tmp16_) {
			alpm_pkg_t* sync_pkg = NULL;
			alpm_handle_t* _tmp23_;
			const gchar* _tmp24_;
			alpm_pkg_t* _tmp25_;
			PamacAlpmPackageLinked* _tmp26_;
			alpm_pkg_t* _tmp27_;
			PamacAlpmPackageLinked* _tmp28_;
			alpm_pkg_t* _tmp29_;
			alpm_pkg_t* _tmp30_;
			_tmp23_ = self->priv->alpm_handle;
			_tmp24_ = pkgname;
			_tmp25_ = pamac_database_get_syncpkg (self, _tmp23_, _tmp24_);
			sync_pkg = _tmp25_;
			_tmp26_ = pkg;
			_tmp27_ = sync_pkg;
			pamac_alpm_package_linked_set_sync_pkg (_tmp26_, _tmp27_);
			_tmp28_ = pkg;
			_tmp29_ = alpm_pkg;
			pamac_alpm_package_linked_set_local_pkg (_tmp28_, _tmp29_);
			_tmp30_ = sync_pkg;
			if (_tmp30_ == NULL) {
				GPtrArray* _tmp31_;
				const gchar* _tmp32_;
				gchar* _tmp33_;
				GHashTable* _tmp34_;
				const gchar* _tmp35_;
				PamacAlpmPackageLinked* _tmp36_;
				PamacAlpmPackageLinked* _tmp37_;
				_tmp31_ = foreign_pkgnames;
				_tmp32_ = pkgname;
				_tmp33_ = g_strdup (_tmp32_);
				g_ptr_array_add (_tmp31_, _tmp33_);
				_tmp34_ = data;
				_tmp35_ = pkgname;
				_tmp36_ = pkg;
				_tmp37_ = _g_object_ref0 (_tmp36_);
				g_hash_table_insert (_tmp34_, _tmp35_, _tmp37_);
			}
		}
		_tmp38_ = self->priv->_config;
		_tmp39_ = pamac_config_get_enable_appstream (_tmp38_);
		_tmp40_ = _tmp39_;
		if (_tmp40_) {
			GPtrArray* apps = NULL;
			PamacAppstreamPlugin* _tmp41_;
			const gchar* _tmp42_;
			GPtrArray* _tmp43_;
			guint apps_length = 0U;
			GPtrArray* _tmp44_;
			gint _tmp45_;
			gint _tmp46_;
			_tmp41_ = self->priv->appstream_plugin;
			_tmp42_ = pkgname;
			_tmp43_ = pamac_appstream_plugin_get_pkgname_apps (_tmp41_, _tmp42_);
			apps = _tmp43_;
			_tmp44_ = apps;
			_tmp45_ = vala_g_ptr_array_get_length (_tmp44_);
			_tmp46_ = _tmp45_;
			apps_length = (guint) _tmp46_;
			if (apps_length > ((guint) 0)) {
				PamacApp* app = NULL;
				GPtrArray* _tmp47_;
				gconstpointer _tmp48_;
				PamacAlpmPackageLinked* _tmp49_;
				PamacApp* _tmp50_;
				PamacAlpmPackageLinked* cached_pkg = NULL;
				GHashTable* _tmp51_;
				PamacAlpmPackageLinked* _tmp52_;
				const gchar* _tmp53_;
				const gchar* _tmp54_;
				gconstpointer _tmp55_;
				PamacAlpmPackageLinked* _tmp56_;
				_tmp47_ = apps;
				_tmp48_ = g_ptr_array_index (_tmp47_, (guint) 0);
				app = (PamacApp*) _tmp48_;
				_tmp49_ = pkg;
				_tmp50_ = app;
				pamac_alpm_package_linked_set_app (_tmp49_, _tmp50_);
				_tmp51_ = self->priv->pkgs_cache;
				_tmp52_ = pkg;
				_tmp53_ = pamac_package_get_id ((PamacPackage*) _tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = g_hash_table_lookup (_tmp51_, _tmp54_);
				cached_pkg = (PamacAlpmPackageLinked*) _tmp55_;
				_tmp56_ = cached_pkg;
				if (_tmp56_ == NULL) {
					GHashTable* _tmp57_;
					PamacAlpmPackageLinked* _tmp58_;
					const gchar* _tmp59_;
					const gchar* _tmp60_;
					PamacAlpmPackageLinked* _tmp61_;
					PamacAlpmPackageLinked* _tmp62_;
					_tmp57_ = self->priv->pkgs_cache;
					_tmp58_ = pkg;
					_tmp59_ = pamac_package_get_id ((PamacPackage*) _tmp58_);
					_tmp60_ = _tmp59_;
					_tmp61_ = pkg;
					_tmp62_ = _g_object_ref0 (_tmp61_);
					g_hash_table_replace (_tmp57_, _tmp60_, _tmp62_);
				} else {
					PamacAlpmPackageLinked* _tmp63_;
					PamacAlpmPackageLinked* _tmp64_;
					_tmp63_ = cached_pkg;
					_tmp64_ = _g_object_ref0 (_tmp63_);
					_g_object_unref0 (pkg);
					pkg = _tmp64_;
				}
				{
					guint i = 0U;
					i = (guint) 1;
					{
						gboolean _tmp65_ = FALSE;
						_tmp65_ = TRUE;
						while (TRUE) {
							GPtrArray* _tmp67_;
							gconstpointer _tmp68_;
							GHashTable* _tmp69_;
							PamacApp* _tmp70_;
							const gchar* _tmp71_;
							const gchar* _tmp72_;
							gconstpointer _tmp73_;
							PamacAlpmPackageLinked* _tmp74_;
							if (!_tmp65_) {
								guint _tmp66_;
								_tmp66_ = i;
								i = _tmp66_ + 1;
							}
							_tmp65_ = FALSE;
							if (!(i < apps_length)) {
								break;
							}
							_tmp67_ = apps;
							_tmp68_ = g_ptr_array_index (_tmp67_, i);
							app = (PamacApp*) _tmp68_;
							_tmp69_ = self->priv->pkgs_cache;
							_tmp70_ = app;
							_tmp71_ = pamac_app_get_id (_tmp70_);
							_tmp72_ = _tmp71_;
							_tmp73_ = g_hash_table_lookup (_tmp69_, _tmp72_);
							cached_pkg = (PamacAlpmPackageLinked*) _tmp73_;
							_tmp74_ = cached_pkg;
							if (_tmp74_ == NULL) {
								PamacAlpmPackageLinked* pkg_dup = NULL;
								alpm_pkg_t* _tmp75_;
								PamacAlpmPackageLinked* _tmp76_;
								PamacAlpmPackageLinked* _tmp77_;
								GPtrArray* _tmp78_;
								gconstpointer _tmp79_;
								PamacAlpmPackageLinked* _tmp80_;
								GHashTable* _tmp81_;
								PamacAlpmPackageLinked* _tmp82_;
								const gchar* _tmp83_;
								const gchar* _tmp84_;
								PamacAlpmPackageLinked* _tmp85_;
								PamacAlpmPackageLinked* _tmp86_;
								_tmp75_ = alpm_pkg;
								_tmp76_ = pamac_alpm_package_linked_new_from_alpm (_tmp75_, self);
								pkg_dup = _tmp76_;
								_tmp77_ = pkg_dup;
								_tmp78_ = apps;
								_tmp79_ = g_ptr_array_index (_tmp78_, i);
								pamac_alpm_package_linked_set_app (_tmp77_, (PamacApp*) _tmp79_);
								_tmp80_ = pkg_dup;
								g_ptr_array_add (*pkgs, (PamacAlpmPackage*) _tmp80_);
								_tmp81_ = self->priv->pkgs_cache;
								_tmp82_ = pkg_dup;
								_tmp83_ = pamac_package_get_id ((PamacPackage*) _tmp82_);
								_tmp84_ = _tmp83_;
								_tmp85_ = pkg_dup;
								_tmp86_ = _g_object_ref0 (_tmp85_);
								g_hash_table_replace (_tmp81_, _tmp84_, _tmp86_);
								_g_object_unref0 (pkg_dup);
							} else {
								PamacAlpmPackageLinked* _tmp87_;
								_tmp87_ = cached_pkg;
								g_ptr_array_add (*pkgs, (PamacAlpmPackage*) _tmp87_);
							}
						}
					}
				}
			} else {
				GHashTable* _tmp88_;
				PamacAlpmPackageLinked* _tmp89_;
				const gchar* _tmp90_;
				const gchar* _tmp91_;
				PamacAlpmPackageLinked* _tmp92_;
				PamacAlpmPackageLinked* _tmp93_;
				_tmp88_ = self->priv->pkgs_cache;
				_tmp89_ = pkg;
				_tmp90_ = pamac_package_get_id ((PamacPackage*) _tmp89_);
				_tmp91_ = _tmp90_;
				_tmp92_ = pkg;
				_tmp93_ = _g_object_ref0 (_tmp92_);
				g_hash_table_replace (_tmp88_, _tmp91_, _tmp93_);
			}
			_g_ptr_array_unref0 (apps);
		} else {
			GHashTable* _tmp94_;
			PamacAlpmPackageLinked* _tmp95_;
			const gchar* _tmp96_;
			const gchar* _tmp97_;
			PamacAlpmPackageLinked* _tmp98_;
			PamacAlpmPackageLinked* _tmp99_;
			_tmp94_ = self->priv->pkgs_cache;
			_tmp95_ = pkg;
			_tmp96_ = pamac_package_get_id ((PamacPackage*) _tmp95_);
			_tmp97_ = _tmp96_;
			_tmp98_ = pkg;
			_tmp99_ = _g_object_ref0 (_tmp98_);
			g_hash_table_replace (_tmp94_, _tmp97_, _tmp99_);
		}
		_tmp100_ = pkg;
		g_ptr_array_add (*pkgs, (PamacAlpmPackage*) _tmp100_);
		alpm_pkgs = alpm_list_next (alpm_pkgs);
		_g_object_unref0 (pkg);
	}
	_tmp101_ = foreign_pkgnames;
	_tmp102_ = vala_g_ptr_array_get_length (_tmp101_);
	_tmp103_ = _tmp102_;
	if (_tmp103_ > 0) {
		GPtrArray* aur_infos_list = NULL;
		PamacAURPlugin* _tmp104_;
		GPtrArray* _tmp105_;
		GPtrArray* _tmp106_;
		GPtrArray* _tmp107_;
		_tmp104_ = self->priv->aur_plugin;
		_tmp105_ = foreign_pkgnames;
		_tmp106_ = pamac_aur_plugin_get_multi_infos (_tmp104_, _tmp105_);
		aur_infos_list = _tmp106_;
		_tmp107_ = aur_infos_list;
		{
			GPtrArray* aur_infos_collection = NULL;
			guint aur_infos_index = 0U;
			aur_infos_collection = _tmp107_;
			for (aur_infos_index = 0; aur_infos_index < aur_infos_collection->len; aur_infos_index = aur_infos_index + 1) {
				PamacAURInfos* aur_infos = NULL;
				aur_infos = (PamacAURInfos*) g_ptr_array_index (aur_infos_collection, aur_infos_index);
				{
					PamacAlpmPackageLinked* pkg = NULL;
					GHashTable* _tmp108_;
					PamacAURInfos* _tmp109_;
					const gchar* _tmp110_;
					const gchar* _tmp111_;
					gconstpointer _tmp112_;
					PamacAlpmPackageLinked* _tmp113_;
					_tmp108_ = data;
					_tmp109_ = aur_infos;
					_tmp110_ = pamac_aur_infos_get_name (_tmp109_);
					_tmp111_ = _tmp110_;
					_tmp112_ = g_hash_table_lookup (_tmp108_, _tmp111_);
					pkg = (PamacAlpmPackageLinked*) _tmp112_;
					_tmp113_ = pkg;
					if (_tmp113_ != NULL) {
						PamacAlpmPackageLinked* _tmp114_;
						_tmp114_ = pkg;
						pamac_package_set_repo ((PamacPackage*) _tmp114_, g_dgettext (NULL, "AUR"));
					}
				}
			}
		}
		_g_ptr_array_unref0 (aur_infos_list);
	}
	_g_ptr_array_unref0 (foreign_pkgnames);
	_g_hash_table_unref0 (data);
}

GPtrArray*
pamac_database_get_installed_pkgs (PamacDatabase* self)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	{
		AlpmConfig* _tmp1_;
		_tmp1_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_db_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_list_t* _tmp6_;
			_tmp2_ = self->priv->alpm_handle;
			_tmp3_ = alpm_get_localdb (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp5_ = alpm_db_get_pkgcache (_tmp4_);
			_tmp6_ = _tmp5_;
			pamac_database_initialise_pkgs (self, _tmp6_, &pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp7_;
			_tmp7_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (pkgs);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = pkgs;
	return result;
}

static void
pamac_database_get_installed_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetInstalledPkgsAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetInstalledPkgsAsyncData, _data_);
}

void
pamac_database_get_installed_pkgs_async (PamacDatabase* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	PamacDatabaseGetInstalledPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetInstalledPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_installed_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_installed_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_get_installed_pkgs_finish (PamacDatabase* self,
                                          GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetInstalledPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		PamacDatabase* self;
		self = _data7_->self;
		_g_ptr_array_unref0 (_data7_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static gboolean
_pamac_database_get_installed_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_installed_pkgs_async_co (self);
	return result;
}

static gint
___lambda11_ (Block7Data* _data7_)
{
	PamacDatabase* self;
	GMainContext* _tmp8_;
	GError* _inner_error0_ = NULL;
	gint result;
	self = _data7_->self;
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_list_t* _tmp4_;
			alpm_list_t* _tmp5_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkgcache (_tmp3_);
			_tmp5_ = _tmp4_;
			pamac_database_initialise_pkgs (self, _tmp5_, &_data7_->pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp6_;
			_tmp6_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp7_ = -1;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp7_;
		}
	}
	_tmp8_ = self->priv->_context;
	g_main_context_invoke_full (_tmp8_, G_PRIORITY_DEFAULT, _pamac_database_get_installed_pkgs_async_co_gsource_func, _data7_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda11__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda11_ (self));
	block7_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_installed_pkgs_async_co (PamacDatabaseGetInstalledPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data7_ = g_slice_new0 (Block7Data);
	_data_->_data7_->_ref_count_ = 1;
	_data_->_data7_->self = g_object_ref (_data_->self);
	_data_->_data7_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data7_->pkgs = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_installed_pkgs", ____lambda11__gthread_func, block7_data_ref (_data_->_data7_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:638: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block7_data_unref (_data_->_data7_);
		_data_->_data7_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_ptr_array_ref0 (_data_->_data7_->pkgs);
	_data_->result = _data_->_tmp5_;
	block7_data_unref (_data_->_data7_);
	_data_->_data7_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_installed_apps_async_data_free (gpointer _data)
{
	PamacDatabaseGetInstalledAppsAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetInstalledAppsAsyncData, _data_);
}

void
pamac_database_get_installed_apps_async (PamacDatabase* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	PamacDatabaseGetInstalledAppsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetInstalledAppsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_installed_apps_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_installed_apps_async_co (_data_);
}

GPtrArray*
pamac_database_get_installed_apps_finish (PamacDatabase* self,
                                          GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetInstalledAppsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		PamacDatabase* self;
		self = _data8_->self;
		_g_ptr_array_unref0 (_data8_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static gboolean
_pamac_database_get_installed_apps_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_installed_apps_async_co (self);
	return result;
}

static gint
____lambda12_ (Block8Data* _data8_)
{
	PamacDatabase* self;
	GMainContext* _tmp38_;
	GError* _inner_error0_ = NULL;
	gint result;
	self = _data8_->self;
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			PamacAppstreamPlugin* _tmp1_;
			GPtrArray* _tmp2_;
			_tmp1_ = self->priv->appstream_plugin;
			_tmp2_ = pamac_appstream_plugin_get_apps (_tmp1_);
			{
				GPtrArray* apps_collection = NULL;
				guint apps_index = 0U;
				apps_collection = _tmp2_;
				for (apps_index = 0; apps_index < apps_collection->len; apps_index = apps_index + 1) {
					GHashTable* apps = NULL;
					apps = (GHashTable*) g_ptr_array_index (apps_collection, apps_index);
					{
						GHashTableIter iter = {0};
						GHashTable* _tmp3_;
						PamacApp* app = NULL;
						_tmp3_ = apps;
						g_hash_table_iter_init (&iter, _tmp3_);
						while (TRUE) {
							gconstpointer _tmp4_ = NULL;
							gboolean _tmp5_;
							const gchar* pkgname = NULL;
							PamacApp* _tmp6_;
							const gchar* _tmp7_;
							const gchar* _tmp8_;
							alpm_pkg_t* local_pkg = NULL;
							alpm_handle_t* _tmp9_;
							alpm_db_t* _tmp10_;
							alpm_db_t* _tmp11_;
							const gchar* _tmp12_;
							alpm_pkg_t* _tmp13_;
							alpm_pkg_t* _tmp14_;
							_tmp5_ = g_hash_table_iter_next (&iter, (gpointer*) NULL, (gpointer*) (&_tmp4_));
							app = (PamacApp*) _tmp4_;
							if (!_tmp5_) {
								break;
							}
							_tmp6_ = app;
							_tmp7_ = pamac_app_get_pkgname (_tmp6_);
							_tmp8_ = _tmp7_;
							pkgname = _tmp8_;
							_tmp9_ = self->priv->alpm_handle;
							_tmp10_ = alpm_get_localdb (_tmp9_);
							_tmp11_ = _tmp10_;
							_tmp12_ = pkgname;
							_tmp13_ = alpm_db_get_pkg (_tmp11_, _tmp12_);
							local_pkg = _tmp13_;
							_tmp14_ = local_pkg;
							if (_tmp14_ != NULL) {
								PamacAlpmPackageLinked* pkg = NULL;
								GHashTable* _tmp15_;
								PamacApp* _tmp16_;
								const gchar* _tmp17_;
								const gchar* _tmp18_;
								gconstpointer _tmp19_;
								PamacAlpmPackageLinked* _tmp20_;
								PamacAlpmPackageLinked* _tmp21_;
								GPtrArray* _tmp34_;
								PamacAlpmPackageLinked* _tmp35_;
								_tmp15_ = self->priv->pkgs_cache;
								_tmp16_ = app;
								_tmp17_ = pamac_app_get_id (_tmp16_);
								_tmp18_ = _tmp17_;
								_tmp19_ = g_hash_table_lookup (_tmp15_, _tmp18_);
								_tmp20_ = _g_object_ref0 ((PamacAlpmPackageLinked*) _tmp19_);
								pkg = _tmp20_;
								_tmp21_ = pkg;
								if (_tmp21_ == NULL) {
									alpm_pkg_t* _tmp22_;
									PamacAlpmPackageLinked* _tmp23_;
									PamacAlpmPackageLinked* _tmp24_;
									alpm_pkg_t* _tmp25_;
									PamacAlpmPackageLinked* _tmp26_;
									PamacApp* _tmp27_;
									GHashTable* _tmp28_;
									PamacAlpmPackageLinked* _tmp29_;
									const gchar* _tmp30_;
									const gchar* _tmp31_;
									PamacAlpmPackageLinked* _tmp32_;
									PamacAlpmPackageLinked* _tmp33_;
									_tmp22_ = local_pkg;
									_tmp23_ = pamac_alpm_package_linked_new_from_alpm (_tmp22_, self);
									_g_object_unref0 (pkg);
									pkg = _tmp23_;
									_tmp24_ = pkg;
									_tmp25_ = local_pkg;
									pamac_alpm_package_linked_set_local_pkg (_tmp24_, _tmp25_);
									_tmp26_ = pkg;
									_tmp27_ = app;
									pamac_alpm_package_linked_set_app (_tmp26_, _tmp27_);
									_tmp28_ = self->priv->pkgs_cache;
									_tmp29_ = pkg;
									_tmp30_ = pamac_package_get_id ((PamacPackage*) _tmp29_);
									_tmp31_ = _tmp30_;
									_tmp32_ = pkg;
									_tmp33_ = _g_object_ref0 (_tmp32_);
									g_hash_table_replace (_tmp28_, _tmp31_, _tmp33_);
								}
								_tmp34_ = _data8_->pkgs;
								_tmp35_ = pkg;
								g_ptr_array_add (_tmp34_, (PamacAlpmPackage*) _tmp35_);
								_g_object_unref0 (pkg);
							}
						}
					}
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp36_;
			_tmp36_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp37_ = -1;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp37_;
		}
	}
	_tmp38_ = self->priv->_context;
	g_main_context_invoke_full (_tmp38_, G_PRIORITY_DEFAULT, _pamac_database_get_installed_apps_async_co_gsource_func, _data8_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda12__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda12_ (self));
	block8_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_installed_apps_async_co (PamacDatabaseGetInstalledAppsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data8_ = g_slice_new0 (Block8Data);
	_data_->_data8_->_ref_count_ = 1;
	_data_->_data8_->self = g_object_ref (_data_->self);
	_data_->_data8_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data8_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_appstream (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		{
			_data_->_tmp4_ = g_thread_try_new ("get_installed_apps", _____lambda12__gthread_func, block8_data_ref (_data_->_data8_), &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_thread_unref0 (_data_->_tmp5_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_->message;
			g_warning ("database.vala:673: %s", _data_->_tmp7_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block8_data_unref (_data_->_data8_);
			_data_->_data8_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp8_ = _data_->_data8_->pkgs;
	_data_->_tmp9_ = _g_ptr_array_ref0 (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	block8_data_unref (_data_->_data8_);
	_data_->_data8_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_explicitly_installed_pkgs_real (PamacDatabase* self,
                                                   GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* alpm_pkgs = NULL;
			alpm_list_t* pkgcache = NULL;
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_list_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_list_t* _tmp13_;
			alpm_pkgs = NULL;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkgcache (_tmp3_);
			_tmp5_ = _tmp4_;
			pkgcache = _tmp5_;
			while (TRUE) {
				alpm_list_t* _tmp6_;
				alpm_pkg_t* alpm_pkg = NULL;
				alpm_list_t* _tmp7_;
				gconstpointer _tmp8_;
				alpm_pkg_t* _tmp9_;
				alpm_pkgreason_t _tmp10_;
				alpm_pkgreason_t _tmp11_;
				_tmp6_ = pkgcache;
				if (!(_tmp6_ != NULL)) {
					break;
				}
				_tmp7_ = pkgcache;
				_tmp8_ = _tmp7_->data;
				alpm_pkg = (alpm_pkg_t*) _tmp8_;
				_tmp9_ = alpm_pkg;
				_tmp10_ = alpm_pkg_get_reason (_tmp9_);
				_tmp11_ = _tmp10_;
				if (_tmp11_ == ALPM_PKG_REASON_EXPLICIT) {
					alpm_pkg_t* _tmp12_;
					_tmp12_ = alpm_pkg;
					alpm_pkgs = alpm_list_add (alpm_pkgs, _tmp12_);
				}
				pkgcache = alpm_list_next (pkgcache);
			}
			_tmp13_ = alpm_pkgs;
			pamac_database_initialise_pkgs (self, _tmp13_, pkgs);
			_alpm_list_free0 (alpm_pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp14_;
			_tmp14_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_get_explicitly_installed_pkgs (PamacDatabase* self)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	pamac_database_get_explicitly_installed_pkgs_real (self, &pkgs);
	result = pkgs;
	return result;
}

static void
pamac_database_get_explicitly_installed_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetExplicitlyInstalledPkgsAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetExplicitlyInstalledPkgsAsyncData, _data_);
}

void
pamac_database_get_explicitly_installed_pkgs_async (PamacDatabase* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	PamacDatabaseGetExplicitlyInstalledPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetExplicitlyInstalledPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_explicitly_installed_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_explicitly_installed_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_get_explicitly_installed_pkgs_finish (PamacDatabase* self,
                                                     GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetExplicitlyInstalledPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		PamacDatabase* self;
		self = _data9_->self;
		_g_ptr_array_unref0 (_data9_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

static gboolean
_pamac_database_get_explicitly_installed_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_explicitly_installed_pkgs_async_co (self);
	return result;
}

static gint
___lambda13_ (Block9Data* _data9_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data9_->self;
	pamac_database_get_explicitly_installed_pkgs_real (self, &_data9_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_explicitly_installed_pkgs_async_co_gsource_func, _data9_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda13__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda13_ (self));
	block9_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_explicitly_installed_pkgs_async_co (PamacDatabaseGetExplicitlyInstalledPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data9_ = g_slice_new0 (Block9Data);
	_data_->_data9_->_ref_count_ = 1;
	_data_->_data9_->self = g_object_ref (_data_->self);
	_data_->_data9_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data9_->pkgs = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_explicitly_installed_pkgs", ____lambda13__gthread_func, block9_data_ref (_data_->_data9_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:710: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block9_data_unref (_data_->_data9_);
		_data_->_data9_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_ptr_array_ref0 (_data_->_data9_->pkgs);
	_data_->result = _data_->_tmp5_;
	block9_data_unref (_data_->_data9_);
	_data_->_data9_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_foreign_pkgs_real (PamacDatabase* self,
                                      GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* alpm_pkgs = NULL;
			alpm_list_t* pkgcache = NULL;
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_list_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_list_t* _tmp13_;
			alpm_pkgs = NULL;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkgcache (_tmp3_);
			_tmp5_ = _tmp4_;
			pkgcache = _tmp5_;
			while (TRUE) {
				alpm_list_t* _tmp6_;
				alpm_pkg_t* alpm_pkg = NULL;
				alpm_list_t* _tmp7_;
				gconstpointer _tmp8_;
				alpm_pkg_t* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_;
				_tmp6_ = pkgcache;
				if (!(_tmp6_ != NULL)) {
					break;
				}
				_tmp7_ = pkgcache;
				_tmp8_ = _tmp7_->data;
				alpm_pkg = (alpm_pkg_t*) _tmp8_;
				_tmp9_ = alpm_pkg;
				_tmp10_ = alpm_pkg_get_name (_tmp9_);
				_tmp11_ = _tmp10_;
				if (!pamac_database_is_syncpkg (self, _tmp11_)) {
					alpm_pkg_t* _tmp12_;
					_tmp12_ = alpm_pkg;
					alpm_pkgs = alpm_list_add (alpm_pkgs, _tmp12_);
				}
				pkgcache = alpm_list_next (pkgcache);
			}
			_tmp13_ = alpm_pkgs;
			pamac_database_initialise_pkgs (self, _tmp13_, pkgs);
			_alpm_list_free0 (alpm_pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp14_;
			_tmp14_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_get_foreign_pkgs (PamacDatabase* self)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	pamac_database_get_foreign_pkgs_real (self, &pkgs);
	result = pkgs;
	return result;
}

static void
pamac_database_get_foreign_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetForeignPkgsAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetForeignPkgsAsyncData, _data_);
}

void
pamac_database_get_foreign_pkgs_async (PamacDatabase* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	PamacDatabaseGetForeignPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetForeignPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_foreign_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_foreign_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_get_foreign_pkgs_finish (PamacDatabase* self,
                                        GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetForeignPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		PamacDatabase* self;
		self = _data10_->self;
		_g_ptr_array_unref0 (_data10_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static gboolean
_pamac_database_get_foreign_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_foreign_pkgs_async_co (self);
	return result;
}

static gint
___lambda14_ (Block10Data* _data10_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data10_->self;
	pamac_database_get_foreign_pkgs_real (self, &_data10_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_foreign_pkgs_async_co_gsource_func, _data10_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda14__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda14_ (self));
	block10_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_foreign_pkgs_async_co (PamacDatabaseGetForeignPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data10_ = g_slice_new0 (Block10Data);
	_data_->_data10_->_ref_count_ = 1;
	_data_->_data10_->self = g_object_ref (_data_->self);
	_data_->_data10_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data10_->pkgs = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_foreign_pkgs", ____lambda14__gthread_func, block10_data_ref (_data_->_data10_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:746: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block10_data_unref (_data_->_data10_);
		_data_->_data10_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_ptr_array_ref0 (_data_->_data10_->pkgs);
	_data_->result = _data_->_tmp5_;
	block10_data_unref (_data_->_data10_);
	_data_->_data10_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
_g_free_alpm_list_fn_free (gconstpointer a)
{
	g_free (a);
}

static void
pamac_database_get_orphans_real (PamacDatabase* self,
                                 GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* alpm_pkgs = NULL;
			alpm_list_t* pkgcache = NULL;
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_list_t* _tmp4_;
			alpm_list_t* _tmp5_;
			alpm_list_t* _tmp21_;
			alpm_pkgs = NULL;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_pkgcache (_tmp3_);
			_tmp5_ = _tmp4_;
			pkgcache = _tmp5_;
			while (TRUE) {
				alpm_list_t* _tmp6_;
				alpm_pkg_t* alpm_pkg = NULL;
				alpm_list_t* _tmp7_;
				gconstpointer _tmp8_;
				alpm_pkg_t* _tmp9_;
				alpm_pkgreason_t _tmp10_;
				alpm_pkgreason_t _tmp11_;
				_tmp6_ = pkgcache;
				if (!(_tmp6_ != NULL)) {
					break;
				}
				_tmp7_ = pkgcache;
				_tmp8_ = _tmp7_->data;
				alpm_pkg = (alpm_pkg_t*) _tmp8_;
				_tmp9_ = alpm_pkg;
				_tmp10_ = alpm_pkg_get_reason (_tmp9_);
				_tmp11_ = _tmp10_;
				if (_tmp11_ == ALPM_PKG_REASON_DEPEND) {
					alpm_list_t* requiredby = NULL;
					alpm_pkg_t* _tmp12_;
					alpm_list_t* _tmp13_;
					alpm_list_t* _tmp14_;
					_tmp12_ = alpm_pkg;
					_tmp13_ = alpm_pkg_compute_requiredby (_tmp12_);
					requiredby = _tmp13_;
					_tmp14_ = requiredby;
					if (_tmp14_ == NULL) {
						alpm_list_t* optionalfor = NULL;
						alpm_pkg_t* _tmp15_;
						alpm_list_t* _tmp16_;
						alpm_list_t* _tmp17_;
						_tmp15_ = alpm_pkg;
						_tmp16_ = alpm_pkg_compute_optionalfor (_tmp15_);
						optionalfor = _tmp16_;
						_tmp17_ = optionalfor;
						if (_tmp17_ == NULL) {
							alpm_pkg_t* _tmp18_;
							_tmp18_ = alpm_pkg;
							alpm_pkgs = alpm_list_add (alpm_pkgs, _tmp18_);
						} else {
							alpm_list_t* _tmp19_;
							_tmp19_ = optionalfor;
							alpm_list_free_inner (_tmp19_, _g_free_alpm_list_fn_free);
						}
						_alpm_list_free0 (optionalfor);
					} else {
						alpm_list_t* _tmp20_;
						_tmp20_ = requiredby;
						alpm_list_free_inner (_tmp20_, _g_free_alpm_list_fn_free);
					}
					_alpm_list_free0 (requiredby);
				}
				pkgcache = alpm_list_next (pkgcache);
			}
			_tmp21_ = alpm_pkgs;
			pamac_database_initialise_pkgs (self, _tmp21_, pkgs);
			_alpm_list_free0 (alpm_pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp22_;
			_tmp22_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_get_orphans (PamacDatabase* self)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	pamac_database_get_orphans_real (self, &pkgs);
	result = pkgs;
	return result;
}

static void
pamac_database_get_orphans_async_data_free (gpointer _data)
{
	PamacDatabaseGetOrphansAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetOrphansAsyncData, _data_);
}

void
pamac_database_get_orphans_async (PamacDatabase* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	PamacDatabaseGetOrphansAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetOrphansAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_orphans_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_orphans_async_co (_data_);
}

GPtrArray*
pamac_database_get_orphans_finish (PamacDatabase* self,
                                   GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetOrphansAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		PamacDatabase* self;
		self = _data11_->self;
		_g_ptr_array_unref0 (_data11_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static gboolean
_pamac_database_get_orphans_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_orphans_async_co (self);
	return result;
}

static gint
___lambda15_ (Block11Data* _data11_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data11_->self;
	pamac_database_get_orphans_real (self, &_data11_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_orphans_async_co_gsource_func, _data11_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda15__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda15_ (self));
	block11_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_orphans_async_co (PamacDatabaseGetOrphansAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data11_ = g_slice_new0 (Block11Data);
	_data_->_data11_->_ref_count_ = 1;
	_data_->_data11_->self = g_object_ref (_data_->self);
	_data_->_data11_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data11_->pkgs = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_orphans", ____lambda15__gthread_func, block11_data_ref (_data_->_data11_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:792: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block11_data_unref (_data_->_data11_);
		_data_->_data11_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_ptr_array_ref0 (_data_->_data11_->pkgs);
	_data_->result = _data_->_tmp5_;
	block11_data_unref (_data_->_data11_);
	_data_->_data11_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

alpm_pkg_t*
pamac_database_intern_get_syncpkg (PamacDatabase* self,
                                   const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	alpm_pkg_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* _tmp1_;
			alpm_pkg_t* _tmp2_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = pamac_database_get_syncpkg (self, _tmp1_, pkgname);
			result = _tmp2_;
			{
				AlpmConfig* _tmp3_;
				_tmp3_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp4_;
			_tmp4_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

static alpm_pkg_t*
pamac_database_get_syncpkg (PamacDatabase* self,
                            alpm_handle_t* handle,
                            const gchar* pkgname)
{
	alpm_pkg_t* pkg = NULL;
	alpm_list_t* syncdbs = NULL;
	alpm_list_t* _tmp0_;
	alpm_list_t* _tmp1_;
	alpm_pkg_t* _tmp8_;
	alpm_pkg_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	pkg = NULL;
	_tmp0_ = alpm_get_syncdbs (handle);
	_tmp1_ = _tmp0_;
	syncdbs = _tmp1_;
	while (TRUE) {
		alpm_list_t* _tmp2_;
		alpm_db_t* db = NULL;
		alpm_list_t* _tmp3_;
		gconstpointer _tmp4_;
		alpm_db_t* _tmp5_;
		alpm_pkg_t* _tmp6_;
		alpm_pkg_t* _tmp7_;
		_tmp2_ = syncdbs;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = syncdbs;
		_tmp4_ = _tmp3_->data;
		db = (alpm_db_t*) _tmp4_;
		_tmp5_ = db;
		_tmp6_ = alpm_db_get_pkg (_tmp5_, pkgname);
		pkg = _tmp6_;
		_tmp7_ = pkg;
		if (_tmp7_ != NULL) {
			break;
		}
		syncdbs = alpm_list_next (syncdbs);
	}
	_tmp8_ = pkg;
	result = _tmp8_;
	return result;
}

static gboolean
pamac_database_is_syncpkg (PamacDatabase* self,
                           const gchar* pkgname)
{
	alpm_pkg_t* pkg = NULL;
	alpm_handle_t* _tmp0_;
	alpm_pkg_t* _tmp1_;
	alpm_pkg_t* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pkgname != NULL, FALSE);
	_tmp0_ = self->priv->alpm_handle;
	_tmp1_ = pamac_database_get_syncpkg (self, _tmp0_, pkgname);
	pkg = _tmp1_;
	_tmp2_ = pkg;
	if (_tmp2_ != NULL) {
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gboolean
pamac_database_is_sync_pkg (PamacDatabase* self,
                            const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pkgname != NULL, FALSE);
	{
		AlpmConfig* _tmp0_;
		gboolean _tmp3_ = FALSE;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			result = pamac_database_is_syncpkg (self, pkgname);
			{
				AlpmConfig* _tmp1_;
				_tmp1_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp2_;
			_tmp2_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp3_;
	}
}

PamacAlpmPackage*
pamac_database_get_sync_pkg (PamacDatabase* self,
                             const gchar* pkgname)
{
	GError* _inner_error0_ = NULL;
	PamacAlpmPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_pkg_t* sync_pkg = NULL;
			alpm_handle_t* _tmp1_;
			alpm_pkg_t* _tmp2_;
			PamacAlpmPackage* _tmp3_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = pamac_database_get_syncpkg (self, _tmp1_, pkgname);
			sync_pkg = _tmp2_;
			_tmp3_ = pamac_database_initialise_pkg (self, sync_pkg, sync_pkg);
			result = _tmp3_;
			{
				AlpmConfig* _tmp4_;
				_tmp4_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp5_;
			_tmp5_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

static alpm_pkg_t*
pamac_database_find_dbs_satisfier (PamacDatabase* self,
                                   const gchar* depstring)
{
	alpm_pkg_t* pkg = NULL;
	alpm_list_t* syncdbs = NULL;
	alpm_handle_t* _tmp0_;
	alpm_list_t* _tmp1_;
	alpm_list_t* _tmp2_;
	alpm_pkg_t* _tmp11_;
	alpm_pkg_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (depstring != NULL, NULL);
	pkg = NULL;
	_tmp0_ = self->priv->alpm_handle;
	_tmp1_ = alpm_get_syncdbs (_tmp0_);
	_tmp2_ = _tmp1_;
	syncdbs = _tmp2_;
	while (TRUE) {
		alpm_list_t* _tmp3_;
		alpm_db_t* db = NULL;
		alpm_list_t* _tmp4_;
		gconstpointer _tmp5_;
		alpm_db_t* _tmp6_;
		alpm_list_t* _tmp7_;
		alpm_list_t* _tmp8_;
		alpm_pkg_t* _tmp9_;
		alpm_pkg_t* _tmp10_;
		_tmp3_ = syncdbs;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = syncdbs;
		_tmp5_ = _tmp4_->data;
		db = (alpm_db_t*) _tmp5_;
		_tmp6_ = db;
		_tmp7_ = alpm_db_get_pkgcache (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = alpm_find_satisfier (_tmp8_, depstring);
		pkg = _tmp9_;
		_tmp10_ = pkg;
		if (_tmp10_ != NULL) {
			break;
		}
		syncdbs = alpm_list_next (syncdbs);
	}
	_tmp11_ = pkg;
	result = _tmp11_;
	return result;
}

gboolean
pamac_database_has_sync_satisfier (PamacDatabase* self,
                                   const gchar* depstring)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (depstring != NULL, FALSE);
	{
		AlpmConfig* _tmp0_;
		gboolean _tmp4_ = FALSE;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_pkg_t* _tmp1_;
			_tmp1_ = pamac_database_find_dbs_satisfier (self, depstring);
			result = _tmp1_ != NULL;
			{
				AlpmConfig* _tmp2_;
				_tmp2_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp3_;
			_tmp3_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp4_;
	}
}

PamacAlpmPackage*
pamac_database_get_sync_satisfier (PamacDatabase* self,
                                   const gchar* depstring)
{
	GError* _inner_error0_ = NULL;
	PamacAlpmPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (depstring != NULL, NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_pkg_t* sync_pkg = NULL;
			alpm_pkg_t* _tmp1_;
			PamacAlpmPackage* _tmp2_;
			_tmp1_ = pamac_database_find_dbs_satisfier (self, depstring);
			sync_pkg = _tmp1_;
			_tmp2_ = pamac_database_initialise_pkg (self, sync_pkg, sync_pkg);
			result = _tmp2_;
			{
				AlpmConfig* _tmp3_;
				_tmp3_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			return result;
		}
		__finally0:
		{
			AlpmConfig* _tmp4_;
			_tmp4_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

GPtrArray*
pamac_database_get_sync_pkgs_by_glob (PamacDatabase* self,
                                      const gchar* glob)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (glob != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	{
		AlpmConfig* _tmp1_;
		_tmp1_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* syncdbs = NULL;
			alpm_handle_t* _tmp2_;
			alpm_list_t* _tmp3_;
			alpm_list_t* _tmp4_;
			_tmp2_ = self->priv->alpm_handle;
			_tmp3_ = alpm_get_syncdbs (_tmp2_);
			_tmp4_ = _tmp3_;
			syncdbs = _tmp4_;
			syncdbs = alpm_list_reverse (syncdbs);
			while (TRUE) {
				alpm_list_t* _tmp5_;
				alpm_db_t* db = NULL;
				alpm_list_t* _tmp6_;
				gconstpointer _tmp7_;
				alpm_list_t* pkgcache = NULL;
				alpm_db_t* _tmp8_;
				alpm_list_t* _tmp9_;
				alpm_list_t* _tmp10_;
				_tmp5_ = syncdbs;
				if (!(_tmp5_ != NULL)) {
					break;
				}
				_tmp6_ = syncdbs;
				_tmp7_ = _tmp6_->data;
				db = (alpm_db_t*) _tmp7_;
				_tmp8_ = db;
				_tmp9_ = alpm_db_get_pkgcache (_tmp8_);
				_tmp10_ = _tmp9_;
				pkgcache = _tmp10_;
				while (TRUE) {
					alpm_list_t* _tmp11_;
					alpm_pkg_t* sync_pkg = NULL;
					alpm_list_t* _tmp12_;
					gconstpointer _tmp13_;
					alpm_pkg_t* _tmp14_;
					const gchar* _tmp15_;
					const gchar* _tmp16_;
					_tmp11_ = pkgcache;
					if (!(_tmp11_ != NULL)) {
						break;
					}
					_tmp12_ = pkgcache;
					_tmp13_ = _tmp12_->data;
					sync_pkg = (alpm_pkg_t*) _tmp13_;
					_tmp14_ = sync_pkg;
					_tmp15_ = alpm_pkg_get_name (_tmp14_);
					_tmp16_ = _tmp15_;
					if (fnmatch (glob, _tmp16_, 0) == 0) {
						GPtrArray* _tmp17_;
						alpm_pkg_t* _tmp18_;
						alpm_pkg_t* _tmp19_;
						PamacAlpmPackage* _tmp20_;
						_tmp17_ = pkgs;
						_tmp18_ = sync_pkg;
						_tmp19_ = sync_pkg;
						_tmp20_ = pamac_database_initialise_pkg (self, _tmp18_, _tmp19_);
						g_ptr_array_add (_tmp17_, _tmp20_);
					}
					pkgcache = alpm_list_next (pkgcache);
				}
				syncdbs = alpm_list_next (syncdbs);
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp21_;
			_tmp21_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (pkgs);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = pkgs;
	return result;
}

PamacPackage*
pamac_database_get_app_by_id (PamacDatabase* self,
                              const gchar* app_id)
{
	PamacPackage* pkg = NULL;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	PamacPackage* _tmp2_;
	gboolean _tmp57_ = FALSE;
	PamacPackage* _tmp58_;
	gboolean _tmp64_ = FALSE;
	PamacPackage* _tmp65_;
	PamacPackage* _tmp71_;
	GError* _inner_error0_ = NULL;
	PamacPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (app_id != NULL, NULL);
	_tmp0_ = self->priv->pkgs_cache;
	_tmp1_ = g_hash_table_lookup (_tmp0_, app_id);
	pkg = (PamacPackage*) ((PamacAlpmPackageLinked*) _tmp1_);
	_tmp2_ = pkg;
	if (_tmp2_ != NULL) {
		PamacPackage* _tmp3_;
		_tmp3_ = pkg;
		result = _tmp3_;
		return result;
	}
	{
		AlpmConfig* _tmp4_;
		_tmp4_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			PamacConfig* _tmp5_;
			gboolean _tmp6_;
			gboolean _tmp7_;
			_tmp5_ = self->priv->_config;
			_tmp6_ = pamac_config_get_enable_appstream (_tmp5_);
			_tmp7_ = _tmp6_;
			if (_tmp7_) {
				PamacAppstreamPlugin* _tmp8_;
				GPtrArray* _tmp9_;
				_tmp8_ = self->priv->appstream_plugin;
				_tmp9_ = pamac_appstream_plugin_get_apps (_tmp8_);
				{
					GPtrArray* apps_collection = NULL;
					guint apps_index = 0U;
					apps_collection = _tmp9_;
					for (apps_index = 0; apps_index < apps_collection->len; apps_index = apps_index + 1) {
						GHashTable* apps = NULL;
						apps = (GHashTable*) g_ptr_array_index (apps_collection, apps_index);
						{
							GHashTableIter iter = {0};
							GHashTable* _tmp10_;
							const gchar* current_app_id = NULL;
							PamacApp* app = NULL;
							_tmp10_ = apps;
							g_hash_table_iter_init (&iter, _tmp10_);
							while (TRUE) {
								gconstpointer _tmp11_ = NULL;
								gconstpointer _tmp12_ = NULL;
								gboolean _tmp13_;
								const gchar* _tmp14_;
								_tmp13_ = g_hash_table_iter_next (&iter, (gpointer*) (&_tmp11_), (gpointer*) (&_tmp12_));
								current_app_id = (const gchar*) _tmp11_;
								app = (PamacApp*) _tmp12_;
								if (!_tmp13_) {
									break;
								}
								_tmp14_ = current_app_id;
								if (g_strcmp0 (_tmp14_, app_id) == 0) {
									const gchar* pkgname = NULL;
									PamacApp* _tmp15_;
									const gchar* _tmp16_;
									const gchar* _tmp17_;
									alpm_pkg_t* local_pkg = NULL;
									alpm_handle_t* _tmp18_;
									alpm_db_t* _tmp19_;
									alpm_db_t* _tmp20_;
									const gchar* _tmp21_;
									alpm_pkg_t* _tmp22_;
									alpm_pkg_t* _tmp23_;
									_tmp15_ = app;
									_tmp16_ = pamac_app_get_pkgname (_tmp15_);
									_tmp17_ = _tmp16_;
									pkgname = _tmp17_;
									_tmp18_ = self->priv->alpm_handle;
									_tmp19_ = alpm_get_localdb (_tmp18_);
									_tmp20_ = _tmp19_;
									_tmp21_ = pkgname;
									_tmp22_ = alpm_db_get_pkg (_tmp20_, _tmp21_);
									local_pkg = _tmp22_;
									_tmp23_ = local_pkg;
									if (_tmp23_ != NULL) {
										PamacAlpmPackageLinked* new_pkg = NULL;
										alpm_pkg_t* _tmp24_;
										PamacAlpmPackageLinked* _tmp25_;
										PamacAlpmPackageLinked* _tmp26_;
										alpm_pkg_t* _tmp27_;
										PamacAlpmPackageLinked* _tmp28_;
										PamacApp* _tmp29_;
										GHashTable* _tmp30_;
										PamacAlpmPackageLinked* _tmp31_;
										const gchar* _tmp32_;
										const gchar* _tmp33_;
										PamacAlpmPackageLinked* _tmp34_;
										PamacAlpmPackageLinked* _tmp35_;
										PamacAlpmPackageLinked* _tmp36_;
										_tmp24_ = local_pkg;
										_tmp25_ = pamac_alpm_package_linked_new_from_alpm (_tmp24_, self);
										new_pkg = _tmp25_;
										_tmp26_ = new_pkg;
										_tmp27_ = local_pkg;
										pamac_alpm_package_linked_set_local_pkg (_tmp26_, _tmp27_);
										_tmp28_ = new_pkg;
										_tmp29_ = app;
										pamac_alpm_package_linked_set_app (_tmp28_, _tmp29_);
										_tmp30_ = self->priv->pkgs_cache;
										_tmp31_ = new_pkg;
										_tmp32_ = pamac_package_get_id ((PamacPackage*) _tmp31_);
										_tmp33_ = _tmp32_;
										_tmp34_ = new_pkg;
										_tmp35_ = _g_object_ref0 (_tmp34_);
										g_hash_table_replace (_tmp30_, _tmp33_, _tmp35_);
										_tmp36_ = new_pkg;
										pkg = (PamacPackage*) _tmp36_;
										_g_object_unref0 (new_pkg);
									} else {
										alpm_pkg_t* sync_pkg = NULL;
										alpm_handle_t* _tmp37_;
										const gchar* _tmp38_;
										alpm_pkg_t* _tmp39_;
										alpm_pkg_t* _tmp40_;
										_tmp37_ = self->priv->alpm_handle;
										_tmp38_ = pkgname;
										_tmp39_ = pamac_database_get_syncpkg (self, _tmp37_, _tmp38_);
										sync_pkg = _tmp39_;
										_tmp40_ = sync_pkg;
										if (_tmp40_ != NULL) {
											PamacAlpmPackageLinked* new_pkg = NULL;
											alpm_pkg_t* _tmp41_;
											PamacAlpmPackageLinked* _tmp42_;
											PamacAlpmPackageLinked* _tmp43_;
											alpm_pkg_t* _tmp44_;
											PamacAlpmPackageLinked* _tmp45_;
											alpm_pkg_t* _tmp46_;
											PamacAlpmPackageLinked* _tmp47_;
											PamacApp* _tmp48_;
											GHashTable* _tmp49_;
											PamacAlpmPackageLinked* _tmp50_;
											const gchar* _tmp51_;
											const gchar* _tmp52_;
											PamacAlpmPackageLinked* _tmp53_;
											PamacAlpmPackageLinked* _tmp54_;
											PamacAlpmPackageLinked* _tmp55_;
											_tmp41_ = sync_pkg;
											_tmp42_ = pamac_alpm_package_linked_new_from_alpm (_tmp41_, self);
											new_pkg = _tmp42_;
											_tmp43_ = new_pkg;
											_tmp44_ = local_pkg;
											pamac_alpm_package_linked_set_local_pkg (_tmp43_, _tmp44_);
											_tmp45_ = new_pkg;
											_tmp46_ = sync_pkg;
											pamac_alpm_package_linked_set_sync_pkg (_tmp45_, _tmp46_);
											_tmp47_ = new_pkg;
											_tmp48_ = app;
											pamac_alpm_package_linked_set_app (_tmp47_, _tmp48_);
											_tmp49_ = self->priv->pkgs_cache;
											_tmp50_ = new_pkg;
											_tmp51_ = pamac_package_get_id ((PamacPackage*) _tmp50_);
											_tmp52_ = _tmp51_;
											_tmp53_ = new_pkg;
											_tmp54_ = _g_object_ref0 (_tmp53_);
											g_hash_table_replace (_tmp49_, _tmp52_, _tmp54_);
											_tmp55_ = new_pkg;
											pkg = (PamacPackage*) _tmp55_;
											_g_object_unref0 (new_pkg);
										}
									}
									break;
								}
							}
						}
					}
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp56_;
			_tmp56_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp58_ = pkg;
	if (_tmp58_ == NULL) {
		PamacConfig* _tmp59_;
		gboolean _tmp60_;
		gboolean _tmp61_;
		_tmp59_ = self->priv->_config;
		_tmp60_ = pamac_config_get_enable_flatpak (_tmp59_);
		_tmp61_ = _tmp60_;
		_tmp57_ = _tmp61_;
	} else {
		_tmp57_ = FALSE;
	}
	if (_tmp57_) {
		PamacFlatpakPlugin* _tmp62_;
		PamacFlatpakPackage* _tmp63_;
		_tmp62_ = self->priv->flatpak_plugin;
		_tmp63_ = pamac_flatpak_plugin_get_flatpak_by_app_id (_tmp62_, app_id);
		pkg = (PamacPackage*) _tmp63_;
	}
	_tmp65_ = pkg;
	if (_tmp65_ == NULL) {
		PamacConfig* _tmp66_;
		gboolean _tmp67_;
		gboolean _tmp68_;
		_tmp66_ = self->priv->_config;
		_tmp67_ = pamac_config_get_enable_snap (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp64_ = _tmp68_;
	} else {
		_tmp64_ = FALSE;
	}
	if (_tmp64_) {
		PamacSnapPlugin* _tmp69_;
		PamacSnapPackage* _tmp70_;
		_tmp69_ = self->priv->snap_plugin;
		_tmp70_ = pamac_snap_plugin_get_snap_by_app_id (_tmp69_, app_id);
		pkg = (PamacPackage*) _tmp70_;
	}
	_tmp71_ = pkg;
	result = _tmp71_;
	return result;
}

static void
pamac_database_get_url_stream_data_free (gpointer _data)
{
	PamacDatabaseGetUrlStreamData* _data_;
	_data_ = _data;
	_g_free0 (_data_->url);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetUrlStreamData, _data_);
}

void
pamac_database_get_url_stream (PamacDatabase* self,
                               const gchar* url,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	PamacDatabaseGetUrlStreamData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (url != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetUrlStreamData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_url_stream_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (url);
	_g_free0 (_data_->url);
	_data_->url = _tmp1_;
	pamac_database_get_url_stream_co (_data_);
}

GInputStream*
pamac_database_get_url_stream_finish (PamacDatabase* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	GInputStream* result;
	PamacDatabaseGetUrlStreamData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
pamac_database_get_url_stream_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	PamacDatabaseGetUrlStreamData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	pamac_database_get_url_stream_co (_data_);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
pamac_database_get_url_stream_co (PamacDatabaseGetUrlStreamData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = g_uri_parse (_data_->url, SOUP_HTTP_URI_FLAGS, &_data_->_inner_error0_);
		_data_->uri = _data_->_tmp0_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp1_ = _data_->uri;
		_data_->_tmp2_ = soup_message_new_from_uri ("GET", _data_->_tmp1_);
		_data_->message = _data_->_tmp2_;
		_data_->_tmp4_ = _data_->self->priv->soup_session;
		_data_->_tmp5_ = _data_->message;
		_data_->_state_ = 1;
		soup_session_send_async (_data_->_tmp4_, _data_->_tmp5_, G_PRIORITY_DEFAULT, NULL, pamac_database_get_url_stream_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp6_ = soup_session_send_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp6_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->message);
			_g_uri_unref0 (_data_->uri);
			goto __catch0_g_error;
		}
		_data_->_tmp7_ = _data_->_tmp3_;
		_data_->_tmp3_ = NULL;
		_data_->result = _data_->_tmp7_;
		_g_object_unref0 (_data_->_tmp3_);
		_g_object_unref0 (_data_->message);
		_g_uri_unref0 (_data_->uri);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->e;
		_data_->_tmp9_ = _g_error_copy0 (_data_->_tmp8_);
		_data_->_inner_error0_ = _data_->_tmp9_;
		_g_error_free0 (_data_->e);
		goto __finally0;
	}
	__finally0:
	g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static alpm_list_t*
pamac_database_custom_db_search (PamacDatabase* self,
                                 alpm_db_t* db,
                                 alpm_list_t* needles)
{
	alpm_list_t* needle_match = NULL;
	alpm_list_t* all_match = NULL;
	alpm_list_t* _tmp0_;
	alpm_list_t* _tmp1_;
	alpm_list_t* _tmp2_;
	alpm_list_t* i = NULL;
	GError* _inner_error0_ = NULL;
	alpm_list_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (db != NULL, NULL);
	g_return_val_if_fail (needles != NULL, NULL);
	needle_match = NULL;
	_tmp0_ = alpm_db_get_pkgcache (db);
	_tmp1_ = _tmp0_;
	_tmp2_ = alpm_list_copy (_tmp1_);
	all_match = _tmp2_;
	i = needles;
	while (TRUE) {
		alpm_list_t* _tmp3_;
		alpm_list_t* _tmp4_;
		gconstpointer _tmp5_;
		const gchar* targ = NULL;
		alpm_list_t* _tmp6_;
		gconstpointer _tmp7_;
		GRegex* regex = NULL;
		alpm_list_t* j = NULL;
		alpm_list_t* _tmp14_;
		alpm_list_t* _tmp71_;
		_tmp3_ = i;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = i;
		_tmp5_ = _tmp4_->data;
		if (((const gchar*) _tmp5_) == NULL) {
			continue;
		}
		_alpm_list_free0 (needle_match);
		needle_match = NULL;
		_tmp6_ = i;
		_tmp7_ = _tmp6_->data;
		targ = (const gchar*) _tmp7_;
		regex = NULL;
		{
			GRegex* _tmp8_ = NULL;
			const gchar* _tmp9_;
			GRegex* _tmp10_;
			GRegex* _tmp11_;
			_tmp9_ = targ;
			_tmp10_ = g_regex_new (_tmp9_, 0, 0, &_inner_error0_);
			_tmp8_ = _tmp10_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp11_ = _tmp8_;
			_tmp8_ = NULL;
			_g_regex_unref0 (regex);
			regex = _tmp11_;
			_g_regex_unref0 (_tmp8_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp12_;
			const gchar* _tmp13_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp12_ = e;
			_tmp13_ = _tmp12_->message;
			g_warning ("database.vala:964: %s", _tmp13_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			_alpm_list_free0 (all_match);
			_alpm_list_free0 (needle_match);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp14_ = all_match;
		j = _tmp14_;
		while (TRUE) {
			alpm_list_t* _tmp15_;
			alpm_pkg_t* pkg = NULL;
			alpm_list_t* _tmp16_;
			gconstpointer _tmp17_;
			gboolean matched = FALSE;
			const gchar* name = NULL;
			alpm_pkg_t* _tmp18_;
			const gchar* _tmp19_;
			const gchar* _tmp20_;
			const gchar* desc = NULL;
			alpm_pkg_t* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			gboolean _tmp24_ = FALSE;
			const gchar* _tmp25_;
			_tmp15_ = j;
			if (!(_tmp15_ != NULL)) {
				break;
			}
			_tmp16_ = j;
			_tmp17_ = _tmp16_->data;
			pkg = (alpm_pkg_t*) _tmp17_;
			matched = FALSE;
			_tmp18_ = pkg;
			_tmp19_ = alpm_pkg_get_name (_tmp18_);
			_tmp20_ = _tmp19_;
			name = _tmp20_;
			_tmp21_ = pkg;
			_tmp22_ = alpm_pkg_get_desc (_tmp21_);
			_tmp23_ = _tmp22_;
			desc = _tmp23_;
			_tmp25_ = name;
			if (_tmp25_ != NULL) {
				gboolean _tmp26_ = FALSE;
				gboolean _tmp27_ = FALSE;
				const gchar* _tmp28_;
				const gchar* _tmp29_;
				_tmp28_ = targ;
				_tmp29_ = name;
				if (g_strcmp0 (_tmp28_, _tmp29_) == 0) {
					_tmp27_ = TRUE;
				} else {
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					gchar* _tmp32_;
					gchar* _tmp33_;
					_tmp30_ = targ;
					_tmp31_ = name;
					_tmp32_ = g_utf8_strdown (_tmp31_, (gssize) -1);
					_tmp33_ = _tmp32_;
					_tmp27_ = g_strcmp0 (_tmp30_, _tmp33_) == 0;
					_g_free0 (_tmp33_);
				}
				if (_tmp27_) {
					_tmp26_ = TRUE;
				} else {
					gboolean _tmp34_ = FALSE;
					GRegex* _tmp35_;
					_tmp35_ = regex;
					if (_tmp35_ != NULL) {
						GRegex* _tmp36_;
						const gchar* _tmp37_;
						_tmp36_ = regex;
						_tmp37_ = name;
						_tmp34_ = g_regex_match (_tmp36_, _tmp37_, 0, NULL);
					} else {
						_tmp34_ = FALSE;
					}
					_tmp26_ = _tmp34_;
				}
				_tmp24_ = _tmp26_;
			} else {
				_tmp24_ = FALSE;
			}
			if (_tmp24_) {
				matched = TRUE;
			} else {
				gboolean _tmp38_ = FALSE;
				const gchar* _tmp39_;
				_tmp39_ = desc;
				if (_tmp39_ != NULL) {
					const gchar* _tmp40_;
					const gchar* _tmp41_;
					_tmp40_ = desc;
					_tmp41_ = targ;
					_tmp38_ = string_contains (_tmp40_, _tmp41_);
				} else {
					_tmp38_ = FALSE;
				}
				if (_tmp38_) {
					matched = TRUE;
				}
			}
			if (!matched) {
				alpm_list_t* provides = NULL;
				alpm_pkg_t* _tmp42_;
				alpm_list_t* _tmp43_;
				alpm_list_t* _tmp44_;
				_tmp42_ = pkg;
				_tmp43_ = alpm_pkg_get_provides (_tmp42_);
				_tmp44_ = _tmp43_;
				provides = _tmp44_;
				while (TRUE) {
					alpm_list_t* _tmp45_;
					alpm_depend_t* provide = NULL;
					alpm_list_t* _tmp46_;
					gconstpointer _tmp47_;
					gboolean _tmp48_ = FALSE;
					const gchar* _tmp49_;
					alpm_depend_t* _tmp50_;
					const gchar* _tmp51_;
					_tmp45_ = provides;
					if (!(_tmp45_ != NULL)) {
						break;
					}
					_tmp46_ = provides;
					_tmp47_ = _tmp46_->data;
					provide = (alpm_depend_t*) _tmp47_;
					_tmp49_ = targ;
					_tmp50_ = provide;
					_tmp51_ = _tmp50_->name;
					if (g_strcmp0 (_tmp49_, _tmp51_) == 0) {
						_tmp48_ = TRUE;
					} else {
						gboolean _tmp52_ = FALSE;
						GRegex* _tmp53_;
						_tmp53_ = regex;
						if (_tmp53_ != NULL) {
							GRegex* _tmp54_;
							alpm_depend_t* _tmp55_;
							const gchar* _tmp56_;
							_tmp54_ = regex;
							_tmp55_ = provide;
							_tmp56_ = _tmp55_->name;
							_tmp52_ = g_regex_match (_tmp54_, _tmp56_, 0, NULL);
						} else {
							_tmp52_ = FALSE;
						}
						_tmp48_ = _tmp52_;
					}
					if (_tmp48_) {
						matched = TRUE;
						break;
					}
					provides = alpm_list_next (provides);
				}
			}
			if (!matched) {
				alpm_list_t* groups = NULL;
				alpm_pkg_t* _tmp57_;
				alpm_list_t* _tmp58_;
				alpm_list_t* _tmp59_;
				_tmp57_ = pkg;
				_tmp58_ = alpm_pkg_get_groups (_tmp57_);
				_tmp59_ = _tmp58_;
				groups = _tmp59_;
				while (TRUE) {
					alpm_list_t* _tmp60_;
					const gchar* group = NULL;
					alpm_list_t* _tmp61_;
					gconstpointer _tmp62_;
					gboolean _tmp63_ = FALSE;
					const gchar* _tmp64_;
					const gchar* _tmp65_;
					_tmp60_ = groups;
					if (!(_tmp60_ != NULL)) {
						break;
					}
					_tmp61_ = groups;
					_tmp62_ = _tmp61_->data;
					group = (const gchar*) _tmp62_;
					_tmp64_ = targ;
					_tmp65_ = group;
					if (g_strcmp0 (_tmp64_, _tmp65_) == 0) {
						_tmp63_ = TRUE;
					} else {
						gboolean _tmp66_ = FALSE;
						GRegex* _tmp67_;
						_tmp67_ = regex;
						if (_tmp67_ != NULL) {
							GRegex* _tmp68_;
							const gchar* _tmp69_;
							_tmp68_ = regex;
							_tmp69_ = group;
							_tmp66_ = g_regex_match (_tmp68_, _tmp69_, 0, NULL);
						} else {
							_tmp66_ = FALSE;
						}
						_tmp63_ = _tmp66_;
					}
					if (_tmp63_) {
						matched = TRUE;
						break;
					}
					groups = alpm_list_next (groups);
				}
			}
			if (matched) {
				alpm_pkg_t* _tmp70_;
				_tmp70_ = pkg;
				needle_match = alpm_list_add (needle_match, _tmp70_);
			}
			j = alpm_list_next (j);
		}
		_tmp71_ = needle_match;
		needle_match = NULL;
		_alpm_list_free0 (all_match);
		all_match = _tmp71_;
		i = alpm_list_next (i);
		_g_regex_unref0 (regex);
	}
	result = all_match;
	_alpm_list_free0 (needle_match);
	return result;
}

static alpm_list_t*
pamac_database_search_local_db (PamacDatabase* self,
                                const gchar* search_string)
{
	alpm_list_t* needles = NULL;
	gchar** splitted = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint splitted_length1;
	gint _splitted_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	alpm_handle_t* _tmp4_;
	alpm_db_t* _tmp5_;
	alpm_db_t* _tmp6_;
	alpm_list_t* _tmp7_;
	alpm_list_t* _tmp8_;
	alpm_list_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	needles = NULL;
	_tmp1_ = _tmp0_ = g_strsplit (search_string, " ", 0);
	splitted = _tmp1_;
	splitted_length1 = _vala_array_length (_tmp0_);
	_splitted_size_ = splitted_length1;
	_tmp2_ = splitted;
	_tmp2__length1 = splitted_length1;
	{
		gchar** part_collection = NULL;
		gint part_collection_length1 = 0;
		gint _part_collection_size_ = 0;
		gint part_it = 0;
		part_collection = _tmp2_;
		part_collection_length1 = _tmp2__length1;
		for (part_it = 0; part_it < part_collection_length1; part_it = part_it + 1) {
			const gchar* part = NULL;
			part = part_collection[part_it];
			{
				const gchar* _tmp3_;
				_tmp3_ = part;
				needles = alpm_list_add (needles, _tmp3_);
			}
		}
	}
	_tmp4_ = self->priv->alpm_handle;
	_tmp5_ = alpm_get_localdb (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = needles;
	_tmp8_ = pamac_database_custom_db_search (self, _tmp6_, _tmp7_);
	result = _tmp8_;
	splitted = (_vala_array_free (splitted, splitted_length1, (GDestroyNotify) g_free), NULL);
	_alpm_list_free0 (needles);
	return result;
}

static alpm_list_t*
pamac_database_search_sync_dbs (PamacDatabase* self,
                                const gchar* search_string)
{
	alpm_list_t* needles = NULL;
	gchar** splitted = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint splitted_length1;
	gint _splitted_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	alpm_list_t* _result_ = NULL;
	alpm_handle_t* _tmp4_;
	alpm_db_t* _tmp5_;
	alpm_db_t* _tmp6_;
	alpm_list_t* _tmp7_;
	alpm_list_t* _tmp8_;
	alpm_list_t* syncpkgs = NULL;
	alpm_list_t* syncdbs = NULL;
	alpm_handle_t* _tmp9_;
	alpm_list_t* _tmp10_;
	alpm_list_t* _tmp11_;
	alpm_list_t* foreigns = NULL;
	alpm_list_t* _tmp25_;
	alpm_list_t* _tmp26_;
	alpm_list_t* _tmp27_;
	alpm_list_t* _tmp28_;
	alpm_list_t* _tmp29_;
	alpm_list_t* _tmp30_;
	alpm_list_t* _tmp31_;
	alpm_list_t* _tmp32_;
	alpm_list_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	needles = NULL;
	_tmp1_ = _tmp0_ = g_strsplit (search_string, " ", 0);
	splitted = _tmp1_;
	splitted_length1 = _vala_array_length (_tmp0_);
	_splitted_size_ = splitted_length1;
	_tmp2_ = splitted;
	_tmp2__length1 = splitted_length1;
	{
		gchar** part_collection = NULL;
		gint part_collection_length1 = 0;
		gint _part_collection_size_ = 0;
		gint part_it = 0;
		part_collection = _tmp2_;
		part_collection_length1 = _tmp2__length1;
		for (part_it = 0; part_it < part_collection_length1; part_it = part_it + 1) {
			const gchar* part = NULL;
			part = part_collection[part_it];
			{
				const gchar* _tmp3_;
				_tmp3_ = part;
				needles = alpm_list_add (needles, _tmp3_);
			}
		}
	}
	_tmp4_ = self->priv->alpm_handle;
	_tmp5_ = alpm_get_localdb (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = needles;
	_tmp8_ = pamac_database_custom_db_search (self, _tmp6_, _tmp7_);
	_result_ = _tmp8_;
	syncpkgs = NULL;
	_tmp9_ = self->priv->alpm_handle;
	_tmp10_ = alpm_get_syncdbs (_tmp9_);
	_tmp11_ = _tmp10_;
	syncdbs = _tmp11_;
	while (TRUE) {
		alpm_list_t* _tmp12_;
		alpm_db_t* db = NULL;
		alpm_list_t* _tmp13_;
		gconstpointer _tmp14_;
		alpm_list_t* _tmp15_;
		_tmp12_ = syncdbs;
		if (!(_tmp12_ != NULL)) {
			break;
		}
		_tmp13_ = syncdbs;
		_tmp14_ = _tmp13_->data;
		db = (alpm_db_t*) _tmp14_;
		_tmp15_ = syncpkgs;
		if (_tmp15_ == NULL) {
			alpm_db_t* _tmp16_;
			alpm_list_t* _tmp17_;
			alpm_list_t* _tmp18_;
			_tmp16_ = db;
			_tmp17_ = needles;
			_tmp18_ = pamac_database_custom_db_search (self, _tmp16_, _tmp17_);
			_alpm_list_free0 (syncpkgs);
			syncpkgs = _tmp18_;
		} else {
			alpm_db_t* _tmp19_;
			alpm_list_t* _tmp20_;
			alpm_list_t* _tmp21_;
			alpm_list_t* _tmp22_;
			alpm_list_t* _tmp23_;
			alpm_list_t* _tmp24_;
			_tmp19_ = db;
			_tmp20_ = needles;
			_tmp21_ = pamac_database_custom_db_search (self, _tmp19_, _tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = syncpkgs;
			_tmp24_ = alpm_list_diff (_tmp22_, _tmp23_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
			syncpkgs = alpm_list_join (syncpkgs, _tmp24_);
			_alpm_list_free0 (_tmp22_);
		}
		syncdbs = alpm_list_next (syncdbs);
	}
	_tmp25_ = _result_;
	_tmp26_ = syncpkgs;
	_tmp27_ = alpm_list_diff (_tmp25_, _tmp26_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
	foreigns = _tmp27_;
	_tmp28_ = _result_;
	_tmp29_ = alpm_list_diff (_tmp28_, foreigns, (alpm_list_fn_cmp) alpm_pkg_compare_name);
	_alpm_list_free0 (_result_);
	_result_ = _tmp29_;
	_tmp30_ = syncpkgs;
	_tmp31_ = _result_;
	_tmp32_ = alpm_list_diff (_tmp30_, _tmp31_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
	_result_ = alpm_list_join (_result_, _tmp32_);
	result = _result_;
	_alpm_list_free0 (foreigns);
	_alpm_list_free0 (syncpkgs);
	splitted = (_vala_array_free (splitted, splitted_length1, (GDestroyNotify) g_free), NULL);
	_alpm_list_free0 (needles);
	return result;
}

static void
pamac_database_search_installed_pkgs_real (PamacDatabase* self,
                                           const gchar* search_string,
                                           GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* _result_ = NULL;
			alpm_list_t* _tmp1_;
			PamacConfig* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			alpm_list_t* _tmp23_;
			_tmp1_ = pamac_database_search_local_db (self, search_string);
			_result_ = _tmp1_;
			_tmp2_ = self->priv->_config;
			_tmp3_ = pamac_config_get_enable_appstream (_tmp2_);
			_tmp4_ = _tmp3_;
			if (_tmp4_) {
				gchar** search_tokens = NULL;
				gchar** _tmp5_;
				gchar** _tmp6_;
				gint search_tokens_length1;
				gint _search_tokens_size_;
				PamacAppstreamPlugin* _tmp7_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				GPtrArray* _tmp9_;
				_tmp6_ = _tmp5_ = g_strsplit (search_string, " ", 0);
				search_tokens = _tmp6_;
				search_tokens_length1 = _vala_array_length (_tmp5_);
				_search_tokens_size_ = search_tokens_length1;
				_tmp7_ = self->priv->appstream_plugin;
				_tmp8_ = search_tokens;
				_tmp8__length1 = search_tokens_length1;
				_tmp9_ = pamac_appstream_plugin_search (_tmp7_, _tmp8_, (gint) _tmp8__length1);
				{
					GPtrArray* app_collection = NULL;
					guint app_index = 0U;
					app_collection = _tmp9_;
					for (app_index = 0; app_index < app_collection->len; app_index = app_index + 1) {
						PamacApp* app = NULL;
						app = (PamacApp*) g_ptr_array_index (app_collection, app_index);
						{
							const gchar* pkgname = NULL;
							PamacApp* _tmp10_;
							const gchar* _tmp11_;
							const gchar* _tmp12_;
							alpm_pkg_t* alpm_pkg = NULL;
							alpm_handle_t* _tmp13_;
							alpm_db_t* _tmp14_;
							alpm_db_t* _tmp15_;
							const gchar* _tmp16_;
							alpm_pkg_t* _tmp17_;
							alpm_pkg_t* _tmp18_;
							_tmp10_ = app;
							_tmp11_ = pamac_app_get_pkgname (_tmp10_);
							_tmp12_ = _tmp11_;
							pkgname = _tmp12_;
							_tmp13_ = self->priv->alpm_handle;
							_tmp14_ = alpm_get_localdb (_tmp13_);
							_tmp15_ = _tmp14_;
							_tmp16_ = pkgname;
							_tmp17_ = alpm_db_get_pkg (_tmp15_, _tmp16_);
							alpm_pkg = _tmp17_;
							_tmp18_ = alpm_pkg;
							if (_tmp18_ != NULL) {
								alpm_list_t* _tmp19_;
								alpm_pkg_t* _tmp20_;
								gconstpointer _tmp21_;
								_tmp19_ = _result_;
								_tmp20_ = alpm_pkg;
								_tmp21_ = alpm_list_find (_tmp19_, _tmp20_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
								if (((alpm_pkg_t*) _tmp21_) == NULL) {
									alpm_pkg_t* _tmp22_;
									_tmp22_ = alpm_pkg;
									_result_ = alpm_list_add (_result_, _tmp22_);
								}
							}
						}
					}
					_g_ptr_array_unref0 (app_collection);
				}
				search_tokens = (_vala_array_free (search_tokens, search_tokens_length1, (GDestroyNotify) g_free), NULL);
			}
			_tmp23_ = _result_;
			pamac_database_initialise_pkgs (self, _tmp23_, pkgs);
			_alpm_list_free0 (_result_);
		}
		__finally0:
		{
			AlpmConfig* _tmp24_;
			_tmp24_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_search_installed_pkgs (PamacDatabase* self,
                                      const gchar* search_string)
{
	gchar* search_string_down = NULL;
	gchar* _tmp0_;
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp1_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	_tmp0_ = g_utf8_strdown (search_string, (gssize) -1);
	search_string_down = _tmp0_;
	_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp1_;
	pamac_database_search_installed_pkgs_real (self, search_string_down, &pkgs);
	result = pkgs;
	_g_free0 (search_string_down);
	return result;
}

static void
pamac_database_search_installed_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseSearchInstalledPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->search_string);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseSearchInstalledPkgsAsyncData, _data_);
}

void
pamac_database_search_installed_pkgs_async (PamacDatabase* self,
                                            const gchar* search_string,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	PamacDatabaseSearchInstalledPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	_data_ = g_slice_new0 (PamacDatabaseSearchInstalledPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_search_installed_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (search_string);
	_g_free0 (_data_->search_string);
	_data_->search_string = _tmp1_;
	pamac_database_search_installed_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_search_installed_pkgs_finish (PamacDatabase* self,
                                             GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseSearchInstalledPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		PamacDatabase* self;
		self = _data12_->self;
		_g_ptr_array_unref0 (_data12_->pkgs);
		_g_free0 (_data12_->search_string_down);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

static gboolean
_pamac_database_search_installed_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_search_installed_pkgs_async_co (self);
	return result;
}

static gint
___lambda16_ (Block12Data* _data12_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data12_->self;
	pamac_database_search_installed_pkgs_real (self, _data12_->search_string_down, &_data12_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_search_installed_pkgs_async_co_gsource_func, _data12_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda16__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda16_ (self));
	block12_data_unref (self);
	return result;
}

static gboolean
pamac_database_search_installed_pkgs_async_co (PamacDatabaseSearchInstalledPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data12_ = g_slice_new0 (Block12Data);
	_data_->_data12_->_ref_count_ = 1;
	_data_->_data12_->self = g_object_ref (_data_->self);
	_data_->_data12_->_async_data_ = _data_;
	_data_->_tmp0_ = g_utf8_strdown (_data_->search_string, (gssize) -1);
	_data_->_data12_->search_string_down = _data_->_tmp0_;
	_data_->_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data12_->pkgs = _data_->_tmp1_;
	{
		_data_->_tmp2_ = g_thread_try_new ("search_installed_pkgs", ____lambda16__gthread_func, block12_data_ref (_data_->_data12_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:1091: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block12_data_unref (_data_->_data12_);
		_data_->_data12_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _g_ptr_array_ref0 (_data_->_data12_->pkgs);
	_data_->result = _data_->_tmp6_;
	block12_data_unref (_data_->_data12_);
	_data_->_data12_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_search_repos_pkgs_real (PamacDatabase* self,
                                       const gchar* search_string,
                                       GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* _result_ = NULL;
			alpm_list_t* _tmp1_;
			PamacConfig* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			alpm_list_t* _tmp21_;
			_tmp1_ = pamac_database_search_sync_dbs (self, search_string);
			_result_ = _tmp1_;
			_tmp2_ = self->priv->_config;
			_tmp3_ = pamac_config_get_enable_appstream (_tmp2_);
			_tmp4_ = _tmp3_;
			if (_tmp4_) {
				gchar** search_tokens = NULL;
				gchar** _tmp5_;
				gchar** _tmp6_;
				gint search_tokens_length1;
				gint _search_tokens_size_;
				PamacAppstreamPlugin* _tmp7_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				GPtrArray* _tmp9_;
				_tmp6_ = _tmp5_ = g_strsplit (search_string, " ", 0);
				search_tokens = _tmp6_;
				search_tokens_length1 = _vala_array_length (_tmp5_);
				_search_tokens_size_ = search_tokens_length1;
				_tmp7_ = self->priv->appstream_plugin;
				_tmp8_ = search_tokens;
				_tmp8__length1 = search_tokens_length1;
				_tmp9_ = pamac_appstream_plugin_search (_tmp7_, _tmp8_, (gint) _tmp8__length1);
				{
					GPtrArray* app_collection = NULL;
					guint app_index = 0U;
					app_collection = _tmp9_;
					for (app_index = 0; app_index < app_collection->len; app_index = app_index + 1) {
						PamacApp* app = NULL;
						app = (PamacApp*) g_ptr_array_index (app_collection, app_index);
						{
							const gchar* pkgname = NULL;
							PamacApp* _tmp10_;
							const gchar* _tmp11_;
							const gchar* _tmp12_;
							alpm_pkg_t* alpm_pkg = NULL;
							alpm_handle_t* _tmp13_;
							const gchar* _tmp14_;
							alpm_pkg_t* _tmp15_;
							alpm_pkg_t* _tmp16_;
							_tmp10_ = app;
							_tmp11_ = pamac_app_get_pkgname (_tmp10_);
							_tmp12_ = _tmp11_;
							pkgname = _tmp12_;
							_tmp13_ = self->priv->alpm_handle;
							_tmp14_ = pkgname;
							_tmp15_ = pamac_database_get_syncpkg (self, _tmp13_, _tmp14_);
							alpm_pkg = _tmp15_;
							_tmp16_ = alpm_pkg;
							if (_tmp16_ != NULL) {
								alpm_list_t* _tmp17_;
								alpm_pkg_t* _tmp18_;
								gconstpointer _tmp19_;
								_tmp17_ = _result_;
								_tmp18_ = alpm_pkg;
								_tmp19_ = alpm_list_find (_tmp17_, _tmp18_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
								if (((alpm_pkg_t*) _tmp19_) == NULL) {
									alpm_pkg_t* _tmp20_;
									_tmp20_ = alpm_pkg;
									_result_ = alpm_list_add (_result_, _tmp20_);
								}
							}
						}
					}
					_g_ptr_array_unref0 (app_collection);
				}
				search_tokens = (_vala_array_free (search_tokens, search_tokens_length1, (GDestroyNotify) g_free), NULL);
			}
			_tmp21_ = _result_;
			pamac_database_initialise_pkgs (self, _tmp21_, pkgs);
			_alpm_list_free0 (_result_);
		}
		__finally0:
		{
			AlpmConfig* _tmp22_;
			_tmp22_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_search_repos_pkgs (PamacDatabase* self,
                                  const gchar* search_string)
{
	gchar* search_string_down = NULL;
	gchar* _tmp0_;
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp1_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	_tmp0_ = g_utf8_strdown (search_string, (gssize) -1);
	search_string_down = _tmp0_;
	_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp1_;
	pamac_database_search_repos_pkgs_real (self, search_string_down, &pkgs);
	result = pkgs;
	_g_free0 (search_string_down);
	return result;
}

static void
pamac_database_search_repos_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseSearchReposPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->search_string);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseSearchReposPkgsAsyncData, _data_);
}

void
pamac_database_search_repos_pkgs_async (PamacDatabase* self,
                                        const gchar* search_string,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	PamacDatabaseSearchReposPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	_data_ = g_slice_new0 (PamacDatabaseSearchReposPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_search_repos_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (search_string);
	_g_free0 (_data_->search_string);
	_data_->search_string = _tmp1_;
	pamac_database_search_repos_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_search_repos_pkgs_finish (PamacDatabase* self,
                                         GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseSearchReposPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		PamacDatabase* self;
		self = _data13_->self;
		_g_ptr_array_unref0 (_data13_->pkgs);
		_g_free0 (_data13_->search_string_down);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static gboolean
_pamac_database_search_repos_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_search_repos_pkgs_async_co (self);
	return result;
}

static gint
___lambda17_ (Block13Data* _data13_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data13_->self;
	pamac_database_search_repos_pkgs_real (self, _data13_->search_string_down, &_data13_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_search_repos_pkgs_async_co_gsource_func, _data13_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda17__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda17_ (self));
	block13_data_unref (self);
	return result;
}

static gboolean
pamac_database_search_repos_pkgs_async_co (PamacDatabaseSearchReposPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data13_ = g_slice_new0 (Block13Data);
	_data_->_data13_->_ref_count_ = 1;
	_data_->_data13_->self = g_object_ref (_data_->self);
	_data_->_data13_->_async_data_ = _data_;
	_data_->_tmp0_ = g_utf8_strdown (_data_->search_string, (gssize) -1);
	_data_->_data13_->search_string_down = _data_->_tmp0_;
	_data_->_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data13_->pkgs = _data_->_tmp1_;
	{
		_data_->_tmp2_ = g_thread_try_new ("search_repos_pkgs", ____lambda17__gthread_func, block13_data_ref (_data_->_data13_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:1133: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block13_data_unref (_data_->_data13_);
		_data_->_data13_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _g_ptr_array_ref0 (_data_->_data13_->pkgs);
	_data_->result = _data_->_tmp6_;
	block13_data_unref (_data_->_data13_);
	_data_->_data13_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static alpm_list_t*
pamac_database_search_all_dbs (PamacDatabase* self,
                               const gchar* search_string)
{
	alpm_list_t* needles = NULL;
	gchar** splitted = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint splitted_length1;
	gint _splitted_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	alpm_list_t* _result_ = NULL;
	alpm_handle_t* _tmp4_;
	alpm_db_t* _tmp5_;
	alpm_db_t* _tmp6_;
	alpm_list_t* _tmp7_;
	alpm_list_t* _tmp8_;
	alpm_list_t* syncpkgs = NULL;
	alpm_list_t* syncdbs = NULL;
	alpm_handle_t* _tmp9_;
	alpm_list_t* _tmp10_;
	alpm_list_t* _tmp11_;
	alpm_list_t* _tmp25_;
	alpm_list_t* _tmp26_;
	alpm_list_t* _tmp27_;
	alpm_list_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	needles = NULL;
	_tmp1_ = _tmp0_ = g_strsplit (search_string, " ", 0);
	splitted = _tmp1_;
	splitted_length1 = _vala_array_length (_tmp0_);
	_splitted_size_ = splitted_length1;
	_tmp2_ = splitted;
	_tmp2__length1 = splitted_length1;
	{
		gchar** part_collection = NULL;
		gint part_collection_length1 = 0;
		gint _part_collection_size_ = 0;
		gint part_it = 0;
		part_collection = _tmp2_;
		part_collection_length1 = _tmp2__length1;
		for (part_it = 0; part_it < part_collection_length1; part_it = part_it + 1) {
			const gchar* part = NULL;
			part = part_collection[part_it];
			{
				const gchar* _tmp3_;
				_tmp3_ = part;
				needles = alpm_list_add (needles, _tmp3_);
			}
		}
	}
	_tmp4_ = self->priv->alpm_handle;
	_tmp5_ = alpm_get_localdb (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = needles;
	_tmp8_ = pamac_database_custom_db_search (self, _tmp6_, _tmp7_);
	_result_ = _tmp8_;
	syncpkgs = NULL;
	_tmp9_ = self->priv->alpm_handle;
	_tmp10_ = alpm_get_syncdbs (_tmp9_);
	_tmp11_ = _tmp10_;
	syncdbs = _tmp11_;
	while (TRUE) {
		alpm_list_t* _tmp12_;
		alpm_db_t* db = NULL;
		alpm_list_t* _tmp13_;
		gconstpointer _tmp14_;
		alpm_list_t* _tmp15_;
		_tmp12_ = syncdbs;
		if (!(_tmp12_ != NULL)) {
			break;
		}
		_tmp13_ = syncdbs;
		_tmp14_ = _tmp13_->data;
		db = (alpm_db_t*) _tmp14_;
		_tmp15_ = syncpkgs;
		if (_tmp15_ == NULL) {
			alpm_db_t* _tmp16_;
			alpm_list_t* _tmp17_;
			alpm_list_t* _tmp18_;
			_tmp16_ = db;
			_tmp17_ = needles;
			_tmp18_ = pamac_database_custom_db_search (self, _tmp16_, _tmp17_);
			_alpm_list_free0 (syncpkgs);
			syncpkgs = _tmp18_;
		} else {
			alpm_db_t* _tmp19_;
			alpm_list_t* _tmp20_;
			alpm_list_t* _tmp21_;
			alpm_list_t* _tmp22_;
			alpm_list_t* _tmp23_;
			alpm_list_t* _tmp24_;
			_tmp19_ = db;
			_tmp20_ = needles;
			_tmp21_ = pamac_database_custom_db_search (self, _tmp19_, _tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = syncpkgs;
			_tmp24_ = alpm_list_diff (_tmp22_, _tmp23_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
			syncpkgs = alpm_list_join (syncpkgs, _tmp24_);
			_alpm_list_free0 (_tmp22_);
		}
		syncdbs = alpm_list_next (syncdbs);
	}
	_tmp25_ = syncpkgs;
	_tmp26_ = _result_;
	_tmp27_ = alpm_list_diff (_tmp25_, _tmp26_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
	_result_ = alpm_list_join (_result_, _tmp27_);
	result = _result_;
	_alpm_list_free0 (syncpkgs);
	splitted = (_vala_array_free (splitted, splitted_length1, (GDestroyNotify) g_free), NULL);
	_alpm_list_free0 (needles);
	return result;
}

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

GPtrArray*
pamac_database_search_uninstalled_apps (PamacDatabase* self,
                                        GPtrArray* search_terms)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_terms != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	{
		AlpmConfig* _tmp1_;
		_tmp1_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* appstream_result = NULL;
			PamacConfig* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			alpm_list_t* _tmp27_;
			appstream_result = NULL;
			_tmp2_ = self->priv->_config;
			_tmp3_ = pamac_config_get_enable_appstream (_tmp2_);
			_tmp4_ = _tmp3_;
			if (_tmp4_) {
				gchar** data = NULL;
				gpointer* _tmp5_;
				gint _tmp5__length1;
				gchar** _tmp6_;
				gint _tmp6__length1;
				gint data_length1;
				gint _data_size_;
				PamacAppstreamPlugin* _tmp7_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				GPtrArray* _tmp9_;
				_tmp5_ = search_terms->pdata;
				_tmp5__length1 = search_terms->len;
				_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup1 (_tmp5_, _tmp5__length1) : _tmp5_;
				_tmp6__length1 = _tmp5__length1;
				data = _tmp6_;
				data_length1 = _tmp6__length1;
				_data_size_ = data_length1;
				_tmp7_ = self->priv->appstream_plugin;
				_tmp8_ = data;
				_tmp8__length1 = data_length1;
				_tmp9_ = pamac_appstream_plugin_search (_tmp7_, _tmp8_, (gint) _tmp8__length1);
				{
					GPtrArray* app_collection = NULL;
					guint app_index = 0U;
					app_collection = _tmp9_;
					for (app_index = 0; app_index < app_collection->len; app_index = app_index + 1) {
						PamacApp* app = NULL;
						app = (PamacApp*) g_ptr_array_index (app_collection, app_index);
						{
							const gchar* pkgname = NULL;
							PamacApp* _tmp10_;
							const gchar* _tmp11_;
							const gchar* _tmp12_;
							alpm_pkg_t* alpm_pkg = NULL;
							alpm_handle_t* _tmp13_;
							alpm_db_t* _tmp14_;
							alpm_db_t* _tmp15_;
							const gchar* _tmp16_;
							alpm_pkg_t* _tmp17_;
							alpm_pkg_t* _tmp18_;
							_tmp10_ = app;
							_tmp11_ = pamac_app_get_pkgname (_tmp10_);
							_tmp12_ = _tmp11_;
							pkgname = _tmp12_;
							_tmp13_ = self->priv->alpm_handle;
							_tmp14_ = alpm_get_localdb (_tmp13_);
							_tmp15_ = _tmp14_;
							_tmp16_ = pkgname;
							_tmp17_ = alpm_db_get_pkg (_tmp15_, _tmp16_);
							alpm_pkg = _tmp17_;
							_tmp18_ = alpm_pkg;
							if (_tmp18_ == NULL) {
								alpm_handle_t* _tmp19_;
								const gchar* _tmp20_;
								alpm_pkg_t* _tmp21_;
								alpm_pkg_t* _tmp22_;
								_tmp19_ = self->priv->alpm_handle;
								_tmp20_ = pkgname;
								_tmp21_ = pamac_database_get_syncpkg (self, _tmp19_, _tmp20_);
								alpm_pkg = _tmp21_;
								_tmp22_ = alpm_pkg;
								if (_tmp22_ != NULL) {
									alpm_list_t* _tmp23_;
									alpm_pkg_t* _tmp24_;
									gconstpointer _tmp25_;
									_tmp23_ = appstream_result;
									_tmp24_ = alpm_pkg;
									_tmp25_ = alpm_list_find (_tmp23_, _tmp24_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
									if (((alpm_pkg_t*) _tmp25_) == NULL) {
										alpm_pkg_t* _tmp26_;
										_tmp26_ = alpm_pkg;
										appstream_result = alpm_list_add (appstream_result, _tmp26_);
									}
								}
							}
						}
					}
					_g_ptr_array_unref0 (app_collection);
				}
				data = (_vala_array_free (data, data_length1, (GDestroyNotify) g_free), NULL);
			}
			_tmp27_ = appstream_result;
			pamac_database_initialise_pkgs (self, _tmp27_, &pkgs);
			_alpm_list_free0 (appstream_result);
		}
		__finally0:
		{
			AlpmConfig* _tmp28_;
			_tmp28_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (pkgs);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = pkgs;
	return result;
}

static void
pamac_database_search_pkgs_real (PamacDatabase* self,
                                 const gchar* search_string,
                                 GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* _result_ = NULL;
			alpm_list_t* _tmp1_;
			PamacConfig* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			alpm_list_t* _tmp27_;
			_tmp1_ = pamac_database_search_all_dbs (self, search_string);
			_result_ = _tmp1_;
			_tmp2_ = self->priv->_config;
			_tmp3_ = pamac_config_get_enable_appstream (_tmp2_);
			_tmp4_ = _tmp3_;
			if (_tmp4_) {
				gchar** search_tokens = NULL;
				gchar** _tmp5_;
				gchar** _tmp6_;
				gint search_tokens_length1;
				gint _search_tokens_size_;
				PamacAppstreamPlugin* _tmp7_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				GPtrArray* _tmp9_;
				_tmp6_ = _tmp5_ = g_strsplit (search_string, " ", 0);
				search_tokens = _tmp6_;
				search_tokens_length1 = _vala_array_length (_tmp5_);
				_search_tokens_size_ = search_tokens_length1;
				_tmp7_ = self->priv->appstream_plugin;
				_tmp8_ = search_tokens;
				_tmp8__length1 = search_tokens_length1;
				_tmp9_ = pamac_appstream_plugin_search (_tmp7_, _tmp8_, (gint) _tmp8__length1);
				{
					GPtrArray* app_collection = NULL;
					guint app_index = 0U;
					app_collection = _tmp9_;
					for (app_index = 0; app_index < app_collection->len; app_index = app_index + 1) {
						PamacApp* app = NULL;
						app = (PamacApp*) g_ptr_array_index (app_collection, app_index);
						{
							const gchar* pkgname = NULL;
							PamacApp* _tmp10_;
							const gchar* _tmp11_;
							const gchar* _tmp12_;
							alpm_pkg_t* alpm_pkg = NULL;
							alpm_handle_t* _tmp13_;
							alpm_db_t* _tmp14_;
							alpm_db_t* _tmp15_;
							const gchar* _tmp16_;
							alpm_pkg_t* _tmp17_;
							alpm_pkg_t* _tmp18_;
							alpm_pkg_t* _tmp22_;
							_tmp10_ = app;
							_tmp11_ = pamac_app_get_pkgname (_tmp10_);
							_tmp12_ = _tmp11_;
							pkgname = _tmp12_;
							_tmp13_ = self->priv->alpm_handle;
							_tmp14_ = alpm_get_localdb (_tmp13_);
							_tmp15_ = _tmp14_;
							_tmp16_ = pkgname;
							_tmp17_ = alpm_db_get_pkg (_tmp15_, _tmp16_);
							alpm_pkg = _tmp17_;
							_tmp18_ = alpm_pkg;
							if (_tmp18_ == NULL) {
								alpm_handle_t* _tmp19_;
								const gchar* _tmp20_;
								alpm_pkg_t* _tmp21_;
								_tmp19_ = self->priv->alpm_handle;
								_tmp20_ = pkgname;
								_tmp21_ = pamac_database_get_syncpkg (self, _tmp19_, _tmp20_);
								alpm_pkg = _tmp21_;
							}
							_tmp22_ = alpm_pkg;
							if (_tmp22_ != NULL) {
								alpm_list_t* _tmp23_;
								alpm_pkg_t* _tmp24_;
								gconstpointer _tmp25_;
								_tmp23_ = _result_;
								_tmp24_ = alpm_pkg;
								_tmp25_ = alpm_list_find (_tmp23_, _tmp24_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
								if (((alpm_pkg_t*) _tmp25_) == NULL) {
									alpm_pkg_t* _tmp26_;
									_tmp26_ = alpm_pkg;
									_result_ = alpm_list_add (_result_, _tmp26_);
								}
							}
						}
					}
					_g_ptr_array_unref0 (app_collection);
				}
				search_tokens = (_vala_array_free (search_tokens, search_tokens_length1, (GDestroyNotify) g_free), NULL);
			}
			_tmp27_ = _result_;
			pamac_database_initialise_pkgs (self, _tmp27_, pkgs);
			_alpm_list_free0 (_result_);
		}
		__finally0:
		{
			AlpmConfig* _tmp28_;
			_tmp28_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_search_pkgs (PamacDatabase* self,
                            const gchar* search_string)
{
	gchar* search_string_down = NULL;
	gchar* _tmp0_;
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp1_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	_tmp0_ = g_utf8_strdown (search_string, (gssize) -1);
	search_string_down = _tmp0_;
	_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp1_;
	pamac_database_search_pkgs_real (self, search_string_down, &pkgs);
	result = pkgs;
	_g_free0 (search_string_down);
	return result;
}

static void
pamac_database_search_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseSearchPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->search_string);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseSearchPkgsAsyncData, _data_);
}

void
pamac_database_search_pkgs_async (PamacDatabase* self,
                                  const gchar* search_string,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	PamacDatabaseSearchPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	_data_ = g_slice_new0 (PamacDatabaseSearchPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_search_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (search_string);
	_g_free0 (_data_->search_string);
	_data_->search_string = _tmp1_;
	pamac_database_search_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_search_pkgs_finish (PamacDatabase* self,
                                   GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseSearchPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		PamacDatabase* self;
		self = _data14_->self;
		_g_ptr_array_unref0 (_data14_->pkgs);
		_g_free0 (_data14_->search_string_down);
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static gboolean
_pamac_database_search_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_search_pkgs_async_co (self);
	return result;
}

static gint
___lambda18_ (Block14Data* _data14_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data14_->self;
	pamac_database_search_pkgs_real (self, _data14_->search_string_down, &_data14_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_search_pkgs_async_co_gsource_func, _data14_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda18__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda18_ (self));
	block14_data_unref (self);
	return result;
}

static gboolean
pamac_database_search_pkgs_async_co (PamacDatabaseSearchPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data14_ = g_slice_new0 (Block14Data);
	_data_->_data14_->_ref_count_ = 1;
	_data_->_data14_->self = g_object_ref (_data_->self);
	_data_->_data14_->_async_data_ = _data_;
	_data_->_tmp0_ = g_utf8_strdown (_data_->search_string, (gssize) -1);
	_data_->_data14_->search_string_down = _data_->_tmp0_;
	_data_->_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data14_->pkgs = _data_->_tmp1_;
	{
		_data_->_tmp2_ = g_thread_try_new ("search_pkgs", ____lambda18__gthread_func, block14_data_ref (_data_->_data14_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:1251: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block14_data_unref (_data_->_data14_);
		_data_->_data14_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _g_ptr_array_ref0 (_data_->_data14_->pkgs);
	_data_->result = _data_->_tmp6_;
	block14_data_unref (_data_->_data14_);
	_data_->_data14_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_search_aur_pkgs_real (PamacDatabase* self,
                                     const gchar* search_string,
                                     GPtrArray** pkgs)
{
	GPtrArray* aur_infos_list = NULL;
	PamacAURPlugin* _tmp0_;
	GPtrArray* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	g_return_if_fail (*pkgs != NULL);
	_tmp0_ = self->priv->aur_plugin;
	_tmp1_ = pamac_aur_plugin_search (_tmp0_, search_string);
	aur_infos_list = _tmp1_;
	{
		AlpmConfig* _tmp2_;
		_tmp2_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			GPtrArray* _tmp3_;
			_tmp3_ = aur_infos_list;
			{
				GPtrArray* aur_infos_collection = NULL;
				guint aur_infos_index = 0U;
				aur_infos_collection = _tmp3_;
				for (aur_infos_index = 0; aur_infos_index < aur_infos_collection->len; aur_infos_index = aur_infos_index + 1) {
					PamacAURInfos* aur_infos = NULL;
					aur_infos = (PamacAURInfos*) g_ptr_array_index (aur_infos_collection, aur_infos_index);
					{
						const gchar* name = NULL;
						PamacAURInfos* _tmp4_;
						const gchar* _tmp5_;
						const gchar* _tmp6_;
						PamacAURPackageLinked* pkg = NULL;
						GHashTable* _tmp7_;
						const gchar* _tmp8_;
						gconstpointer _tmp9_;
						PamacAURPackageLinked* _tmp10_;
						PamacAURPackageLinked* _tmp11_;
						PamacAURPackageLinked* _tmp27_;
						_tmp4_ = aur_infos;
						_tmp5_ = pamac_aur_infos_get_name (_tmp4_);
						_tmp6_ = _tmp5_;
						name = _tmp6_;
						_tmp7_ = self->priv->aur_pkgs_cache;
						_tmp8_ = name;
						_tmp9_ = g_hash_table_lookup (_tmp7_, _tmp8_);
						_tmp10_ = _g_object_ref0 ((PamacAURPackageLinked*) _tmp9_);
						pkg = _tmp10_;
						_tmp11_ = pkg;
						if (_tmp11_ == NULL) {
							alpm_pkg_t* local_pkg = NULL;
							alpm_handle_t* _tmp12_;
							alpm_db_t* _tmp13_;
							alpm_db_t* _tmp14_;
							const gchar* _tmp15_;
							alpm_pkg_t* _tmp16_;
							PamacAURPackageLinked* _tmp17_;
							PamacAURPackageLinked* _tmp18_;
							PamacAURInfos* _tmp19_;
							alpm_pkg_t* _tmp20_;
							GHashTable* _tmp21_;
							PamacAURPackageLinked* _tmp22_;
							const gchar* _tmp23_;
							const gchar* _tmp24_;
							PamacAURPackageLinked* _tmp25_;
							PamacAURPackageLinked* _tmp26_;
							_tmp12_ = self->priv->alpm_handle;
							_tmp13_ = alpm_get_localdb (_tmp12_);
							_tmp14_ = _tmp13_;
							_tmp15_ = name;
							_tmp16_ = alpm_db_get_pkg (_tmp14_, _tmp15_);
							local_pkg = _tmp16_;
							_tmp17_ = pamac_aur_package_linked_new ();
							_g_object_unref0 (pkg);
							pkg = _tmp17_;
							_tmp18_ = pkg;
							_tmp19_ = aur_infos;
							_tmp20_ = local_pkg;
							pamac_aur_package_linked_initialise_from_aur_infos (_tmp18_, _tmp19_, _tmp20_, self, FALSE);
							_tmp21_ = self->priv->aur_pkgs_cache;
							_tmp22_ = pkg;
							_tmp23_ = pamac_package_get_id ((PamacPackage*) _tmp22_);
							_tmp24_ = _tmp23_;
							_tmp25_ = pkg;
							_tmp26_ = _g_object_ref0 (_tmp25_);
							g_hash_table_replace (_tmp21_, _tmp24_, _tmp26_);
						}
						_tmp27_ = pkg;
						g_ptr_array_add (*pkgs, (PamacAURPackage*) _tmp27_);
						_g_object_unref0 (pkg);
					}
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp28_;
			_tmp28_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (aur_infos_list);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_g_ptr_array_unref0 (aur_infos_list);
}

GPtrArray*
pamac_database_search_aur_pkgs (PamacDatabase* self,
                                const gchar* search_string)
{
	gchar* search_string_down = NULL;
	gchar* _tmp0_;
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp1_;
	PamacConfig* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (search_string != NULL, NULL);
	_tmp0_ = g_utf8_strdown (search_string, (gssize) -1);
	search_string_down = _tmp0_;
	_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp1_;
	_tmp2_ = self->priv->_config;
	_tmp3_ = pamac_config_get_enable_aur (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		const gchar* _tmp5_;
		_tmp5_ = search_string_down;
		pamac_database_search_aur_pkgs_real (self, _tmp5_, &pkgs);
	}
	result = pkgs;
	_g_free0 (search_string_down);
	return result;
}

static void
pamac_database_search_aur_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseSearchAurPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->search_string);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseSearchAurPkgsAsyncData, _data_);
}

void
pamac_database_search_aur_pkgs_async (PamacDatabase* self,
                                      const gchar* search_string,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	PamacDatabaseSearchAurPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	_data_ = g_slice_new0 (PamacDatabaseSearchAurPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_search_aur_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (search_string);
	_g_free0 (_data_->search_string);
	_data_->search_string = _tmp1_;
	pamac_database_search_aur_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_search_aur_pkgs_finish (PamacDatabase* self,
                                       GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseSearchAurPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		PamacDatabase* self;
		self = _data15_->self;
		_g_ptr_array_unref0 (_data15_->pkgs);
		_g_free0 (_data15_->search_string_down);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static gboolean
_pamac_database_search_aur_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_search_aur_pkgs_async_co (self);
	return result;
}

static gint
____lambda19_ (Block15Data* _data15_)
{
	PamacDatabase* self;
	const gchar* _tmp0_;
	GMainContext* _tmp1_;
	gint result;
	self = _data15_->self;
	_tmp0_ = _data15_->search_string_down;
	pamac_database_search_aur_pkgs_real (self, _tmp0_, &_data15_->pkgs);
	_tmp1_ = self->priv->_context;
	g_main_context_invoke_full (_tmp1_, G_PRIORITY_DEFAULT, _pamac_database_search_aur_pkgs_async_co_gsource_func, _data15_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda19__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda19_ (self));
	block15_data_unref (self);
	return result;
}

static gboolean
pamac_database_search_aur_pkgs_async_co (PamacDatabaseSearchAurPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data15_ = g_slice_new0 (Block15Data);
	_data_->_data15_->_ref_count_ = 1;
	_data_->_data15_->self = g_object_ref (_data_->self);
	_data_->_data15_->_async_data_ = _data_;
	_data_->_tmp0_ = g_utf8_strdown (_data_->search_string, (gssize) -1);
	_data_->_data15_->search_string_down = _data_->_tmp0_;
	_data_->_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data15_->pkgs = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->_config;
	_data_->_tmp3_ = pamac_config_get_enable_aur (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (_data_->_tmp4_) {
		{
			_data_->_tmp5_ = g_thread_try_new ("search_aur_pkgs", _____lambda19__gthread_func, block15_data_ref (_data_->_data15_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:1294: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block15_data_unref (_data_->_data15_);
			_data_->_data15_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp9_ = _data_->_data15_->pkgs;
	_data_->_tmp10_ = _g_ptr_array_ref0 (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block15_data_unref (_data_->_data15_);
	_data_->_data15_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GHashTable*
pamac_database_search_files (PamacDatabase* self,
                             GPtrArray* files)
{
	GHashTable* _result_ = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GError* _inner_error0_ = NULL;
	GHashTable* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (files != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_ptr_array_unref0_);
	_result_ = _tmp2_;
	{
		AlpmConfig* _tmp3_;
		_tmp3_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			{
				GPtrArray* file_collection = NULL;
				guint file_index = 0U;
				file_collection = files;
				for (file_index = 0; file_index < file_collection->len; file_index = file_index + 1) {
					const gchar* file = NULL;
					file = (const gchar*) g_ptr_array_index (file_collection, file_index);
					{
						alpm_list_t* pkgcache = NULL;
						alpm_handle_t* _tmp4_;
						alpm_db_t* _tmp5_;
						alpm_db_t* _tmp6_;
						alpm_list_t* _tmp7_;
						alpm_list_t* _tmp8_;
						alpm_list_t* syncdbs = NULL;
						alpm_handle_t* _tmp46_;
						alpm_list_t* _tmp47_;
						alpm_list_t* _tmp48_;
						_tmp4_ = self->priv->alpm_handle;
						_tmp5_ = alpm_get_localdb (_tmp4_);
						_tmp6_ = _tmp5_;
						_tmp7_ = alpm_db_get_pkgcache (_tmp6_);
						_tmp8_ = _tmp7_;
						pkgcache = _tmp8_;
						while (TRUE) {
							alpm_list_t* _tmp9_;
							alpm_pkg_t* alpm_pkg = NULL;
							alpm_list_t* _tmp10_;
							gconstpointer _tmp11_;
							GPtrArray* found_files = NULL;
							GPtrArray* _tmp12_;
							alpm_filelist_t* filelist = NULL;
							alpm_pkg_t* _tmp13_;
							alpm_filelist_t* _tmp14_;
							alpm_filelist_t* _tmp15_;
							alpm_file_t* file_ptr = NULL;
							alpm_filelist_t* _tmp16_;
							alpm_file_t* _tmp17_;
							GPtrArray* _tmp37_;
							gint _tmp38_;
							gint _tmp39_;
							_tmp9_ = pkgcache;
							if (!(_tmp9_ != NULL)) {
								break;
							}
							_tmp10_ = pkgcache;
							_tmp11_ = _tmp10_->data;
							alpm_pkg = (alpm_pkg_t*) _tmp11_;
							_tmp12_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
							found_files = _tmp12_;
							_tmp13_ = alpm_pkg;
							_tmp14_ = alpm_pkg_get_files (_tmp13_);
							_tmp15_ = _tmp14_;
							filelist = _tmp15_;
							_tmp16_ = filelist;
							_tmp17_ = _tmp16_->files;
							file_ptr = _tmp17_;
							{
								gsize i = 0UL;
								i = (gsize) 0;
								{
									gboolean _tmp18_ = FALSE;
									_tmp18_ = TRUE;
									while (TRUE) {
										alpm_filelist_t* _tmp21_;
										alpm_file_t* _tmp22_;
										const gchar* _tmp23_;
										if (!_tmp18_) {
											gsize _tmp19_;
											alpm_file_t* _tmp20_;
											_tmp19_ = i;
											i = _tmp19_ + 1;
											_tmp20_ = file_ptr;
											file_ptr = _tmp20_ + 1;
										}
										_tmp18_ = FALSE;
										_tmp21_ = filelist;
										if (!(i < _tmp21_->count)) {
											break;
										}
										_tmp22_ = file_ptr;
										_tmp23_ = _tmp22_->name;
										if (!g_str_has_suffix (_tmp23_, "/")) {
											GString* real_file_name = NULL;
											alpm_handle_t* _tmp24_;
											const gchar* _tmp25_;
											const gchar* _tmp26_;
											GString* _tmp27_;
											GString* _tmp28_;
											alpm_file_t* _tmp29_;
											const gchar* _tmp30_;
											GString* _tmp31_;
											const gchar* _tmp32_;
											const gchar* _tmp33_;
											_tmp24_ = self->priv->alpm_handle;
											_tmp25_ = alpm_option_get_root (_tmp24_);
											_tmp26_ = _tmp25_;
											_tmp27_ = g_string_new (_tmp26_);
											real_file_name = _tmp27_;
											_tmp28_ = real_file_name;
											_tmp29_ = file_ptr;
											_tmp30_ = _tmp29_->name;
											g_string_append (_tmp28_, _tmp30_);
											_tmp31_ = real_file_name;
											_tmp32_ = _tmp31_->str;
											_tmp33_ = file;
											if (string_contains (_tmp32_, _tmp33_)) {
												GPtrArray* _tmp34_;
												GString* _tmp35_;
												gchar* _tmp36_;
												_tmp34_ = found_files;
												_tmp35_ = real_file_name;
												_tmp36_ = _tmp35_->str;
												_tmp35_->str = NULL;
												g_ptr_array_add (_tmp34_, _tmp36_);
											}
											_g_string_free0 (real_file_name);
										}
									}
								}
							}
							_tmp37_ = found_files;
							_tmp38_ = vala_g_ptr_array_get_length (_tmp37_);
							_tmp39_ = _tmp38_;
							if (_tmp39_ != 0) {
								GHashTable* _tmp40_;
								alpm_pkg_t* _tmp41_;
								const gchar* _tmp42_;
								const gchar* _tmp43_;
								gchar* _tmp44_;
								GPtrArray* _tmp45_;
								_tmp40_ = _result_;
								_tmp41_ = alpm_pkg;
								_tmp42_ = alpm_pkg_get_name (_tmp41_);
								_tmp43_ = _tmp42_;
								_tmp44_ = g_strdup (_tmp43_);
								_tmp45_ = found_files;
								found_files = NULL;
								g_hash_table_insert (_tmp40_, _tmp44_, _tmp45_);
							}
							pkgcache = alpm_list_next (pkgcache);
							_g_ptr_array_unref0 (found_files);
						}
						_tmp46_ = self->priv->files_handle;
						_tmp47_ = alpm_get_syncdbs (_tmp46_);
						_tmp48_ = _tmp47_;
						syncdbs = _tmp48_;
						while (TRUE) {
							alpm_list_t* _tmp49_;
							alpm_db_t* db = NULL;
							alpm_list_t* _tmp50_;
							gconstpointer _tmp51_;
							alpm_db_t* _tmp52_;
							alpm_list_t* _tmp53_;
							alpm_list_t* _tmp54_;
							_tmp49_ = syncdbs;
							if (!(_tmp49_ != NULL)) {
								break;
							}
							_tmp50_ = syncdbs;
							_tmp51_ = _tmp50_->data;
							db = (alpm_db_t*) _tmp51_;
							_tmp52_ = db;
							_tmp53_ = alpm_db_get_pkgcache (_tmp52_);
							_tmp54_ = _tmp53_;
							pkgcache = _tmp54_;
							while (TRUE) {
								alpm_list_t* _tmp55_;
								alpm_pkg_t* alpm_pkg = NULL;
								alpm_list_t* _tmp56_;
								gconstpointer _tmp57_;
								GPtrArray* found_files = NULL;
								GPtrArray* _tmp58_;
								alpm_filelist_t* filelist = NULL;
								alpm_pkg_t* _tmp59_;
								alpm_filelist_t* _tmp60_;
								alpm_filelist_t* _tmp61_;
								alpm_file_t* file_ptr = NULL;
								alpm_filelist_t* _tmp62_;
								alpm_file_t* _tmp63_;
								GPtrArray* _tmp84_;
								gint _tmp85_;
								gint _tmp86_;
								_tmp55_ = pkgcache;
								if (!(_tmp55_ != NULL)) {
									break;
								}
								_tmp56_ = pkgcache;
								_tmp57_ = _tmp56_->data;
								alpm_pkg = (alpm_pkg_t*) _tmp57_;
								_tmp58_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
								found_files = _tmp58_;
								_tmp59_ = alpm_pkg;
								_tmp60_ = alpm_pkg_get_files (_tmp59_);
								_tmp61_ = _tmp60_;
								filelist = _tmp61_;
								_tmp62_ = filelist;
								_tmp63_ = _tmp62_->files;
								file_ptr = _tmp63_;
								{
									gsize i = 0UL;
									i = (gsize) 0;
									{
										gboolean _tmp64_ = FALSE;
										_tmp64_ = TRUE;
										while (TRUE) {
											alpm_filelist_t* _tmp67_;
											alpm_file_t* _tmp68_;
											const gchar* _tmp69_;
											if (!_tmp64_) {
												gsize _tmp65_;
												alpm_file_t* _tmp66_;
												_tmp65_ = i;
												i = _tmp65_ + 1;
												_tmp66_ = file_ptr;
												file_ptr = _tmp66_ + 1;
											}
											_tmp64_ = FALSE;
											_tmp67_ = filelist;
											if (!(i < _tmp67_->count)) {
												break;
											}
											_tmp68_ = file_ptr;
											_tmp69_ = _tmp68_->name;
											if (!g_str_has_suffix (_tmp69_, "/")) {
												GString* real_file_name = NULL;
												GString* _tmp70_;
												GString* _tmp71_;
												alpm_handle_t* _tmp72_;
												const gchar* _tmp73_;
												const gchar* _tmp74_;
												GString* _tmp75_;
												alpm_file_t* _tmp76_;
												const gchar* _tmp77_;
												GString* _tmp78_;
												const gchar* _tmp79_;
												const gchar* _tmp80_;
												_tmp70_ = g_string_new ("");
												real_file_name = _tmp70_;
												_tmp71_ = real_file_name;
												_tmp72_ = self->priv->alpm_handle;
												_tmp73_ = alpm_option_get_root (_tmp72_);
												_tmp74_ = _tmp73_;
												g_string_append (_tmp71_, _tmp74_);
												_tmp75_ = real_file_name;
												_tmp76_ = file_ptr;
												_tmp77_ = _tmp76_->name;
												g_string_append (_tmp75_, _tmp77_);
												_tmp78_ = real_file_name;
												_tmp79_ = _tmp78_->str;
												_tmp80_ = file;
												if (string_contains (_tmp79_, _tmp80_)) {
													GPtrArray* _tmp81_;
													GString* _tmp82_;
													gchar* _tmp83_;
													_tmp81_ = found_files;
													_tmp82_ = real_file_name;
													_tmp83_ = _tmp82_->str;
													_tmp82_->str = NULL;
													g_ptr_array_add (_tmp81_, _tmp83_);
												}
												_g_string_free0 (real_file_name);
											}
										}
									}
								}
								_tmp84_ = found_files;
								_tmp85_ = vala_g_ptr_array_get_length (_tmp84_);
								_tmp86_ = _tmp85_;
								if (_tmp86_ != 0) {
									GHashTable* _tmp87_;
									alpm_pkg_t* _tmp88_;
									const gchar* _tmp89_;
									const gchar* _tmp90_;
									gchar* _tmp91_;
									GPtrArray* _tmp92_;
									_tmp87_ = _result_;
									_tmp88_ = alpm_pkg;
									_tmp89_ = alpm_pkg_get_name (_tmp88_);
									_tmp90_ = _tmp89_;
									_tmp91_ = g_strdup (_tmp90_);
									_tmp92_ = found_files;
									found_files = NULL;
									g_hash_table_insert (_tmp87_, _tmp91_, _tmp92_);
								}
								pkgcache = alpm_list_next (pkgcache);
								_g_ptr_array_unref0 (found_files);
							}
							syncdbs = alpm_list_next (syncdbs);
						}
					}
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp93_;
			_tmp93_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_hash_table_unref0 (_result_);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = _result_;
	return result;
}

GPtrArray*
pamac_database_get_categories_names (PamacDatabase* self)
{
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	GPtrArray* _tmp3_;
	gchar* _tmp4_;
	GPtrArray* _tmp5_;
	gchar* _tmp6_;
	GPtrArray* _tmp7_;
	gchar* _tmp8_;
	GPtrArray* _tmp9_;
	gchar* _tmp10_;
	GPtrArray* _tmp11_;
	gchar* _tmp12_;
	GPtrArray* _tmp13_;
	gchar* _tmp14_;
	GPtrArray* _tmp15_;
	gchar* _tmp16_;
	GPtrArray* _tmp17_;
	gchar* _tmp18_;
	GPtrArray* _tmp19_;
	gchar* _tmp20_;
	GPtrArray* _tmp21_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->categories_names;
	if (_tmp0_ != NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = self->priv->categories_names;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	_g_ptr_array_unref0 (self->priv->categories_names);
	self->priv->categories_names = _tmp2_;
	_tmp3_ = self->priv->categories_names;
	_tmp4_ = g_strdup ("Featured");
	g_ptr_array_add (_tmp3_, _tmp4_);
	_tmp5_ = self->priv->categories_names;
	_tmp6_ = g_strdup ("Photo & Video");
	g_ptr_array_add (_tmp5_, _tmp6_);
	_tmp7_ = self->priv->categories_names;
	_tmp8_ = g_strdup ("Music & Audio");
	g_ptr_array_add (_tmp7_, _tmp8_);
	_tmp9_ = self->priv->categories_names;
	_tmp10_ = g_strdup ("Productivity");
	g_ptr_array_add (_tmp9_, _tmp10_);
	_tmp11_ = self->priv->categories_names;
	_tmp12_ = g_strdup ("Communication & News");
	g_ptr_array_add (_tmp11_, _tmp12_);
	_tmp13_ = self->priv->categories_names;
	_tmp14_ = g_strdup ("Education & Science");
	g_ptr_array_add (_tmp13_, _tmp14_);
	_tmp15_ = self->priv->categories_names;
	_tmp16_ = g_strdup ("Games");
	g_ptr_array_add (_tmp15_, _tmp16_);
	_tmp17_ = self->priv->categories_names;
	_tmp18_ = g_strdup ("Utilities");
	g_ptr_array_add (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->categories_names;
	_tmp20_ = g_strdup ("Development");
	g_ptr_array_add (_tmp19_, _tmp20_);
	_tmp21_ = self->priv->categories_names;
	result = _tmp21_;
	return result;
}

static GPtrArray*
pamac_database_get_apps_pkgs (PamacDatabase* self,
                              GHashTable* apps)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GHashTableIter iter = {0};
	PamacApp* app = NULL;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (apps != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	g_hash_table_iter_init (&iter, apps);
	while (TRUE) {
		gconstpointer _tmp1_ = NULL;
		gboolean _tmp2_;
		const gchar* pkgname = NULL;
		PamacApp* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		PamacAlpmPackageLinked* pkg = NULL;
		GHashTable* _tmp6_;
		PamacApp* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gconstpointer _tmp10_;
		PamacAlpmPackageLinked* _tmp11_;
		PamacAlpmPackageLinked* _tmp12_;
		alpm_pkg_t* local_pkg = NULL;
		alpm_handle_t* _tmp15_;
		alpm_db_t* _tmp16_;
		alpm_db_t* _tmp17_;
		const gchar* _tmp18_;
		alpm_pkg_t* _tmp19_;
		alpm_pkg_t* _tmp20_;
		_tmp2_ = g_hash_table_iter_next (&iter, (gpointer*) NULL, (gpointer*) (&_tmp1_));
		app = (PamacApp*) _tmp1_;
		if (!_tmp2_) {
			break;
		}
		_tmp3_ = app;
		_tmp4_ = pamac_app_get_pkgname (_tmp3_);
		_tmp5_ = _tmp4_;
		pkgname = _tmp5_;
		_tmp6_ = self->priv->pkgs_cache;
		_tmp7_ = app;
		_tmp8_ = pamac_app_get_id (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_hash_table_lookup (_tmp6_, _tmp9_);
		_tmp11_ = _g_object_ref0 ((PamacAlpmPackageLinked*) _tmp10_);
		pkg = _tmp11_;
		_tmp12_ = pkg;
		if (_tmp12_ != NULL) {
			GPtrArray* _tmp13_;
			PamacAlpmPackageLinked* _tmp14_;
			_tmp13_ = pkgs;
			_tmp14_ = pkg;
			g_ptr_array_add (_tmp13_, (PamacAlpmPackage*) _tmp14_);
			_g_object_unref0 (pkg);
			continue;
		}
		_tmp15_ = self->priv->alpm_handle;
		_tmp16_ = alpm_get_localdb (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = pkgname;
		_tmp19_ = alpm_db_get_pkg (_tmp17_, _tmp18_);
		local_pkg = _tmp19_;
		_tmp20_ = local_pkg;
		if (_tmp20_ != NULL) {
			alpm_pkg_t* _tmp21_;
			PamacAlpmPackageLinked* _tmp22_;
			PamacAlpmPackageLinked* _tmp23_;
			alpm_pkg_t* _tmp24_;
			PamacAlpmPackageLinked* _tmp25_;
			PamacApp* _tmp26_;
			GPtrArray* _tmp27_;
			PamacAlpmPackageLinked* _tmp28_;
			GHashTable* _tmp29_;
			PamacAlpmPackageLinked* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			PamacAlpmPackageLinked* _tmp33_;
			PamacAlpmPackageLinked* _tmp34_;
			_tmp21_ = local_pkg;
			_tmp22_ = pamac_alpm_package_linked_new_from_alpm (_tmp21_, self);
			_g_object_unref0 (pkg);
			pkg = _tmp22_;
			_tmp23_ = pkg;
			_tmp24_ = local_pkg;
			pamac_alpm_package_linked_set_local_pkg (_tmp23_, _tmp24_);
			_tmp25_ = pkg;
			_tmp26_ = app;
			pamac_alpm_package_linked_set_app (_tmp25_, _tmp26_);
			_tmp27_ = pkgs;
			_tmp28_ = pkg;
			g_ptr_array_add (_tmp27_, (PamacAlpmPackage*) _tmp28_);
			_tmp29_ = self->priv->pkgs_cache;
			_tmp30_ = pkg;
			_tmp31_ = pamac_package_get_id ((PamacPackage*) _tmp30_);
			_tmp32_ = _tmp31_;
			_tmp33_ = pkg;
			_tmp34_ = _g_object_ref0 (_tmp33_);
			g_hash_table_replace (_tmp29_, _tmp32_, _tmp34_);
		} else {
			alpm_pkg_t* sync_pkg = NULL;
			alpm_handle_t* _tmp35_;
			const gchar* _tmp36_;
			alpm_pkg_t* _tmp37_;
			alpm_pkg_t* _tmp38_;
			_tmp35_ = self->priv->alpm_handle;
			_tmp36_ = pkgname;
			_tmp37_ = pamac_database_get_syncpkg (self, _tmp35_, _tmp36_);
			sync_pkg = _tmp37_;
			_tmp38_ = sync_pkg;
			if (_tmp38_ != NULL) {
				alpm_pkg_t* _tmp39_;
				PamacAlpmPackageLinked* _tmp40_;
				PamacAlpmPackageLinked* _tmp41_;
				alpm_pkg_t* _tmp42_;
				PamacAlpmPackageLinked* _tmp43_;
				alpm_pkg_t* _tmp44_;
				PamacAlpmPackageLinked* _tmp45_;
				PamacApp* _tmp46_;
				GPtrArray* _tmp47_;
				PamacAlpmPackageLinked* _tmp48_;
				GHashTable* _tmp49_;
				PamacAlpmPackageLinked* _tmp50_;
				const gchar* _tmp51_;
				const gchar* _tmp52_;
				PamacAlpmPackageLinked* _tmp53_;
				PamacAlpmPackageLinked* _tmp54_;
				_tmp39_ = sync_pkg;
				_tmp40_ = pamac_alpm_package_linked_new_from_alpm (_tmp39_, self);
				_g_object_unref0 (pkg);
				pkg = _tmp40_;
				_tmp41_ = pkg;
				_tmp42_ = local_pkg;
				pamac_alpm_package_linked_set_local_pkg (_tmp41_, _tmp42_);
				_tmp43_ = pkg;
				_tmp44_ = sync_pkg;
				pamac_alpm_package_linked_set_sync_pkg (_tmp43_, _tmp44_);
				_tmp45_ = pkg;
				_tmp46_ = app;
				pamac_alpm_package_linked_set_app (_tmp45_, _tmp46_);
				_tmp47_ = pkgs;
				_tmp48_ = pkg;
				g_ptr_array_add (_tmp47_, (PamacAlpmPackage*) _tmp48_);
				_tmp49_ = self->priv->pkgs_cache;
				_tmp50_ = pkg;
				_tmp51_ = pamac_package_get_id ((PamacPackage*) _tmp50_);
				_tmp52_ = _tmp51_;
				_tmp53_ = pkg;
				_tmp54_ = _g_object_ref0 (_tmp53_);
				g_hash_table_replace (_tmp49_, _tmp52_, _tmp54_);
			}
		}
		_g_object_unref0 (pkg);
	}
	result = pkgs;
	return result;
}

static void
pamac_database_get_category_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetCategoryPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->category);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetCategoryPkgsAsyncData, _data_);
}

void
pamac_database_get_category_pkgs_async (PamacDatabase* self,
                                        const gchar* category,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	PamacDatabaseGetCategoryPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (category != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetCategoryPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_category_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (category);
	_g_free0 (_data_->category);
	_data_->category = _tmp1_;
	pamac_database_get_category_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_get_category_pkgs_finish (PamacDatabase* self,
                                         GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetCategoryPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		PamacDatabase* self;
		self = _data16_->self;
		_g_ptr_array_unref0 (_data16_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		PamacDatabase* self;
		self = _data17_->_data16_->self;
		_g_free0 (_data17_->category_copy);
		block16_data_unref (_data17_->_data16_);
		_data17_->_data16_ = NULL;
		g_slice_free (Block17Data, _data17_);
	}
}

static gboolean
_pamac_database_get_category_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_category_pkgs_async_co (self);
	return result;
}

static gint
____lambda20_ (Block17Data* _data17_)
{
	Block16Data* _data16_;
	PamacDatabase* self;
	GMainContext* _tmp17_;
	GError* _inner_error0_ = NULL;
	gint result;
	_data16_ = _data17_->_data16_;
	self = _data16_->self;
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			const gchar* _tmp1_;
			const gchar* _tmp2_;
			GQuark _tmp4_ = 0U;
			static GQuark _tmp3_label0 = 0;
			static GQuark _tmp3_label1 = 0;
			static GQuark _tmp3_label2 = 0;
			static GQuark _tmp3_label3 = 0;
			static GQuark _tmp3_label4 = 0;
			static GQuark _tmp3_label5 = 0;
			static GQuark _tmp3_label6 = 0;
			static GQuark _tmp3_label7 = 0;
			static GQuark _tmp3_label8 = 0;
			_tmp1_ = _data17_->category_copy;
			_tmp2_ = _tmp1_;
			_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
			if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("Featured")))) {
				switch (0) {
					default:
					{
						GHashTable* featured_apps = NULL;
						PamacAppstreamPlugin* _tmp5_;
						const gchar* _tmp6_;
						GHashTable* _tmp7_;
						GHashTable* _tmp8_;
						GPtrArray* _tmp9_;
						_tmp5_ = self->priv->appstream_plugin;
						_tmp6_ = _data17_->category_copy;
						_tmp7_ = pamac_appstream_plugin_get_category_apps (_tmp5_, _tmp6_);
						featured_apps = _tmp7_;
						_tmp8_ = featured_apps;
						_tmp9_ = pamac_database_get_apps_pkgs (self, _tmp8_);
						_g_ptr_array_unref0 (_data16_->pkgs);
						_data16_->pkgs = _tmp9_;
						_g_hash_table_unref0 (featured_apps);
						break;
					}
				}
			} else if ((((((((_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("Photo & Video")))) || (_tmp4_ == ((0 != _tmp3_label2) ? _tmp3_label2 : (_tmp3_label2 = g_quark_from_static_string ("Music & Audio"))))) || (_tmp4_ == ((0 != _tmp3_label3) ? _tmp3_label3 : (_tmp3_label3 = g_quark_from_static_string ("Productivity"))))) || (_tmp4_ == ((0 != _tmp3_label4) ? _tmp3_label4 : (_tmp3_label4 = g_quark_from_static_string ("Communication & News"))))) || (_tmp4_ == ((0 != _tmp3_label5) ? _tmp3_label5 : (_tmp3_label5 = g_quark_from_static_string ("Education & Science"))))) || (_tmp4_ == ((0 != _tmp3_label6) ? _tmp3_label6 : (_tmp3_label6 = g_quark_from_static_string ("Games"))))) || (_tmp4_ == ((0 != _tmp3_label7) ? _tmp3_label7 : (_tmp3_label7 = g_quark_from_static_string ("Utilities"))))) || (_tmp4_ == ((0 != _tmp3_label8) ? _tmp3_label8 : (_tmp3_label8 = g_quark_from_static_string ("Development"))))) {
				switch (0) {
					default:
					{
						GHashTable* category_apps = NULL;
						PamacAppstreamPlugin* _tmp10_;
						const gchar* _tmp11_;
						GHashTable* _tmp12_;
						GHashTable* _tmp13_;
						GPtrArray* _tmp14_;
						_tmp10_ = self->priv->appstream_plugin;
						_tmp11_ = _data17_->category_copy;
						_tmp12_ = pamac_appstream_plugin_get_category_apps (_tmp10_, _tmp11_);
						category_apps = _tmp12_;
						_tmp13_ = category_apps;
						_tmp14_ = pamac_database_get_apps_pkgs (self, _tmp13_);
						_g_ptr_array_unref0 (_data16_->pkgs);
						_data16_->pkgs = _tmp14_;
						_g_hash_table_unref0 (category_apps);
						break;
					}
				}
			} else {
				switch (0) {
					default:
					{
						break;
					}
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp15_;
			_tmp15_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp16_ = -1;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp16_;
		}
	}
	_tmp17_ = self->priv->_context;
	g_main_context_invoke_full (_tmp17_, G_PRIORITY_DEFAULT, _pamac_database_get_category_pkgs_async_co_gsource_func, _data16_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda20__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda20_ (self));
	block17_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_category_pkgs_async_co (PamacDatabaseGetCategoryPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data16_ = g_slice_new0 (Block16Data);
	_data_->_data16_->_ref_count_ = 1;
	_data_->_data16_->self = g_object_ref (_data_->self);
	_data_->_data16_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data16_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_appstream (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_data17_ = g_slice_new0 (Block17Data);
		_data_->_data17_->_ref_count_ = 1;
		_data_->_data17_->_data16_ = block16_data_ref (_data_->_data16_);
		_data_->_tmp4_ = g_strdup (_data_->category);
		_data_->_data17_->category_copy = _data_->_tmp4_;
		{
			_data_->_tmp5_ = g_thread_try_new ("get_category_pkgs", _____lambda20__gthread_func, block17_data_ref (_data_->_data17_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:1443: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block17_data_unref (_data_->_data17_);
			_data_->_data17_ = NULL;
			block16_data_unref (_data_->_data16_);
			_data_->_data16_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block17_data_unref (_data_->_data17_);
		_data_->_data17_ = NULL;
	}
	_data_->_tmp9_ = _data_->_data16_->pkgs;
	_data_->_tmp10_ = _g_ptr_array_ref0 (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block16_data_unref (_data_->_data16_);
	_data_->_data16_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GPtrArray*
pamac_database_get_repos_names (PamacDatabase* self)
{
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	alpm_list_t* syncdbs = NULL;
	alpm_handle_t* _tmp3_;
	alpm_list_t* _tmp4_;
	alpm_list_t* _tmp5_;
	GPtrArray* _tmp14_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->repos_names;
	if (_tmp0_ != NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = self->priv->repos_names;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	_g_ptr_array_unref0 (self->priv->repos_names);
	self->priv->repos_names = _tmp2_;
	_tmp3_ = self->priv->alpm_handle;
	_tmp4_ = alpm_get_syncdbs (_tmp3_);
	_tmp5_ = _tmp4_;
	syncdbs = _tmp5_;
	while (TRUE) {
		alpm_list_t* _tmp6_;
		alpm_db_t* db = NULL;
		alpm_list_t* _tmp7_;
		gconstpointer _tmp8_;
		GPtrArray* _tmp9_;
		alpm_db_t* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp6_ = syncdbs;
		if (!(_tmp6_ != NULL)) {
			break;
		}
		_tmp7_ = syncdbs;
		_tmp8_ = _tmp7_->data;
		db = (alpm_db_t*) _tmp8_;
		_tmp9_ = self->priv->repos_names;
		_tmp10_ = db;
		_tmp11_ = alpm_db_get_name (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strdup (_tmp12_);
		g_ptr_array_add (_tmp9_, _tmp13_);
		syncdbs = alpm_list_next (syncdbs);
	}
	_tmp14_ = self->priv->repos_names;
	result = _tmp14_;
	return result;
}

static void
pamac_database_get_repo_pkgs_real (PamacDatabase* self,
                                   const gchar* repo,
                                   GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (repo != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* syncdbs = NULL;
			alpm_handle_t* _tmp1_;
			alpm_list_t* _tmp2_;
			alpm_list_t* _tmp3_;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_syncdbs (_tmp1_);
			_tmp3_ = _tmp2_;
			syncdbs = _tmp3_;
			while (TRUE) {
				alpm_list_t* _tmp4_;
				alpm_db_t* db = NULL;
				alpm_list_t* _tmp5_;
				gconstpointer _tmp6_;
				alpm_db_t* _tmp7_;
				const gchar* _tmp8_;
				const gchar* _tmp9_;
				_tmp4_ = syncdbs;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp5_ = syncdbs;
				_tmp6_ = _tmp5_->data;
				db = (alpm_db_t*) _tmp6_;
				_tmp7_ = db;
				_tmp8_ = alpm_db_get_name (_tmp7_);
				_tmp9_ = _tmp8_;
				if (g_strcmp0 (_tmp9_, repo) == 0) {
					alpm_list_t* pkgcache = NULL;
					alpm_db_t* _tmp10_;
					alpm_list_t* _tmp11_;
					alpm_list_t* _tmp12_;
					_tmp10_ = db;
					_tmp11_ = alpm_db_get_pkgcache (_tmp10_);
					_tmp12_ = _tmp11_;
					pkgcache = _tmp12_;
					while (TRUE) {
						alpm_list_t* _tmp13_;
						alpm_pkg_t* sync_pkg = NULL;
						alpm_list_t* _tmp14_;
						gconstpointer _tmp15_;
						alpm_pkg_t* local_pkg = NULL;
						alpm_handle_t* _tmp16_;
						alpm_db_t* _tmp17_;
						alpm_db_t* _tmp18_;
						alpm_pkg_t* _tmp19_;
						const gchar* _tmp20_;
						const gchar* _tmp21_;
						alpm_pkg_t* _tmp22_;
						alpm_pkg_t* _tmp23_;
						_tmp13_ = pkgcache;
						if (!(_tmp13_ != NULL)) {
							break;
						}
						_tmp14_ = pkgcache;
						_tmp15_ = _tmp14_->data;
						sync_pkg = (alpm_pkg_t*) _tmp15_;
						_tmp16_ = self->priv->alpm_handle;
						_tmp17_ = alpm_get_localdb (_tmp16_);
						_tmp18_ = _tmp17_;
						_tmp19_ = sync_pkg;
						_tmp20_ = alpm_pkg_get_name (_tmp19_);
						_tmp21_ = _tmp20_;
						_tmp22_ = alpm_db_get_pkg (_tmp18_, _tmp21_);
						local_pkg = _tmp22_;
						_tmp23_ = local_pkg;
						if (_tmp23_ != NULL) {
							PamacAlpmPackage* new_pkg = NULL;
							alpm_pkg_t* _tmp24_;
							alpm_pkg_t* _tmp25_;
							PamacAlpmPackage* _tmp26_;
							PamacAlpmPackage* _tmp27_;
							_tmp24_ = local_pkg;
							_tmp25_ = sync_pkg;
							_tmp26_ = pamac_database_initialise_pkg (self, _tmp24_, _tmp25_);
							new_pkg = _tmp26_;
							_tmp27_ = new_pkg;
							g_ptr_array_add (*pkgs, _tmp27_);
						} else {
							PamacAlpmPackage* new_pkg = NULL;
							alpm_pkg_t* _tmp28_;
							alpm_pkg_t* _tmp29_;
							PamacAlpmPackage* _tmp30_;
							PamacAlpmPackage* _tmp31_;
							_tmp28_ = sync_pkg;
							_tmp29_ = sync_pkg;
							_tmp30_ = pamac_database_initialise_pkg (self, _tmp28_, _tmp29_);
							new_pkg = _tmp30_;
							_tmp31_ = new_pkg;
							g_ptr_array_add (*pkgs, _tmp31_);
						}
						pkgcache = alpm_list_next (pkgcache);
					}
					break;
				}
				syncdbs = alpm_list_next (syncdbs);
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp32_;
			_tmp32_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_get_repo_pkgs (PamacDatabase* self,
                              const gchar* repo)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (repo != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	pamac_database_get_repo_pkgs_real (self, repo, &pkgs);
	result = pkgs;
	return result;
}

static void
pamac_database_get_repo_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetRepoPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->repo);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetRepoPkgsAsyncData, _data_);
}

void
pamac_database_get_repo_pkgs_async (PamacDatabase* self,
                                    const gchar* repo,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	PamacDatabaseGetRepoPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (repo != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetRepoPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_repo_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (repo);
	_g_free0 (_data_->repo);
	_data_->repo = _tmp1_;
	pamac_database_get_repo_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_get_repo_pkgs_finish (PamacDatabase* self,
                                     GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetRepoPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		PamacDatabase* self;
		self = _data18_->self;
		_g_free0 (_data18_->repo_copy);
		_g_ptr_array_unref0 (_data18_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}

static gboolean
_pamac_database_get_repo_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_repo_pkgs_async_co (self);
	return result;
}

static gint
___lambda21_ (Block18Data* _data18_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data18_->self;
	pamac_database_get_repo_pkgs_real (self, _data18_->repo_copy, &_data18_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_repo_pkgs_async_co_gsource_func, _data18_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda21__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda21_ (self));
	block18_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_repo_pkgs_async_co (PamacDatabaseGetRepoPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data18_ = g_slice_new0 (Block18Data);
	_data_->_data18_->_ref_count_ = 1;
	_data_->_data18_->self = g_object_ref (_data_->self);
	_data_->_data18_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data18_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = g_strdup (_data_->repo);
	_data_->_data18_->repo_copy = _data_->_tmp1_;
	{
		_data_->_tmp2_ = g_thread_try_new ("get_repo_pkgs", ____lambda21__gthread_func, block18_data_ref (_data_->_data18_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:1506: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block18_data_unref (_data_->_data18_);
		_data_->_data18_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _g_ptr_array_ref0 (_data_->_data18_->pkgs);
	_data_->result = _data_->_tmp6_;
	block18_data_unref (_data_->_data18_);
	_data_->_data18_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GPtrArray*
pamac_database_get_groups_names (PamacDatabase* self)
{
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	GPtrArray* _tmp37_;
	GCompareFunc _tmp38_;
	GPtrArray* _tmp39_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->groups_names;
	if (_tmp0_ != NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = self->priv->groups_names;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	_g_ptr_array_unref0 (self->priv->groups_names);
	self->priv->groups_names = _tmp2_;
	{
		AlpmConfig* _tmp3_;
		_tmp3_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* groupcache = NULL;
			alpm_handle_t* _tmp4_;
			alpm_db_t* _tmp5_;
			alpm_db_t* _tmp6_;
			alpm_list_t* _tmp7_;
			alpm_list_t* _tmp8_;
			alpm_list_t* syncdbs = NULL;
			alpm_handle_t* _tmp16_;
			alpm_list_t* _tmp17_;
			alpm_list_t* _tmp18_;
			_tmp4_ = self->priv->alpm_handle;
			_tmp5_ = alpm_get_localdb (_tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = alpm_db_get_groupcache (_tmp6_);
			_tmp8_ = _tmp7_;
			groupcache = _tmp8_;
			while (TRUE) {
				alpm_list_t* _tmp9_;
				alpm_group_t* group = NULL;
				alpm_list_t* _tmp10_;
				gconstpointer _tmp11_;
				GPtrArray* _tmp12_;
				alpm_group_t* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				_tmp9_ = groupcache;
				if (!(_tmp9_ != NULL)) {
					break;
				}
				_tmp10_ = groupcache;
				_tmp11_ = _tmp10_->data;
				group = (alpm_group_t*) _tmp11_;
				_tmp12_ = self->priv->groups_names;
				_tmp13_ = group;
				_tmp14_ = _tmp13_->name;
				_tmp15_ = g_strdup (_tmp14_);
				g_ptr_array_add (_tmp12_, _tmp15_);
				groupcache = alpm_list_next (groupcache);
			}
			_tmp16_ = self->priv->alpm_handle;
			_tmp17_ = alpm_get_syncdbs (_tmp16_);
			_tmp18_ = _tmp17_;
			syncdbs = _tmp18_;
			while (TRUE) {
				alpm_list_t* _tmp19_;
				alpm_db_t* db = NULL;
				alpm_list_t* _tmp20_;
				gconstpointer _tmp21_;
				alpm_db_t* _tmp22_;
				alpm_list_t* _tmp23_;
				alpm_list_t* _tmp24_;
				_tmp19_ = syncdbs;
				if (!(_tmp19_ != NULL)) {
					break;
				}
				_tmp20_ = syncdbs;
				_tmp21_ = _tmp20_->data;
				db = (alpm_db_t*) _tmp21_;
				_tmp22_ = db;
				_tmp23_ = alpm_db_get_groupcache (_tmp22_);
				_tmp24_ = _tmp23_;
				groupcache = _tmp24_;
				while (TRUE) {
					alpm_list_t* _tmp25_;
					alpm_group_t* group = NULL;
					alpm_list_t* _tmp26_;
					gconstpointer _tmp27_;
					GPtrArray* _tmp28_;
					alpm_group_t* _tmp29_;
					const gchar* _tmp30_;
					GEqualFunc _tmp31_;
					_tmp25_ = groupcache;
					if (!(_tmp25_ != NULL)) {
						break;
					}
					_tmp26_ = groupcache;
					_tmp27_ = _tmp26_->data;
					group = (alpm_group_t*) _tmp27_;
					_tmp28_ = self->priv->groups_names;
					_tmp29_ = group;
					_tmp30_ = _tmp29_->name;
					_tmp31_ = g_str_equal;
					if (!g_ptr_array_find_with_equal_func (_tmp28_, _tmp30_, _tmp31_, NULL)) {
						GPtrArray* _tmp32_;
						alpm_group_t* _tmp33_;
						const gchar* _tmp34_;
						gchar* _tmp35_;
						_tmp32_ = self->priv->groups_names;
						_tmp33_ = group;
						_tmp34_ = _tmp33_->name;
						_tmp35_ = g_strdup (_tmp34_);
						g_ptr_array_add (_tmp32_, _tmp35_);
					}
					groupcache = alpm_list_next (groupcache);
				}
				syncdbs = alpm_list_next (syncdbs);
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp36_;
			_tmp36_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp37_ = self->priv->groups_names;
	_tmp38_ = ((GCompareFunc) g_strcmp0);
	vala_g_ptr_array_sort (_tmp37_, _tmp38_);
	_tmp39_ = self->priv->groups_names;
	result = _tmp39_;
	return result;
}

static gint
_pkg_compare_name_gcompare_func (gconstpointer a,
                                 gconstpointer b)
{
	gint result;
	result = pkg_compare_name ((PamacPackage*) a, (PamacPackage*) b);
	return result;
}

static void
pamac_database_get_group_pkgs_real (PamacDatabase* self,
                                    const gchar* group_name,
                                    GPtrArray** pkgs)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group_name != NULL);
	g_return_if_fail (*pkgs != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_list_t* alpm_pkgs = NULL;
			gint dbs_found = 0;
			alpm_group_t* grp = NULL;
			alpm_handle_t* _tmp1_;
			alpm_db_t* _tmp2_;
			alpm_db_t* _tmp3_;
			alpm_group_t* _tmp4_;
			alpm_group_t* _tmp5_;
			alpm_list_t* syncdbs = NULL;
			alpm_handle_t* _tmp13_;
			alpm_list_t* _tmp14_;
			alpm_list_t* _tmp15_;
			alpm_list_t* _tmp32_;
			alpm_pkgs = NULL;
			dbs_found = 0;
			_tmp1_ = self->priv->alpm_handle;
			_tmp2_ = alpm_get_localdb (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = alpm_db_get_group (_tmp3_, group_name);
			grp = _tmp4_;
			_tmp5_ = grp;
			if (_tmp5_ != NULL) {
				gint _tmp6_;
				alpm_list_t* packages = NULL;
				alpm_group_t* _tmp7_;
				alpm_list_t* _tmp8_;
				_tmp6_ = dbs_found;
				dbs_found = _tmp6_ + 1;
				_tmp7_ = grp;
				_tmp8_ = _tmp7_->packages;
				packages = _tmp8_;
				while (TRUE) {
					alpm_list_t* _tmp9_;
					alpm_pkg_t* local_pkg = NULL;
					alpm_list_t* _tmp10_;
					gconstpointer _tmp11_;
					alpm_pkg_t* _tmp12_;
					_tmp9_ = packages;
					if (!(_tmp9_ != NULL)) {
						break;
					}
					_tmp10_ = packages;
					_tmp11_ = _tmp10_->data;
					local_pkg = (alpm_pkg_t*) _tmp11_;
					_tmp12_ = local_pkg;
					alpm_pkgs = alpm_list_add (alpm_pkgs, _tmp12_);
					packages = alpm_list_next (packages);
				}
			}
			_tmp13_ = self->priv->alpm_handle;
			_tmp14_ = alpm_get_syncdbs (_tmp13_);
			_tmp15_ = _tmp14_;
			syncdbs = _tmp15_;
			while (TRUE) {
				alpm_list_t* _tmp16_;
				alpm_db_t* db = NULL;
				alpm_list_t* _tmp17_;
				gconstpointer _tmp18_;
				alpm_db_t* _tmp19_;
				alpm_group_t* _tmp20_;
				alpm_group_t* _tmp21_;
				_tmp16_ = syncdbs;
				if (!(_tmp16_ != NULL)) {
					break;
				}
				_tmp17_ = syncdbs;
				_tmp18_ = _tmp17_->data;
				db = (alpm_db_t*) _tmp18_;
				_tmp19_ = db;
				_tmp20_ = alpm_db_get_group (_tmp19_, group_name);
				grp = _tmp20_;
				_tmp21_ = grp;
				if (_tmp21_ != NULL) {
					gint _tmp22_;
					alpm_list_t* packages = NULL;
					alpm_group_t* _tmp23_;
					alpm_list_t* _tmp24_;
					_tmp22_ = dbs_found;
					dbs_found = _tmp22_ + 1;
					_tmp23_ = grp;
					_tmp24_ = _tmp23_->packages;
					packages = _tmp24_;
					while (TRUE) {
						alpm_list_t* _tmp25_;
						alpm_pkg_t* pkg = NULL;
						alpm_list_t* _tmp26_;
						gconstpointer _tmp27_;
						alpm_list_t* _tmp28_;
						alpm_pkg_t* _tmp29_;
						gconstpointer _tmp30_;
						_tmp25_ = packages;
						if (!(_tmp25_ != NULL)) {
							break;
						}
						_tmp26_ = packages;
						_tmp27_ = _tmp26_->data;
						pkg = (alpm_pkg_t*) _tmp27_;
						_tmp28_ = alpm_pkgs;
						_tmp29_ = pkg;
						_tmp30_ = alpm_list_find (_tmp28_, _tmp29_, (alpm_list_fn_cmp) alpm_pkg_compare_name);
						if (((alpm_pkg_t*) _tmp30_) == NULL) {
							alpm_pkg_t* _tmp31_;
							_tmp31_ = pkg;
							alpm_pkgs = alpm_list_add (alpm_pkgs, _tmp31_);
						}
						packages = alpm_list_next (packages);
					}
				}
				syncdbs = alpm_list_next (syncdbs);
			}
			_tmp32_ = alpm_pkgs;
			pamac_database_initialise_pkgs (self, _tmp32_, pkgs);
			if (dbs_found > 1) {
				vala_g_ptr_array_sort (*pkgs, _pkg_compare_name_gcompare_func);
			}
			_alpm_list_free0 (alpm_pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp33_;
			_tmp33_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_get_group_pkgs (PamacDatabase* self,
                               const gchar* group_name)
{
	GPtrArray* pkgs = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (group_name != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	pkgs = _tmp0_;
	pamac_database_get_group_pkgs_real (self, group_name, &pkgs);
	result = pkgs;
	return result;
}

static void
pamac_database_get_group_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetGroupPkgsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->group_name);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetGroupPkgsAsyncData, _data_);
}

void
pamac_database_get_group_pkgs_async (PamacDatabase* self,
                                     const gchar* group_name,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	PamacDatabaseGetGroupPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (group_name != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetGroupPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_group_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (group_name);
	_g_free0 (_data_->group_name);
	_data_->group_name = _tmp1_;
	pamac_database_get_group_pkgs_async_co (_data_);
}

GPtrArray*
pamac_database_get_group_pkgs_finish (PamacDatabase* self,
                                      GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetGroupPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block19Data*
block19_data_ref (Block19Data* _data19_)
{
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}

static void
block19_data_unref (void * _userdata_)
{
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		PamacDatabase* self;
		self = _data19_->self;
		_g_free0 (_data19_->group_name_copy);
		_g_ptr_array_unref0 (_data19_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}

static gboolean
_pamac_database_get_group_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_group_pkgs_async_co (self);
	return result;
}

static gint
___lambda22_ (Block19Data* _data19_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data19_->self;
	pamac_database_get_group_pkgs_real (self, _data19_->group_name_copy, &_data19_->pkgs);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_group_pkgs_async_co_gsource_func, _data19_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda22__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda22_ (self));
	block19_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_group_pkgs_async_co (PamacDatabaseGetGroupPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data19_ = g_slice_new0 (Block19Data);
	_data_->_data19_->_ref_count_ = 1;
	_data_->_data19_->self = g_object_ref (_data_->self);
	_data_->_data19_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data19_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = g_strdup (_data_->group_name);
	_data_->_data19_->group_name_copy = _data_->_tmp1_;
	{
		_data_->_tmp2_ = g_thread_try_new ("get_group_pkgs", ____lambda22__gthread_func, block19_data_ref (_data_->_data19_), &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_thread_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		g_warning ("database.vala:1596: %s", _data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _g_ptr_array_ref0 (_data_->_data19_->pkgs);
	_data_->result = _data_->_tmp6_;
	block19_data_unref (_data_->_data19_);
	_data_->_data19_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

PamacAlpmPackage*
pamac_database_get_pkg (PamacDatabase* self,
                        const gchar* pkgname)
{
	PamacAlpmPackage* _tmp1_;
	PamacAlpmPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	if (pamac_database_is_installed_pkg (self, pkgname)) {
		PamacAlpmPackage* _tmp0_;
		_tmp0_ = pamac_database_get_installed_pkg (self, pkgname);
		result = _tmp0_;
		return result;
	}
	_tmp1_ = pamac_database_get_sync_pkg (self, pkgname);
	result = _tmp1_;
	return result;
}

static void
pamac_database_get_pkg_files_real (PamacDatabase* self,
                                   const gchar* pkgname,
                                   alpm_pkg_t* local_pkg,
                                   GPtrArray** files)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	g_return_if_fail (*files != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			if (local_pkg != NULL) {
				alpm_filelist_t* filelist = NULL;
				alpm_filelist_t* _tmp1_;
				alpm_filelist_t* _tmp2_;
				alpm_file_t* file_ptr = NULL;
				alpm_filelist_t* _tmp3_;
				alpm_file_t* _tmp4_;
				_tmp1_ = alpm_pkg_get_files (local_pkg);
				_tmp2_ = _tmp1_;
				filelist = _tmp2_;
				_tmp3_ = filelist;
				_tmp4_ = _tmp3_->files;
				file_ptr = _tmp4_;
				{
					gsize i = 0UL;
					i = (gsize) 0;
					{
						gboolean _tmp5_ = FALSE;
						_tmp5_ = TRUE;
						while (TRUE) {
							alpm_filelist_t* _tmp8_;
							alpm_file_t* _tmp9_;
							const gchar* _tmp10_;
							if (!_tmp5_) {
								gsize _tmp6_;
								alpm_file_t* _tmp7_;
								_tmp6_ = i;
								i = _tmp6_ + 1;
								_tmp7_ = file_ptr;
								file_ptr = _tmp7_ + 1;
							}
							_tmp5_ = FALSE;
							_tmp8_ = filelist;
							if (!(i < _tmp8_->count)) {
								break;
							}
							_tmp9_ = file_ptr;
							_tmp10_ = _tmp9_->name;
							if (!g_str_has_suffix (_tmp10_, "/")) {
								GString* filename = NULL;
								alpm_handle_t* _tmp11_;
								const gchar* _tmp12_;
								const gchar* _tmp13_;
								GString* _tmp14_;
								GString* _tmp15_;
								alpm_file_t* _tmp16_;
								const gchar* _tmp17_;
								GString* _tmp18_;
								gchar* _tmp19_;
								_tmp11_ = self->priv->alpm_handle;
								_tmp12_ = alpm_option_get_root (_tmp11_);
								_tmp13_ = _tmp12_;
								_tmp14_ = g_string_new (_tmp13_);
								filename = _tmp14_;
								_tmp15_ = filename;
								_tmp16_ = file_ptr;
								_tmp17_ = _tmp16_->name;
								g_string_append (_tmp15_, _tmp17_);
								_tmp18_ = filename;
								_tmp19_ = _tmp18_->str;
								_tmp18_->str = NULL;
								g_ptr_array_add (*files, _tmp19_);
								_g_string_free0 (filename);
							}
						}
					}
				}
			} else {
				alpm_list_t* syncdbs = NULL;
				alpm_handle_t* _tmp20_;
				alpm_list_t* _tmp21_;
				alpm_list_t* _tmp22_;
				_tmp20_ = self->priv->files_handle;
				_tmp21_ = alpm_get_syncdbs (_tmp20_);
				_tmp22_ = _tmp21_;
				syncdbs = _tmp22_;
				while (TRUE) {
					alpm_list_t* _tmp23_;
					alpm_db_t* db = NULL;
					alpm_list_t* _tmp24_;
					gconstpointer _tmp25_;
					alpm_pkg_t* files_pkg = NULL;
					alpm_db_t* _tmp26_;
					alpm_pkg_t* _tmp27_;
					alpm_pkg_t* _tmp28_;
					_tmp23_ = syncdbs;
					if (!(_tmp23_ != NULL)) {
						break;
					}
					_tmp24_ = syncdbs;
					_tmp25_ = _tmp24_->data;
					db = (alpm_db_t*) _tmp25_;
					_tmp26_ = db;
					_tmp27_ = alpm_db_get_pkg (_tmp26_, pkgname);
					files_pkg = _tmp27_;
					_tmp28_ = files_pkg;
					if (_tmp28_ != NULL) {
						alpm_filelist_t* filelist = NULL;
						alpm_pkg_t* _tmp29_;
						alpm_filelist_t* _tmp30_;
						alpm_filelist_t* _tmp31_;
						alpm_file_t* file_ptr = NULL;
						alpm_filelist_t* _tmp32_;
						alpm_file_t* _tmp33_;
						_tmp29_ = files_pkg;
						_tmp30_ = alpm_pkg_get_files (_tmp29_);
						_tmp31_ = _tmp30_;
						filelist = _tmp31_;
						_tmp32_ = filelist;
						_tmp33_ = _tmp32_->files;
						file_ptr = _tmp33_;
						{
							gsize i = 0UL;
							i = (gsize) 0;
							{
								gboolean _tmp34_ = FALSE;
								_tmp34_ = TRUE;
								while (TRUE) {
									alpm_filelist_t* _tmp37_;
									alpm_file_t* _tmp38_;
									const gchar* _tmp39_;
									if (!_tmp34_) {
										gsize _tmp35_;
										alpm_file_t* _tmp36_;
										_tmp35_ = i;
										i = _tmp35_ + 1;
										_tmp36_ = file_ptr;
										file_ptr = _tmp36_ + 1;
									}
									_tmp34_ = FALSE;
									_tmp37_ = filelist;
									if (!(i < _tmp37_->count)) {
										break;
									}
									_tmp38_ = file_ptr;
									_tmp39_ = _tmp38_->name;
									if (!g_str_has_suffix (_tmp39_, "/")) {
										GString* filename = NULL;
										alpm_handle_t* _tmp40_;
										const gchar* _tmp41_;
										const gchar* _tmp42_;
										GString* _tmp43_;
										GString* _tmp44_;
										alpm_file_t* _tmp45_;
										const gchar* _tmp46_;
										GString* _tmp47_;
										gchar* _tmp48_;
										_tmp40_ = self->priv->alpm_handle;
										_tmp41_ = alpm_option_get_root (_tmp40_);
										_tmp42_ = _tmp41_;
										_tmp43_ = g_string_new (_tmp42_);
										filename = _tmp43_;
										_tmp44_ = filename;
										_tmp45_ = file_ptr;
										_tmp46_ = _tmp45_->name;
										g_string_append (_tmp44_, _tmp46_);
										_tmp47_ = filename;
										_tmp48_ = _tmp47_->str;
										_tmp47_->str = NULL;
										g_ptr_array_add (*files, _tmp48_);
										_g_string_free0 (filename);
									}
								}
							}
						}
						break;
					}
					syncdbs = alpm_list_next (syncdbs);
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp49_;
			_tmp49_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GPtrArray*
pamac_database_get_pkg_files (PamacDatabase* self,
                              const gchar* pkgname,
                              alpm_pkg_t* local_pkg)
{
	GPtrArray* files = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	files = _tmp0_;
	pamac_database_get_pkg_files_real (self, pkgname, local_pkg, &files);
	result = files;
	return result;
}

static void
pamac_database_get_pkg_files_async_data_free (gpointer _data)
{
	PamacDatabaseGetPkgFilesAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetPkgFilesAsyncData, _data_);
}

void
pamac_database_get_pkg_files_async (PamacDatabase* self,
                                    const gchar* pkgname,
                                    alpm_pkg_t* local_pkg,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	PamacDatabaseGetPkgFilesAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetPkgFilesAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_pkg_files_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (pkgname);
	_g_free0 (_data_->pkgname);
	_data_->pkgname = _tmp1_;
	_data_->local_pkg = local_pkg;
	pamac_database_get_pkg_files_async_co (_data_);
}

GPtrArray*
pamac_database_get_pkg_files_finish (PamacDatabase* self,
                                     GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetPkgFilesAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block20Data*
block20_data_ref (Block20Data* _data20_)
{
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}

static void
block20_data_unref (void * _userdata_)
{
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		PamacDatabase* self;
		self = _data20_->self;
		_g_ptr_array_unref0 (_data20_->files);
		_g_free0 (_data20_->pkgname);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}

static gboolean
_pamac_database_get_pkg_files_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_pkg_files_async_co (self);
	return result;
}

static gint
___lambda4_ (Block20Data* _data20_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data20_->self;
	pamac_database_get_pkg_files_real (self, _data20_->pkgname, _data20_->local_pkg, &_data20_->files);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_pkg_files_async_co_gsource_func, _data20_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda4__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda4_ (self));
	block20_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_pkg_files_async_co (PamacDatabaseGetPkgFilesAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data20_ = g_slice_new0 (Block20Data);
	_data_->_data20_->_ref_count_ = 1;
	_data_->_data20_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data20_->pkgname);
	_data_->_data20_->pkgname = _data_->pkgname;
	_data_->_data20_->local_pkg = _data_->local_pkg;
	_data_->_data20_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	_data_->_data20_->files = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_pkg_files", ____lambda4__gthread_func, block20_data_ref (_data_->_data20_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:1659: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block20_data_unref (_data_->_data20_);
		_data_->_data20_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_ptr_array_ref0 (_data_->_data20_->files);
	_data_->result = _data_->_tmp5_;
	block20_data_unref (_data_->_data20_);
	_data_->_data20_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gint
pamac_database_launch_subprocess (PamacDatabase* self,
                                  GSubprocessLauncher* launcher,
                                  GPtrArray* cmdline,
                                  GCancellable* cancellable)
{
	gint status = 0;
	GError* _inner_error0_ = NULL;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (launcher != NULL, 0);
	g_return_val_if_fail (cmdline != NULL, 0);
	status = 1;
	{
		gint _tmp0_;
		gint _tmp1_;
		GSubprocess* process = NULL;
		gpointer* _tmp2_;
		gint _tmp2__length1;
		GSubprocess* _tmp3_;
		_tmp0_ = vala_g_ptr_array_get_length (cmdline);
		_tmp1_ = _tmp0_;
		g_ptr_array_set_size (cmdline, _tmp1_ + 1);
		_tmp2_ = cmdline->pdata;
		_tmp2__length1 = cmdline->len;
		_tmp3_ = g_subprocess_launcher_spawnv (launcher, _tmp2_, &_inner_error0_);
		process = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		{
			GSubprocess* _tmp4_;
			GSubprocess* _tmp5_;
			_tmp4_ = process;
			g_subprocess_wait (_tmp4_, cancellable, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			_tmp5_ = process;
			if (g_subprocess_get_if_exited (_tmp5_)) {
				GSubprocess* _tmp6_;
				_tmp6_ = process;
				status = g_subprocess_get_exit_status (_tmp6_);
			}
		}
		goto __finally1;
		__catch1_g_error:
		{
			GSubprocess* _tmp7_;
			GSubprocess* _tmp8_;
			g_clear_error (&_inner_error0_);
			_tmp7_ = process;
			g_subprocess_send_signal (_tmp7_, (gint) SIGINT);
			_tmp8_ = process;
			g_subprocess_send_signal (_tmp8_, (gint) SIGKILL);
			result = 1;
			_g_object_unref0 (process);
			return result;
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (process);
			goto __catch0_g_error;
		}
		_g_object_unref0 (process);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		g_warning ("database.vala:1682: %s", _tmp10_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gint _tmp11_ = -1;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp11_;
	}
	result = status;
	return result;
}

static gpointer
_g_strdup_gcopy_func (gconstpointer src,
                      gpointer self)
{
	gpointer result;
	result = g_strdup ((const gchar*) src);
	return result;
}

GFile*
pamac_database_clone_build_files (PamacDatabase* self,
                                  const gchar* pkgname,
                                  gboolean overwrite_files,
                                  GCancellable* cancellable)
{
	gint status = 0;
	GPtrArray* cmdline = NULL;
	GSubprocessLauncher* launcher = NULL;
	GSubprocessLauncher* _tmp0_;
	const gchar* real_aur_build_dir = NULL;
	const gchar* _tmp1_;
	GFile* builddir = NULL;
	const gchar* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GPtrArray* dynamic_user_cmdline = NULL;
	const gchar* _tmp8_;
	GPtrArray* _tmp9_;
	GFile* pkgdir = NULL;
	GFile* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GSubprocessLauncher* _tmp156_;
	GPtrArray* _tmp157_;
	GError* _inner_error0_ = NULL;
	GFile* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	status = 1;
	_tmp0_ = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
	launcher = _tmp0_;
	_tmp1_ = pamac_database_get_real_aur_build_dir (self);
	real_aur_build_dir = _tmp1_;
	_tmp2_ = real_aur_build_dir;
	_tmp3_ = g_file_new_for_path (_tmp2_);
	builddir = _tmp3_;
	_tmp4_ = builddir;
	if (!g_file_query_exists (_tmp4_, NULL)) {
		{
			GFile* _tmp5_;
			_tmp5_ = builddir;
			g_file_make_directory_with_parents (_tmp5_, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp6_;
			const gchar* _tmp7_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp6_ = e;
			_tmp7_ = _tmp6_->message;
			g_warning ("database.vala:1697: %s", _tmp7_);
			result = NULL;
			_g_error_free0 (e);
			_g_object_unref0 (builddir);
			_g_object_unref0 (launcher);
			_g_ptr_array_unref0 (cmdline);
			return result;
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (builddir);
			_g_object_unref0 (launcher);
			_g_ptr_array_unref0 (cmdline);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp8_ = real_aur_build_dir;
	_tmp9_ = pamac_database_get_dynamic_user_cmdline (self, _tmp8_);
	dynamic_user_cmdline = _tmp9_;
	_tmp10_ = builddir;
	_tmp11_ = g_file_get_child (_tmp10_, pkgname);
	pkgdir = _tmp11_;
	_tmp12_ = pkgdir;
	if (g_file_query_exists (_tmp12_, NULL)) {
		if (overwrite_files) {
			GSubprocessLauncher* _tmp13_;
			const gchar* _tmp14_;
			GPtrArray* _tmp15_;
			GPtrArray* _tmp16_;
			GPtrArray* _tmp17_;
			gchar* _tmp18_;
			GPtrArray* _tmp19_;
			gchar* _tmp20_;
			GPtrArray* _tmp21_;
			GFile* _tmp22_;
			gchar* _tmp23_;
			GSubprocessLauncher* _tmp24_;
			GPtrArray* _tmp25_;
			GPtrArray* _tmp26_;
			GPtrArray* _tmp27_;
			GPtrArray* _tmp28_;
			gchar* _tmp29_;
			GPtrArray* _tmp30_;
			gchar* _tmp31_;
			GPtrArray* _tmp32_;
			gchar* _tmp33_;
			GPtrArray* _tmp34_;
			gchar* _tmp35_;
			GPtrArray* _tmp36_;
			gchar* _tmp37_;
			_tmp13_ = launcher;
			_tmp14_ = real_aur_build_dir;
			g_subprocess_launcher_set_cwd (_tmp13_, _tmp14_);
			_tmp15_ = dynamic_user_cmdline;
			_tmp16_ = g_ptr_array_copy (_tmp15_, _g_strdup_gcopy_func, NULL);
			_g_ptr_array_unref0 (cmdline);
			cmdline = _tmp16_;
			_tmp17_ = cmdline;
			_tmp18_ = g_strdup ("rm");
			g_ptr_array_add (_tmp17_, _tmp18_);
			_tmp19_ = cmdline;
			_tmp20_ = g_strdup ("-rf");
			g_ptr_array_add (_tmp19_, _tmp20_);
			_tmp21_ = cmdline;
			_tmp22_ = pkgdir;
			_tmp23_ = g_file_get_path (_tmp22_);
			g_ptr_array_add (_tmp21_, _tmp23_);
			_tmp24_ = launcher;
			_tmp25_ = cmdline;
			pamac_database_launch_subprocess (self, _tmp24_, _tmp25_, NULL);
			_tmp26_ = dynamic_user_cmdline;
			_tmp27_ = _g_ptr_array_ref0 (_tmp26_);
			_g_ptr_array_unref0 (cmdline);
			cmdline = _tmp27_;
			_tmp28_ = cmdline;
			_tmp29_ = g_strdup ("git");
			g_ptr_array_add (_tmp28_, _tmp29_);
			_tmp30_ = cmdline;
			_tmp31_ = g_strdup ("clone");
			g_ptr_array_add (_tmp30_, _tmp31_);
			_tmp32_ = cmdline;
			_tmp33_ = g_strdup ("-q");
			g_ptr_array_add (_tmp32_, _tmp33_);
			_tmp34_ = cmdline;
			_tmp35_ = g_strdup ("--depth=1");
			g_ptr_array_add (_tmp34_, _tmp35_);
			_tmp36_ = cmdline;
			_tmp37_ = g_strdup_printf ("https://aur.archlinux.org/%s.git", pkgname);
			g_ptr_array_add (_tmp36_, _tmp37_);
		} else {
			gchar* cwd = NULL;
			GFile* _tmp38_;
			gchar* _tmp39_;
			GSubprocessLauncher* _tmp40_;
			const gchar* _tmp41_;
			GPtrArray* _tmp42_;
			GPtrArray* _tmp43_;
			GPtrArray* _tmp44_;
			gchar* _tmp45_;
			GPtrArray* _tmp46_;
			gchar* _tmp47_;
			GPtrArray* _tmp48_;
			gchar* _tmp49_;
			GSubprocessLauncher* _tmp50_;
			GPtrArray* _tmp51_;
			_tmp38_ = pkgdir;
			_tmp39_ = g_file_get_path (_tmp38_);
			cwd = _tmp39_;
			_tmp40_ = launcher;
			_tmp41_ = cwd;
			g_subprocess_launcher_set_cwd (_tmp40_, _tmp41_);
			_tmp42_ = dynamic_user_cmdline;
			_tmp43_ = g_ptr_array_copy (_tmp42_, _g_strdup_gcopy_func, NULL);
			_g_ptr_array_unref0 (cmdline);
			cmdline = _tmp43_;
			_tmp44_ = cmdline;
			_tmp45_ = g_strdup ("git");
			g_ptr_array_add (_tmp44_, _tmp45_);
			_tmp46_ = cmdline;
			_tmp47_ = g_strdup ("fetch");
			g_ptr_array_add (_tmp46_, _tmp47_);
			_tmp48_ = cmdline;
			_tmp49_ = g_strdup ("-q");
			g_ptr_array_add (_tmp48_, _tmp49_);
			_tmp50_ = launcher;
			_tmp51_ = cmdline;
			status = pamac_database_launch_subprocess (self, _tmp50_, _tmp51_, cancellable);
			if (g_cancellable_is_cancelled (cancellable)) {
				result = NULL;
				_g_free0 (cwd);
				_g_object_unref0 (pkgdir);
				_g_ptr_array_unref0 (dynamic_user_cmdline);
				_g_object_unref0 (builddir);
				_g_object_unref0 (launcher);
				_g_ptr_array_unref0 (cmdline);
				return result;
			}
			if (status == 0) {
				GSubprocessLauncher* _tmp52_;
				GSubprocessLauncher* _tmp105_;
				_tmp52_ = launcher;
				g_subprocess_launcher_set_flags (_tmp52_, G_SUBPROCESS_FLAGS_STDOUT_PIPE);
				{
					GFile* file = NULL;
					const gchar* _tmp53_;
					gchar* _tmp54_;
					gchar* _tmp55_;
					GFile* _tmp56_;
					GFile* _tmp57_;
					GFile* _tmp58_;
					GPtrArray* _tmp60_;
					GPtrArray* _tmp61_;
					GPtrArray* _tmp62_;
					gchar* _tmp63_;
					GPtrArray* _tmp64_;
					gchar* _tmp65_;
					GPtrArray* _tmp66_;
					gchar* _tmp67_;
					GPtrArray* _tmp68_;
					gchar* _tmp69_;
					GFileEnumerator* enumerator = NULL;
					GFile* _tmp70_;
					GFileEnumerator* _tmp71_;
					GFileInfo* info = NULL;
					GPtrArray* _tmp83_;
					GPtrArray* _tmp84_;
					gint _tmp85_;
					gint _tmp86_;
					GSubprocess* process = NULL;
					GSubprocessLauncher* _tmp87_;
					GPtrArray* _tmp88_;
					gpointer* _tmp89_;
					gint _tmp89__length1;
					GSubprocess* _tmp90_;
					GSubprocess* _tmp91_;
					GSubprocess* _tmp92_;
					_tmp53_ = cwd;
					_tmp54_ = g_build_filename (_tmp53_, "diff", NULL);
					_tmp55_ = _tmp54_;
					_tmp56_ = g_file_new_for_path (_tmp55_);
					_tmp57_ = _tmp56_;
					_g_free0 (_tmp55_);
					file = _tmp57_;
					_tmp58_ = file;
					if (g_file_query_exists (_tmp58_, NULL)) {
						GFile* _tmp59_;
						_tmp59_ = file;
						g_file_delete (_tmp59_, NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (file);
							goto __catch1_g_error;
						}
					}
					_tmp60_ = dynamic_user_cmdline;
					_tmp61_ = g_ptr_array_copy (_tmp60_, _g_strdup_gcopy_func, NULL);
					_g_ptr_array_unref0 (cmdline);
					cmdline = _tmp61_;
					_tmp62_ = cmdline;
					_tmp63_ = g_strdup ("git");
					g_ptr_array_add (_tmp62_, _tmp63_);
					_tmp64_ = cmdline;
					_tmp65_ = g_strdup ("diff");
					g_ptr_array_add (_tmp64_, _tmp65_);
					_tmp66_ = cmdline;
					_tmp67_ = g_strdup ("--exit-code");
					g_ptr_array_add (_tmp66_, _tmp67_);
					_tmp68_ = cmdline;
					_tmp69_ = g_strdup ("origin/master");
					g_ptr_array_add (_tmp68_, _tmp69_);
					_tmp70_ = pkgdir;
					_tmp71_ = g_file_enumerate_children (_tmp70_, "standard::*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
					enumerator = _tmp71_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (file);
						goto __catch1_g_error;
					}
					while (TRUE) {
						GFileInfo* _tmp72_ = NULL;
						GFileEnumerator* _tmp73_;
						GFileInfo* _tmp74_;
						GFileInfo* _tmp75_;
						GFileInfo* _tmp76_;
						const gchar* filename = NULL;
						GFileInfo* _tmp77_;
						const gchar* _tmp78_;
						const gchar* _tmp79_;
						_tmp73_ = enumerator;
						_tmp74_ = g_file_enumerator_next_file (_tmp73_, NULL, &_inner_error0_);
						_tmp72_ = _tmp74_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (info);
							_g_object_unref0 (enumerator);
							_g_object_unref0 (file);
							goto __catch1_g_error;
						}
						_tmp75_ = _tmp72_;
						_tmp72_ = NULL;
						_g_object_unref0 (info);
						info = _tmp75_;
						_tmp76_ = info;
						if (!(_tmp76_ != NULL)) {
							_g_object_unref0 (_tmp72_);
							break;
						}
						_tmp77_ = info;
						_tmp78_ = g_file_info_get_name (_tmp77_);
						filename = _tmp78_;
						_tmp79_ = filename;
						if (g_strcmp0 (_tmp79_, ".SRCINFO") != 0) {
							GPtrArray* _tmp80_;
							const gchar* _tmp81_;
							gchar* _tmp82_;
							_tmp80_ = cmdline;
							_tmp81_ = filename;
							_tmp82_ = g_strdup (_tmp81_);
							g_ptr_array_add (_tmp80_, _tmp82_);
						}
						_g_object_unref0 (_tmp72_);
					}
					_tmp83_ = cmdline;
					_tmp84_ = cmdline;
					_tmp85_ = vala_g_ptr_array_get_length (_tmp84_);
					_tmp86_ = _tmp85_;
					g_ptr_array_set_size (_tmp83_, _tmp86_ + 1);
					_tmp87_ = launcher;
					_tmp88_ = cmdline;
					_tmp89_ = _tmp88_->pdata;
					_tmp89__length1 = _tmp88_->len;
					_tmp90_ = g_subprocess_launcher_spawnv (_tmp87_, _tmp89_, &_inner_error0_);
					process = _tmp90_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (info);
						_g_object_unref0 (enumerator);
						_g_object_unref0 (file);
						goto __catch1_g_error;
					}
					_tmp91_ = process;
					g_subprocess_wait (_tmp91_, NULL, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (process);
						_g_object_unref0 (info);
						_g_object_unref0 (enumerator);
						_g_object_unref0 (file);
						goto __catch1_g_error;
					}
					_tmp92_ = process;
					if (g_subprocess_get_if_exited (_tmp92_)) {
						GSubprocess* _tmp93_;
						_tmp93_ = process;
						status = g_subprocess_get_exit_status (_tmp93_);
					}
					if (status == 1) {
						GDataInputStream* dis = NULL;
						GSubprocess* _tmp94_;
						GInputStream* _tmp95_;
						GDataInputStream* _tmp96_;
						GFileOutputStream* _tmp97_ = NULL;
						GFile* _tmp98_;
						GFileOutputStream* _tmp99_;
						GDataOutputStream* dos = NULL;
						GDataOutputStream* _tmp100_;
						GDataOutputStream* _tmp101_;
						GDataInputStream* _tmp102_;
						_tmp94_ = process;
						_tmp95_ = g_subprocess_get_stdout_pipe (_tmp94_);
						_tmp96_ = g_data_input_stream_new (_tmp95_);
						dis = _tmp96_;
						_tmp98_ = file;
						_tmp99_ = g_file_create (_tmp98_, G_FILE_CREATE_NONE, NULL, &_inner_error0_);
						_tmp97_ = _tmp99_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (dis);
							_g_object_unref0 (process);
							_g_object_unref0 (info);
							_g_object_unref0 (enumerator);
							_g_object_unref0 (file);
							goto __catch1_g_error;
						}
						_tmp100_ = g_data_output_stream_new ((GOutputStream*) _tmp97_);
						dos = _tmp100_;
						_tmp101_ = dos;
						_tmp102_ = dis;
						g_output_stream_splice ((GOutputStream*) _tmp101_, (GInputStream*) _tmp102_, G_OUTPUT_STREAM_SPLICE_NONE, NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (dos);
							_g_object_unref0 (_tmp97_);
							_g_object_unref0 (dis);
							_g_object_unref0 (process);
							_g_object_unref0 (info);
							_g_object_unref0 (enumerator);
							_g_object_unref0 (file);
							goto __catch1_g_error;
						}
						status = 0;
						_g_object_unref0 (dos);
						_g_object_unref0 (_tmp97_);
						_g_object_unref0 (dis);
					}
					_g_object_unref0 (process);
					_g_object_unref0 (info);
					_g_object_unref0 (enumerator);
					_g_object_unref0 (file);
				}
				goto __finally1;
				__catch1_g_error:
				{
					GError* e = NULL;
					GError* _tmp103_;
					const gchar* _tmp104_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp103_ = e;
					_tmp104_ = _tmp103_->message;
					g_warning ("database.vala:1768: %s", _tmp104_);
					_g_error_free0 (e);
				}
				__finally1:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (cwd);
					_g_object_unref0 (pkgdir);
					_g_ptr_array_unref0 (dynamic_user_cmdline);
					_g_object_unref0 (builddir);
					_g_object_unref0 (launcher);
					_g_ptr_array_unref0 (cmdline);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp105_ = launcher;
				g_subprocess_launcher_set_flags (_tmp105_, G_SUBPROCESS_FLAGS_NONE);
			}
			if (status == 0) {
				GSubprocessLauncher* _tmp106_;
				GPtrArray* _tmp107_;
				GPtrArray* _tmp108_;
				GPtrArray* _tmp109_;
				gchar* _tmp110_;
				GPtrArray* _tmp111_;
				gchar* _tmp112_;
				GPtrArray* _tmp113_;
				gchar* _tmp114_;
				GSubprocessLauncher* _tmp115_;
				GPtrArray* _tmp116_;
				_tmp106_ = launcher;
				g_subprocess_launcher_set_flags (_tmp106_, G_SUBPROCESS_FLAGS_STDOUT_SILENCE | G_SUBPROCESS_FLAGS_STDERR_SILENCE);
				_tmp107_ = dynamic_user_cmdline;
				_tmp108_ = g_ptr_array_copy (_tmp107_, _g_strdup_gcopy_func, NULL);
				_g_ptr_array_unref0 (cmdline);
				cmdline = _tmp108_;
				_tmp109_ = cmdline;
				_tmp110_ = g_strdup ("git");
				g_ptr_array_add (_tmp109_, _tmp110_);
				_tmp111_ = cmdline;
				_tmp112_ = g_strdup ("merge");
				g_ptr_array_add (_tmp111_, _tmp112_);
				_tmp113_ = cmdline;
				_tmp114_ = g_strdup ("-q");
				g_ptr_array_add (_tmp113_, _tmp114_);
				_tmp115_ = launcher;
				_tmp116_ = cmdline;
				status = pamac_database_launch_subprocess (self, _tmp115_, _tmp116_, NULL);
			}
			if (status == 0) {
				result = pkgdir;
				_g_free0 (cwd);
				_g_ptr_array_unref0 (dynamic_user_cmdline);
				_g_object_unref0 (builddir);
				_g_object_unref0 (launcher);
				_g_ptr_array_unref0 (cmdline);
				return result;
			} else {
				GSubprocessLauncher* _tmp117_;
				const gchar* _tmp118_;
				GPtrArray* _tmp119_;
				GPtrArray* _tmp120_;
				GPtrArray* _tmp121_;
				gchar* _tmp122_;
				GPtrArray* _tmp123_;
				gchar* _tmp124_;
				GPtrArray* _tmp125_;
				GFile* _tmp126_;
				gchar* _tmp127_;
				GSubprocessLauncher* _tmp128_;
				GPtrArray* _tmp129_;
				GPtrArray* _tmp130_;
				GPtrArray* _tmp131_;
				GPtrArray* _tmp132_;
				gchar* _tmp133_;
				GPtrArray* _tmp134_;
				gchar* _tmp135_;
				GPtrArray* _tmp136_;
				gchar* _tmp137_;
				GPtrArray* _tmp138_;
				gchar* _tmp139_;
				GPtrArray* _tmp140_;
				gchar* _tmp141_;
				_tmp117_ = launcher;
				_tmp118_ = real_aur_build_dir;
				g_subprocess_launcher_set_cwd (_tmp117_, _tmp118_);
				_tmp119_ = dynamic_user_cmdline;
				_tmp120_ = g_ptr_array_copy (_tmp119_, _g_strdup_gcopy_func, NULL);
				_g_ptr_array_unref0 (cmdline);
				cmdline = _tmp120_;
				_tmp121_ = cmdline;
				_tmp122_ = g_strdup ("rm");
				g_ptr_array_add (_tmp121_, _tmp122_);
				_tmp123_ = cmdline;
				_tmp124_ = g_strdup ("-rf");
				g_ptr_array_add (_tmp123_, _tmp124_);
				_tmp125_ = cmdline;
				_tmp126_ = pkgdir;
				_tmp127_ = g_file_get_path (_tmp126_);
				g_ptr_array_add (_tmp125_, _tmp127_);
				_tmp128_ = launcher;
				_tmp129_ = cmdline;
				pamac_database_launch_subprocess (self, _tmp128_, _tmp129_, NULL);
				_tmp130_ = dynamic_user_cmdline;
				_tmp131_ = _g_ptr_array_ref0 (_tmp130_);
				_g_ptr_array_unref0 (cmdline);
				cmdline = _tmp131_;
				_tmp132_ = cmdline;
				_tmp133_ = g_strdup ("git");
				g_ptr_array_add (_tmp132_, _tmp133_);
				_tmp134_ = cmdline;
				_tmp135_ = g_strdup ("clone");
				g_ptr_array_add (_tmp134_, _tmp135_);
				_tmp136_ = cmdline;
				_tmp137_ = g_strdup ("-q");
				g_ptr_array_add (_tmp136_, _tmp137_);
				_tmp138_ = cmdline;
				_tmp139_ = g_strdup ("--depth=1");
				g_ptr_array_add (_tmp138_, _tmp139_);
				_tmp140_ = cmdline;
				_tmp141_ = g_strdup_printf ("https://aur.archlinux.org/%s.git", pkgname);
				g_ptr_array_add (_tmp140_, _tmp141_);
			}
			_g_free0 (cwd);
		}
	} else {
		GSubprocessLauncher* _tmp142_;
		const gchar* _tmp143_;
		GPtrArray* _tmp144_;
		GPtrArray* _tmp145_;
		GPtrArray* _tmp146_;
		gchar* _tmp147_;
		GPtrArray* _tmp148_;
		gchar* _tmp149_;
		GPtrArray* _tmp150_;
		gchar* _tmp151_;
		GPtrArray* _tmp152_;
		gchar* _tmp153_;
		GPtrArray* _tmp154_;
		gchar* _tmp155_;
		_tmp142_ = launcher;
		_tmp143_ = real_aur_build_dir;
		g_subprocess_launcher_set_cwd (_tmp142_, _tmp143_);
		_tmp144_ = dynamic_user_cmdline;
		_tmp145_ = _g_ptr_array_ref0 (_tmp144_);
		_g_ptr_array_unref0 (cmdline);
		cmdline = _tmp145_;
		_tmp146_ = cmdline;
		_tmp147_ = g_strdup ("git");
		g_ptr_array_add (_tmp146_, _tmp147_);
		_tmp148_ = cmdline;
		_tmp149_ = g_strdup ("clone");
		g_ptr_array_add (_tmp148_, _tmp149_);
		_tmp150_ = cmdline;
		_tmp151_ = g_strdup ("-q");
		g_ptr_array_add (_tmp150_, _tmp151_);
		_tmp152_ = cmdline;
		_tmp153_ = g_strdup ("--depth=1");
		g_ptr_array_add (_tmp152_, _tmp153_);
		_tmp154_ = cmdline;
		_tmp155_ = g_strdup_printf ("https://aur.archlinux.org/%s.git", pkgname);
		g_ptr_array_add (_tmp154_, _tmp155_);
	}
	_tmp156_ = launcher;
	_tmp157_ = cmdline;
	status = pamac_database_launch_subprocess (self, _tmp156_, _tmp157_, cancellable);
	if (status == 0) {
		result = pkgdir;
		_g_ptr_array_unref0 (dynamic_user_cmdline);
		_g_object_unref0 (builddir);
		_g_object_unref0 (launcher);
		_g_ptr_array_unref0 (cmdline);
		return result;
	}
	result = NULL;
	_g_object_unref0 (pkgdir);
	_g_ptr_array_unref0 (dynamic_user_cmdline);
	_g_object_unref0 (builddir);
	_g_object_unref0 (launcher);
	_g_ptr_array_unref0 (cmdline);
	return result;
}

static void
pamac_database_clone_build_files_async_data_free (gpointer _data)
{
	PamacDatabaseCloneBuildFilesAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->pkgname);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseCloneBuildFilesAsyncData, _data_);
}

void
pamac_database_clone_build_files_async (PamacDatabase* self,
                                        const gchar* pkgname,
                                        gboolean overwrite_files,
                                        GCancellable* cancellable,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	PamacDatabaseCloneBuildFilesAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	_data_ = g_slice_new0 (PamacDatabaseCloneBuildFilesAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_clone_build_files_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (pkgname);
	_g_free0 (_data_->pkgname);
	_data_->pkgname = _tmp1_;
	_data_->overwrite_files = overwrite_files;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	pamac_database_clone_build_files_async_co (_data_);
}

GFile*
pamac_database_clone_build_files_finish (PamacDatabase* self,
                                         GAsyncResult* _res_)
{
	GFile* result;
	PamacDatabaseCloneBuildFilesAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		PamacDatabase* self;
		self = _data21_->self;
		_g_free0 (_data21_->pkgname_copy);
		_g_object_unref0 (_data21_->file);
		_g_object_unref0 (_data21_->cancellable);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}

static gboolean
_pamac_database_clone_build_files_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_clone_build_files_async_co (self);
	return result;
}

static gint
___lambda23_ (Block21Data* _data21_)
{
	PamacDatabase* self;
	GFile* _tmp0_;
	GMainContext* _tmp1_;
	gint result;
	self = _data21_->self;
	_tmp0_ = pamac_database_clone_build_files (self, _data21_->pkgname_copy, _data21_->overwrite_files, _data21_->cancellable);
	_g_object_unref0 (_data21_->file);
	_data21_->file = _tmp0_;
	_tmp1_ = self->priv->_context;
	g_main_context_invoke_full (_tmp1_, G_PRIORITY_DEFAULT, _pamac_database_clone_build_files_async_co_gsource_func, _data21_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda23__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda23_ (self));
	block21_data_unref (self);
	return result;
}

static gboolean
pamac_database_clone_build_files_async_co (PamacDatabaseCloneBuildFilesAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data21_ = g_slice_new0 (Block21Data);
	_data_->_data21_->_ref_count_ = 1;
	_data_->_data21_->self = g_object_ref (_data_->self);
	_data_->_data21_->overwrite_files = _data_->overwrite_files;
	_g_object_unref0 (_data_->_data21_->cancellable);
	_data_->_data21_->cancellable = _data_->cancellable;
	_data_->_data21_->_async_data_ = _data_;
	_data_->_data21_->file = NULL;
	_data_->_tmp0_ = g_strdup (_data_->pkgname);
	_data_->_data21_->pkgname_copy = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("clone_build_files", ____lambda23__gthread_func, block21_data_ref (_data_->_data21_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:1825: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block21_data_unref (_data_->_data21_);
		_data_->_data21_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_object_ref0 (_data_->_data21_->file);
	_data_->result = _data_->_tmp5_;
	block21_data_unref (_data_->_data21_);
	_data_->_data21_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static GPtrArray*
pamac_database_get_dynamic_user_cmdline (PamacDatabase* self,
                                         const gchar* cwd)
{
	GPtrArray* cmdline = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (cwd != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
	cmdline = _tmp0_;
	if (geteuid () == ((uid_t) 0)) {
		GPtrArray* _tmp1_;
		gchar* _tmp2_;
		GPtrArray* _tmp3_;
		gchar* _tmp4_;
		GPtrArray* _tmp5_;
		gchar* _tmp6_;
		GPtrArray* _tmp7_;
		gchar* _tmp8_;
		GPtrArray* _tmp9_;
		gchar* _tmp10_;
		GPtrArray* _tmp11_;
		gchar* _tmp12_;
		GPtrArray* _tmp13_;
		gchar* _tmp14_;
		GPtrArray* _tmp15_;
		gchar* _tmp16_;
		_tmp1_ = cmdline;
		_tmp2_ = g_strdup ("systemd-run");
		g_ptr_array_add (_tmp1_, _tmp2_);
		_tmp3_ = cmdline;
		_tmp4_ = g_strdup ("--service-type=oneshot");
		g_ptr_array_add (_tmp3_, _tmp4_);
		_tmp5_ = cmdline;
		_tmp6_ = g_strdup ("--pipe");
		g_ptr_array_add (_tmp5_, _tmp6_);
		_tmp7_ = cmdline;
		_tmp8_ = g_strdup ("--wait");
		g_ptr_array_add (_tmp7_, _tmp8_);
		_tmp9_ = cmdline;
		_tmp10_ = g_strdup ("--pty");
		g_ptr_array_add (_tmp9_, _tmp10_);
		_tmp11_ = cmdline;
		_tmp12_ = g_strdup ("--property=DynamicUser=yes");
		g_ptr_array_add (_tmp11_, _tmp12_);
		_tmp13_ = cmdline;
		_tmp14_ = g_strdup ("--property=CacheDirectory=pamac");
		g_ptr_array_add (_tmp13_, _tmp14_);
		_tmp15_ = cmdline;
		_tmp16_ = g_strdup_printf ("--property=WorkingDirectory=%s", cwd);
		g_ptr_array_add (_tmp15_, _tmp16_);
	}
	result = cmdline;
	return result;
}

gboolean
pamac_database_regenerate_srcinfo (PamacDatabase* self,
                                   const gchar* pkgname,
                                   GCancellable* cancellable)
{
	const gchar* real_aur_build_dir = NULL;
	const gchar* _tmp0_;
	gchar* pkgdir_name = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GFile* srcinfo = NULL;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GFile* _tmp6_;
	GFile* _tmp7_;
	GFile* pkgbuild = NULL;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GFile* _tmp13_;
	GSubprocessLauncher* launcher = NULL;
	GSubprocessLauncher* _tmp29_;
	GSubprocessLauncher* _tmp30_;
	const gchar* _tmp31_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pkgname != NULL, FALSE);
	_tmp0_ = pamac_database_get_real_aur_build_dir (self);
	real_aur_build_dir = _tmp0_;
	_tmp1_ = real_aur_build_dir;
	_tmp2_ = g_build_filename (_tmp1_, pkgname, NULL);
	pkgdir_name = _tmp2_;
	_tmp3_ = pkgdir_name;
	_tmp4_ = g_build_filename (_tmp3_, ".SRCINFO", NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_file_new_for_path (_tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	srcinfo = _tmp7_;
	_tmp8_ = pkgdir_name;
	_tmp9_ = g_build_filename (_tmp8_, "PKGBUILD", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_file_new_for_path (_tmp10_);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	pkgbuild = _tmp12_;
	_tmp13_ = srcinfo;
	if (g_file_query_exists (_tmp13_, NULL)) {
		{
			GFileInfo* info = NULL;
			GFile* _tmp14_;
			GFileInfo* _tmp15_;
			GDateTime* srcinfo_time = NULL;
			GFileInfo* _tmp16_;
			GDateTime* _tmp17_;
			GFileInfo* _tmp18_ = NULL;
			GFile* _tmp19_;
			GFileInfo* _tmp20_;
			GFileInfo* _tmp21_;
			GDateTime* pkgbuild_time = NULL;
			GFileInfo* _tmp22_;
			GDateTime* _tmp23_;
			GDateTime* _tmp24_;
			GDateTime* _tmp25_;
			_tmp14_ = srcinfo;
			_tmp15_ = g_file_query_info (_tmp14_, "time::modified", 0, NULL, &_inner_error0_);
			info = _tmp15_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp16_ = info;
			_tmp17_ = g_file_info_get_modification_date_time (_tmp16_);
			srcinfo_time = _tmp17_;
			_tmp19_ = pkgbuild;
			_tmp20_ = g_file_query_info (_tmp19_, "time::modified", 0, NULL, &_inner_error0_);
			_tmp18_ = _tmp20_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_date_time_unref0 (srcinfo_time);
				_g_object_unref0 (info);
				goto __catch0_g_error;
			}
			_tmp21_ = _tmp18_;
			_tmp18_ = NULL;
			_g_object_unref0 (info);
			info = _tmp21_;
			_tmp22_ = info;
			_tmp23_ = g_file_info_get_modification_date_time (_tmp22_);
			pkgbuild_time = _tmp23_;
			_tmp24_ = srcinfo_time;
			_tmp25_ = pkgbuild_time;
			if (g_date_time_compare (_tmp24_, _tmp25_) == 1) {
				result = TRUE;
				_g_date_time_unref0 (pkgbuild_time);
				_g_object_unref0 (_tmp18_);
				_g_date_time_unref0 (srcinfo_time);
				_g_object_unref0 (info);
				_g_object_unref0 (pkgbuild);
				_g_object_unref0 (srcinfo);
				_g_free0 (pkgdir_name);
				return result;
			}
			_g_date_time_unref0 (pkgbuild_time);
			_g_object_unref0 (_tmp18_);
			_g_date_time_unref0 (srcinfo_time);
			_g_object_unref0 (info);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp26_;
			const gchar* _tmp27_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp26_ = e;
			_tmp27_ = _tmp26_->message;
			g_warning ("database.vala:1862: %s", _tmp27_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp28_ = FALSE;
			_g_object_unref0 (pkgbuild);
			_g_object_unref0 (srcinfo);
			_g_free0 (pkgdir_name);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp28_;
		}
	}
	_tmp29_ = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE);
	launcher = _tmp29_;
	_tmp30_ = launcher;
	_tmp31_ = pkgdir_name;
	g_subprocess_launcher_set_cwd (_tmp30_, _tmp31_);
	{
		GPtrArray* cmdline = NULL;
		const gchar* _tmp32_;
		GPtrArray* _tmp33_;
		GPtrArray* _tmp34_;
		gchar* _tmp35_;
		GPtrArray* _tmp36_;
		gchar* _tmp37_;
		GPtrArray* _tmp38_;
		GPtrArray* _tmp39_;
		gint _tmp40_;
		gint _tmp41_;
		GSubprocess* process = NULL;
		GSubprocessLauncher* _tmp42_;
		GPtrArray* _tmp43_;
		gpointer* _tmp44_;
		gint _tmp44__length1;
		GSubprocess* _tmp45_;
		_tmp32_ = pkgdir_name;
		_tmp33_ = pamac_database_get_dynamic_user_cmdline (self, _tmp32_);
		cmdline = _tmp33_;
		_tmp34_ = cmdline;
		_tmp35_ = g_strdup ("makepkg");
		g_ptr_array_add (_tmp34_, _tmp35_);
		_tmp36_ = cmdline;
		_tmp37_ = g_strdup ("--printsrcinfo");
		g_ptr_array_add (_tmp36_, _tmp37_);
		_tmp38_ = cmdline;
		_tmp39_ = cmdline;
		_tmp40_ = vala_g_ptr_array_get_length (_tmp39_);
		_tmp41_ = _tmp40_;
		g_ptr_array_set_size (_tmp38_, _tmp41_ + 1);
		_tmp42_ = launcher;
		_tmp43_ = cmdline;
		_tmp44_ = _tmp43_->pdata;
		_tmp44__length1 = _tmp43_->len;
		_tmp45_ = g_subprocess_launcher_spawnv (_tmp42_, _tmp44_, &_inner_error0_);
		process = _tmp45_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (cmdline);
			goto __catch1_g_error;
		}
		{
			GSubprocess* _tmp46_;
			GSubprocess* _tmp47_;
			_tmp46_ = process;
			g_subprocess_wait (_tmp46_, cancellable, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch2_g_error;
			}
			_tmp47_ = process;
			if (g_subprocess_get_if_exited (_tmp47_)) {
				GSubprocess* _tmp48_;
				_tmp48_ = process;
				if (g_subprocess_get_exit_status (_tmp48_) == 0) {
					{
						GDataInputStream* dis = NULL;
						GSubprocess* _tmp49_;
						GInputStream* _tmp50_;
						GDataInputStream* _tmp51_;
						GFileOutputStream* fos = NULL;
						GFile* _tmp52_;
						GDataOutputStream* dos = NULL;
						GFileOutputStream* _tmp61_;
						GDataOutputStream* _tmp62_;
						GDataOutputStream* _tmp63_;
						GDataInputStream* _tmp64_;
						_tmp49_ = process;
						_tmp50_ = g_subprocess_get_stdout_pipe (_tmp49_);
						_tmp51_ = g_data_input_stream_new (_tmp50_);
						dis = _tmp51_;
						_tmp52_ = srcinfo;
						if (g_file_query_exists (_tmp52_, NULL)) {
							GFileOutputStream* _tmp53_ = NULL;
							GFile* _tmp54_;
							GFileOutputStream* _tmp55_;
							GFileOutputStream* _tmp56_;
							_tmp54_ = srcinfo;
							_tmp55_ = g_file_replace (_tmp54_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error0_);
							_tmp53_ = _tmp55_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (fos);
								_g_object_unref0 (dis);
								goto __catch3_g_error;
							}
							_tmp56_ = _tmp53_;
							_tmp53_ = NULL;
							_g_object_unref0 (fos);
							fos = _tmp56_;
							_g_object_unref0 (_tmp53_);
						} else {
							GFileOutputStream* _tmp57_ = NULL;
							GFile* _tmp58_;
							GFileOutputStream* _tmp59_;
							GFileOutputStream* _tmp60_;
							_tmp58_ = srcinfo;
							_tmp59_ = g_file_create (_tmp58_, G_FILE_CREATE_NONE, NULL, &_inner_error0_);
							_tmp57_ = _tmp59_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_object_unref0 (fos);
								_g_object_unref0 (dis);
								goto __catch3_g_error;
							}
							_tmp60_ = _tmp57_;
							_tmp57_ = NULL;
							_g_object_unref0 (fos);
							fos = _tmp60_;
							_g_object_unref0 (_tmp57_);
						}
						_tmp61_ = fos;
						_tmp62_ = g_data_output_stream_new ((GOutputStream*) _tmp61_);
						dos = _tmp62_;
						_tmp63_ = dos;
						_tmp64_ = dis;
						g_output_stream_splice ((GOutputStream*) _tmp63_, (GInputStream*) _tmp64_, G_OUTPUT_STREAM_SPLICE_NONE, NULL, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_object_unref0 (dos);
							_g_object_unref0 (fos);
							_g_object_unref0 (dis);
							goto __catch3_g_error;
						}
						result = TRUE;
						_g_object_unref0 (dos);
						_g_object_unref0 (fos);
						_g_object_unref0 (dis);
						_g_object_unref0 (process);
						_g_ptr_array_unref0 (cmdline);
						_g_object_unref0 (launcher);
						_g_object_unref0 (pkgbuild);
						_g_object_unref0 (srcinfo);
						_g_free0 (pkgdir_name);
						return result;
					}
					goto __finally3;
					__catch3_g_error:
					{
						GError* e = NULL;
						GError* _tmp65_;
						const gchar* _tmp66_;
						e = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp65_ = e;
						_tmp66_ = _tmp65_->message;
						g_warning ("database.vala:1893: %s", _tmp66_);
						_g_error_free0 (e);
					}
					__finally3:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch2_g_error;
					}
				}
			}
		}
		goto __finally2;
		__catch2_g_error:
		{
			GSubprocess* _tmp67_;
			GSubprocess* _tmp68_;
			g_clear_error (&_inner_error0_);
			_tmp67_ = process;
			g_subprocess_send_signal (_tmp67_, (gint) SIGINT);
			_tmp68_ = process;
			g_subprocess_send_signal (_tmp68_, (gint) SIGKILL);
		}
		__finally2:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (process);
			_g_ptr_array_unref0 (cmdline);
			goto __catch1_g_error;
		}
		_g_object_unref0 (process);
		_g_ptr_array_unref0 (cmdline);
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp69_;
		const gchar* _tmp70_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp69_ = e;
		_tmp70_ = _tmp69_->message;
		g_warning ("database.vala:1903: %s", _tmp70_);
		_g_error_free0 (e);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp71_ = FALSE;
		_g_object_unref0 (launcher);
		_g_object_unref0 (pkgbuild);
		_g_object_unref0 (srcinfo);
		_g_free0 (pkgdir_name);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp71_;
	}
	result = FALSE;
	_g_object_unref0 (launcher);
	_g_object_unref0 (pkgbuild);
	_g_object_unref0 (srcinfo);
	_g_free0 (pkgdir_name);
	return result;
}

static void
pamac_database_regenerate_srcinfo_async_data_free (gpointer _data)
{
	PamacDatabaseRegenerateSrcinfoAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->pkgname);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseRegenerateSrcinfoAsyncData, _data_);
}

void
pamac_database_regenerate_srcinfo_async (PamacDatabase* self,
                                         const gchar* pkgname,
                                         GCancellable* cancellable,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	PamacDatabaseRegenerateSrcinfoAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	_data_ = g_slice_new0 (PamacDatabaseRegenerateSrcinfoAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_regenerate_srcinfo_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (pkgname);
	_g_free0 (_data_->pkgname);
	_data_->pkgname = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	pamac_database_regenerate_srcinfo_async_co (_data_);
}

gboolean
pamac_database_regenerate_srcinfo_finish (PamacDatabase* self,
                                          GAsyncResult* _res_)
{
	gboolean result;
	PamacDatabaseRegenerateSrcinfoAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static Block22Data*
block22_data_ref (Block22Data* _data22_)
{
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}

static void
block22_data_unref (void * _userdata_)
{
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		PamacDatabase* self;
		self = _data22_->self;
		_g_free0 (_data22_->pkgname_copy);
		_g_object_unref0 (_data22_->cancellable);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}

static gboolean
_pamac_database_regenerate_srcinfo_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_regenerate_srcinfo_async_co (self);
	return result;
}

static gint
___lambda24_ (Block22Data* _data22_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data22_->self;
	_data22_->success = pamac_database_regenerate_srcinfo (self, _data22_->pkgname_copy, _data22_->cancellable);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_regenerate_srcinfo_async_co_gsource_func, _data22_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda24__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda24_ (self));
	block22_data_unref (self);
	return result;
}

static gboolean
pamac_database_regenerate_srcinfo_async_co (PamacDatabaseRegenerateSrcinfoAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data22_ = g_slice_new0 (Block22Data);
	_data_->_data22_->_ref_count_ = 1;
	_data_->_data22_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data22_->cancellable);
	_data_->_data22_->cancellable = _data_->cancellable;
	_data_->_data22_->_async_data_ = _data_;
	_data_->_data22_->success = FALSE;
	_data_->_tmp0_ = g_strdup (_data_->pkgname);
	_data_->_data22_->pkgname_copy = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("regenerate_srcinfo", ____lambda24__gthread_func, block22_data_ref (_data_->_data22_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:1919: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block22_data_unref (_data_->_data22_);
		_data_->_data22_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->_data22_->success;
	block22_data_unref (_data_->_data22_);
	_data_->_data22_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

PamacAURPackage*
pamac_database_get_aur_pkg (PamacDatabase* self,
                            const gchar* pkgname)
{
	PamacAURPackageLinked* pkg = NULL;
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	PamacAURPackageLinked* _tmp26_;
	GError* _inner_error0_ = NULL;
	PamacAURPackage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgname != NULL, NULL);
	pkg = NULL;
	_tmp0_ = self->priv->_config;
	_tmp1_ = pamac_config_get_enable_aur (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		{
			AlpmConfig* _tmp3_;
			_tmp3_ = self->priv->alpm_config;
			g_rec_mutex_lock (&self->priv->__lock_alpm_config);
			{
				GHashTable* _tmp4_;
				gconstpointer _tmp5_;
				PamacAURPackageLinked* _tmp6_;
				_tmp4_ = self->priv->aur_pkgs_cache;
				_tmp5_ = g_hash_table_lookup (_tmp4_, pkgname);
				pkg = (PamacAURPackageLinked*) _tmp5_;
				_tmp6_ = pkg;
				if (_tmp6_ == NULL) {
					PamacAURInfos* aur_infos = NULL;
					PamacAURPlugin* _tmp7_;
					PamacAURInfos* _tmp8_;
					PamacAURInfos* _tmp9_;
					_tmp7_ = self->priv->aur_plugin;
					_tmp8_ = pamac_aur_plugin_get_infos (_tmp7_, pkgname);
					aur_infos = _tmp8_;
					_tmp9_ = aur_infos;
					if (_tmp9_ != NULL) {
						alpm_pkg_t* local_pkg = NULL;
						alpm_handle_t* _tmp10_;
						alpm_db_t* _tmp11_;
						alpm_db_t* _tmp12_;
						alpm_pkg_t* _tmp13_;
						PamacAURPackageLinked* new_pkg = NULL;
						PamacAURPackageLinked* _tmp14_;
						PamacAURPackageLinked* _tmp15_;
						PamacAURInfos* _tmp16_;
						alpm_pkg_t* _tmp17_;
						PamacAURPackageLinked* _tmp18_;
						GHashTable* _tmp19_;
						PamacAURPackageLinked* _tmp20_;
						const gchar* _tmp21_;
						const gchar* _tmp22_;
						PamacAURPackageLinked* _tmp23_;
						PamacAURPackageLinked* _tmp24_;
						_tmp10_ = self->priv->alpm_handle;
						_tmp11_ = alpm_get_localdb (_tmp10_);
						_tmp12_ = _tmp11_;
						_tmp13_ = alpm_db_get_pkg (_tmp12_, pkgname);
						local_pkg = _tmp13_;
						_tmp14_ = pamac_aur_package_linked_new ();
						new_pkg = _tmp14_;
						_tmp15_ = new_pkg;
						_tmp16_ = aur_infos;
						_tmp17_ = local_pkg;
						pamac_aur_package_linked_initialise_from_aur_infos (_tmp15_, _tmp16_, _tmp17_, self, FALSE);
						_tmp18_ = new_pkg;
						pkg = _tmp18_;
						_tmp19_ = self->priv->aur_pkgs_cache;
						_tmp20_ = pkg;
						_tmp21_ = pamac_package_get_id ((PamacPackage*) _tmp20_);
						_tmp22_ = _tmp21_;
						_tmp23_ = new_pkg;
						_tmp24_ = _g_object_ref0 (_tmp23_);
						g_hash_table_replace (_tmp19_, _tmp22_, _tmp24_);
						_g_object_unref0 (new_pkg);
					}
					_g_object_unref0 (aur_infos);
				}
			}
			__finally0:
			{
				AlpmConfig* _tmp25_;
				_tmp25_ = self->priv->alpm_config;
				g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
			}
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
	}
	_tmp26_ = pkg;
	result = (PamacAURPackage*) _tmp26_;
	return result;
}

static void
pamac_database_get_aur_pkg_async_data_free (gpointer _data)
{
	PamacDatabaseGetAurPkgAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->pkgname);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetAurPkgAsyncData, _data_);
}

void
pamac_database_get_aur_pkg_async (PamacDatabase* self,
                                  const gchar* pkgname,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	PamacDatabaseGetAurPkgAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgname != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetAurPkgAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_aur_pkg_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (pkgname);
	_g_free0 (_data_->pkgname);
	_data_->pkgname = _tmp1_;
	pamac_database_get_aur_pkg_async_co (_data_);
}

PamacAURPackage*
pamac_database_get_aur_pkg_finish (PamacDatabase* self,
                                   GAsyncResult* _res_)
{
	PamacAURPackage* result;
	PamacDatabaseGetAurPkgAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		PamacDatabase* self;
		self = _data23_->self;
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		PamacDatabase* self;
		self = _data24_->_data23_->self;
		_g_free0 (_data24_->pkgname_copy);
		block23_data_unref (_data24_->_data23_);
		_data24_->_data23_ = NULL;
		g_slice_free (Block24Data, _data24_);
	}
}

static gboolean
_pamac_database_get_aur_pkg_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_aur_pkg_async_co (self);
	return result;
}

static gint
____lambda25_ (Block24Data* _data24_)
{
	Block23Data* _data23_;
	PamacDatabase* self;
	const gchar* _tmp0_;
	PamacAURPackage* _tmp1_;
	GMainContext* _tmp2_;
	gint result;
	_data23_ = _data24_->_data23_;
	self = _data23_->self;
	_tmp0_ = _data24_->pkgname_copy;
	_tmp1_ = pamac_database_get_aur_pkg (self, _tmp0_);
	_data23_->pkg = _tmp1_;
	_tmp2_ = self->priv->_context;
	g_main_context_invoke_full (_tmp2_, G_PRIORITY_DEFAULT, _pamac_database_get_aur_pkg_async_co_gsource_func, _data23_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda25__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda25_ (self));
	block24_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_aur_pkg_async_co (PamacDatabaseGetAurPkgAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data23_ = g_slice_new0 (Block23Data);
	_data_->_data23_->_ref_count_ = 1;
	_data_->_data23_->self = g_object_ref (_data_->self);
	_data_->_data23_->_async_data_ = _data_;
	_data_->_data23_->pkg = NULL;
	_data_->_tmp0_ = _data_->self->priv->_config;
	_data_->_tmp1_ = pamac_config_get_enable_aur (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		_data_->_data24_ = g_slice_new0 (Block24Data);
		_data_->_data24_->_ref_count_ = 1;
		_data_->_data24_->_data23_ = block23_data_ref (_data_->_data23_);
		_data_->_tmp3_ = g_strdup (_data_->pkgname);
		_data_->_data24_->pkgname_copy = _data_->_tmp3_;
		{
			_data_->_tmp4_ = g_thread_try_new ("get_aur_pkg", _____lambda25__gthread_func, block24_data_ref (_data_->_data24_), &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_thread_unref0 (_data_->_tmp5_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_->message;
			g_warning ("database.vala:1956: %s", _data_->_tmp7_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block24_data_unref (_data_->_data24_);
			_data_->_data24_ = NULL;
			block23_data_unref (_data_->_data23_);
			_data_->_data23_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block24_data_unref (_data_->_data24_);
		_data_->_data24_ = NULL;
	}
	_data_->_tmp8_ = _data_->_data23_->pkg;
	_data_->result = _data_->_tmp8_;
	block23_data_unref (_data_->_data23_);
	_data_->_data23_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_aur_pkgs_real (PamacDatabase* self,
                                  GPtrArray* pkgnames,
                                  GHashTable** data)
{
	GPtrArray* aur_infos_list = NULL;
	PamacAURPlugin* _tmp2_;
	GPtrArray* _tmp3_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgnames != NULL);
	g_return_if_fail (*data != NULL);
	{
		GPtrArray* pkgname_collection = NULL;
		guint pkgname_index = 0U;
		pkgname_collection = pkgnames;
		for (pkgname_index = 0; pkgname_index < pkgname_collection->len; pkgname_index = pkgname_index + 1) {
			const gchar* pkgname = NULL;
			pkgname = (const gchar*) g_ptr_array_index (pkgname_collection, pkgname_index);
			{
				const gchar* _tmp0_;
				gchar* _tmp1_;
				_tmp0_ = pkgname;
				_tmp1_ = g_strdup (_tmp0_);
				g_hash_table_insert (*data, _tmp1_, NULL);
			}
		}
	}
	_tmp2_ = self->priv->aur_plugin;
	_tmp3_ = pamac_aur_plugin_get_multi_infos (_tmp2_, pkgnames);
	aur_infos_list = _tmp3_;
	{
		AlpmConfig* _tmp4_;
		_tmp4_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			GPtrArray* _tmp5_;
			_tmp5_ = aur_infos_list;
			{
				GPtrArray* aur_infos_collection = NULL;
				guint aur_infos_index = 0U;
				aur_infos_collection = _tmp5_;
				for (aur_infos_index = 0; aur_infos_index < aur_infos_collection->len; aur_infos_index = aur_infos_index + 1) {
					PamacAURInfos* aur_infos = NULL;
					aur_infos = (PamacAURInfos*) g_ptr_array_index (aur_infos_collection, aur_infos_index);
					{
						const gchar* name = NULL;
						PamacAURInfos* _tmp6_;
						const gchar* _tmp7_;
						const gchar* _tmp8_;
						PamacAURPackageLinked* pkg = NULL;
						GHashTable* _tmp9_;
						const gchar* _tmp10_;
						gconstpointer _tmp11_;
						PamacAURPackageLinked* _tmp12_;
						PamacAURPackageLinked* _tmp13_;
						const gchar* _tmp29_;
						gchar* _tmp30_;
						PamacAURPackageLinked* _tmp31_;
						_tmp6_ = aur_infos;
						_tmp7_ = pamac_aur_infos_get_name (_tmp6_);
						_tmp8_ = _tmp7_;
						name = _tmp8_;
						_tmp9_ = self->priv->aur_pkgs_cache;
						_tmp10_ = name;
						_tmp11_ = g_hash_table_lookup (_tmp9_, _tmp10_);
						_tmp12_ = _g_object_ref0 ((PamacAURPackageLinked*) _tmp11_);
						pkg = _tmp12_;
						_tmp13_ = pkg;
						if (_tmp13_ == NULL) {
							alpm_pkg_t* local_pkg = NULL;
							alpm_handle_t* _tmp14_;
							alpm_db_t* _tmp15_;
							alpm_db_t* _tmp16_;
							const gchar* _tmp17_;
							alpm_pkg_t* _tmp18_;
							PamacAURPackageLinked* _tmp19_;
							PamacAURPackageLinked* _tmp20_;
							PamacAURInfos* _tmp21_;
							alpm_pkg_t* _tmp22_;
							GHashTable* _tmp23_;
							PamacAURPackageLinked* _tmp24_;
							const gchar* _tmp25_;
							const gchar* _tmp26_;
							PamacAURPackageLinked* _tmp27_;
							PamacAURPackageLinked* _tmp28_;
							_tmp14_ = self->priv->alpm_handle;
							_tmp15_ = alpm_get_localdb (_tmp14_);
							_tmp16_ = _tmp15_;
							_tmp17_ = name;
							_tmp18_ = alpm_db_get_pkg (_tmp16_, _tmp17_);
							local_pkg = _tmp18_;
							_tmp19_ = pamac_aur_package_linked_new ();
							_g_object_unref0 (pkg);
							pkg = _tmp19_;
							_tmp20_ = pkg;
							_tmp21_ = aur_infos;
							_tmp22_ = local_pkg;
							pamac_aur_package_linked_initialise_from_aur_infos (_tmp20_, _tmp21_, _tmp22_, self, FALSE);
							_tmp23_ = self->priv->aur_pkgs_cache;
							_tmp24_ = pkg;
							_tmp25_ = pamac_package_get_id ((PamacPackage*) _tmp24_);
							_tmp26_ = _tmp25_;
							_tmp27_ = pkg;
							_tmp28_ = _g_object_ref0 (_tmp27_);
							g_hash_table_replace (_tmp23_, _tmp26_, _tmp28_);
						}
						_tmp29_ = name;
						_tmp30_ = g_strdup (_tmp29_);
						_tmp31_ = pkg;
						g_hash_table_insert (*data, _tmp30_, _tmp31_);
						_g_object_unref0 (pkg);
					}
				}
			}
		}
		__finally0:
		{
			AlpmConfig* _tmp32_;
			_tmp32_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (aur_infos_list);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_g_ptr_array_unref0 (aur_infos_list);
}

GHashTable*
pamac_database_get_aur_pkgs (PamacDatabase* self,
                             GPtrArray* pkgnames)
{
	GHashTable* data = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	PamacConfig* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GHashTable* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pkgnames != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, NULL);
	data = _tmp2_;
	_tmp3_ = self->priv->_config;
	_tmp4_ = pamac_config_get_enable_aur (_tmp3_);
	_tmp5_ = _tmp4_;
	if (!_tmp5_) {
		result = data;
		return result;
	}
	pamac_database_get_aur_pkgs_real (self, pkgnames, &data);
	result = data;
	return result;
}

static void
pamac_database_get_aur_pkgs_async_data_free (gpointer _data)
{
	PamacDatabaseGetAurPkgsAsyncData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetAurPkgsAsyncData, _data_);
}

void
pamac_database_get_aur_pkgs_async (PamacDatabase* self,
                                   GPtrArray* pkgnames,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	PamacDatabaseGetAurPkgsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	GPtrArray* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pkgnames != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetAurPkgsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_aur_pkgs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_ptr_array_ref0 (pkgnames);
	_g_ptr_array_unref0 (_data_->pkgnames);
	_data_->pkgnames = _tmp1_;
	pamac_database_get_aur_pkgs_async_co (_data_);
}

GHashTable*
pamac_database_get_aur_pkgs_finish (PamacDatabase* self,
                                    GAsyncResult* _res_)
{
	GHashTable* result;
	PamacDatabaseGetAurPkgsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		PamacDatabase* self;
		self = _data25_->self;
		_g_hash_table_unref0 (_data25_->data);
		_g_ptr_array_unref0 (_data25_->pkgnames);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}

static gboolean
_pamac_database_get_aur_pkgs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_aur_pkgs_async_co (self);
	return result;
}

static gint
___lambda26_ (Block25Data* _data25_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data25_->self;
	pamac_database_get_aur_pkgs_real (self, _data25_->pkgnames, &_data25_->data);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_aur_pkgs_async_co_gsource_func, _data25_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda26__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda26_ (self));
	block25_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_aur_pkgs_async_co (PamacDatabaseGetAurPkgsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data25_ = g_slice_new0 (Block25Data);
	_data_->_data25_->_ref_count_ = 1;
	_data_->_data25_->self = g_object_ref (_data_->self);
	_g_ptr_array_unref0 (_data_->_data25_->pkgnames);
	_data_->_data25_->pkgnames = _data_->pkgnames;
	_data_->_data25_->_async_data_ = _data_;
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, NULL);
	_data_->_data25_->data = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->self->priv->_config;
	_data_->_tmp4_ = pamac_config_get_enable_aur (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	if (!_data_->_tmp5_) {
		_data_->_tmp6_ = _data_->_data25_->data;
		_data_->_tmp7_ = _g_hash_table_ref0 (_data_->_tmp6_);
		_data_->result = _data_->_tmp7_;
		block25_data_unref (_data_->_data25_);
		_data_->_data25_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp8_ = g_thread_try_new ("get_aur_pkgs", ____lambda26__gthread_func, block25_data_ref (_data_->_data25_), &_data_->_inner_error0_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_g_thread_unref0 (_data_->_tmp9_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp10_ = _data_->e;
		_data_->_tmp11_ = _data_->_tmp10_->message;
		g_warning ("database.vala:2005: %s", _data_->_tmp11_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block25_data_unref (_data_->_data25_);
		_data_->_data25_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = _data_->_data25_->data;
	_data_->_tmp13_ = _g_hash_table_ref0 (_data_->_tmp12_);
	_data_->result = _data_->_tmp13_;
	block25_data_unref (_data_->_data25_);
	_data_->_data25_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_refresh_tmp_files_dbs_async_data_free (gpointer _data)
{
	PamacDatabaseRefreshTmpFilesDbsAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseRefreshTmpFilesDbsAsyncData, _data_);
}

void
pamac_database_refresh_tmp_files_dbs_async (PamacDatabase* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	PamacDatabaseRefreshTmpFilesDbsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseRefreshTmpFilesDbsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_refresh_tmp_files_dbs_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_refresh_tmp_files_dbs_async_co (_data_);
}

void
pamac_database_refresh_tmp_files_dbs_finish (PamacDatabase* self,
                                             GAsyncResult* _res_)
{
	PamacDatabaseRefreshTmpFilesDbsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		PamacDatabase* self;
		self = _data26_->self;
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static gboolean
_pamac_database_refresh_tmp_files_dbs_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_refresh_tmp_files_dbs_async_co (self);
	return result;
}

static gint
___lambda27_ (Block26Data* _data26_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data26_->self;
	pamac_database_refresh_tmp_files_dbs (self);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_refresh_tmp_files_dbs_async_co_gsource_func, _data26_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda27__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda27_ (self));
	block26_data_unref (self);
	return result;
}

static gboolean
pamac_database_refresh_tmp_files_dbs_async_co (PamacDatabaseRefreshTmpFilesDbsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data26_ = g_slice_new0 (Block26Data);
	_data_->_data26_->_ref_count_ = 1;
	_data_->_data26_->self = g_object_ref (_data_->self);
	_data_->_data26_->_async_data_ = _data_;
	{
		_data_->_tmp0_ = g_thread_try_new ("refresh_tmp_files_dbs", ____lambda27__gthread_func, block26_data_ref (_data_->_data26_), &_data_->_inner_error0_);
		_data_->_tmp1_ = _data_->_tmp0_;
		_g_thread_unref0 (_data_->_tmp1_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp2_ = _data_->e;
		_data_->_tmp3_ = _data_->_tmp2_->message;
		g_warning ("database.vala:2019: %s", _data_->_tmp3_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block26_data_unref (_data_->_data26_);
		_data_->_data26_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	block26_data_unref (_data_->_data26_);
	_data_->_data26_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
pamac_database_refresh_tmp_files_dbs (PamacDatabase* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			alpm_handle_t* tmp_files_handle = NULL;
			AlpmConfig* _tmp1_;
			alpm_handle_t* _tmp2_;
			alpm_handle_t* _tmp3_;
			_tmp1_ = self->priv->alpm_config;
			_tmp2_ = alpm_config_get_handle (_tmp1_, TRUE, TRUE, TRUE);
			tmp_files_handle = _tmp2_;
			_tmp3_ = tmp_files_handle;
			if (_tmp3_ != NULL) {
				AlpmConfig* _tmp4_;
				alpm_handle_t* _tmp5_;
				alpm_list_t* syncdbs = NULL;
				alpm_handle_t* _tmp6_;
				alpm_list_t* _tmp7_;
				alpm_list_t* _tmp8_;
				alpm_handle_t* _tmp9_;
				alpm_list_t* _tmp10_;
				_tmp4_ = self->priv->alpm_config;
				_tmp5_ = tmp_files_handle;
				alpm_config_register_syncdbs (_tmp4_, _tmp5_);
				_tmp6_ = tmp_files_handle;
				_tmp7_ = alpm_get_syncdbs (_tmp6_);
				_tmp8_ = _tmp7_;
				syncdbs = _tmp8_;
				_tmp9_ = tmp_files_handle;
				_tmp10_ = syncdbs;
				alpm_db_update (_tmp9_, _tmp10_, 0);
			}
			_alpm_release0 (tmp_files_handle);
		}
		__finally0:
		{
			AlpmConfig* _tmp11_;
			_tmp11_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

GDateTime*
pamac_database_get_last_refresh_time (PamacDatabase* self)
{
	gchar* timestamp_path = NULL;
	alpm_handle_t* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _inner_error0_ = NULL;
	GDateTime* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->alpm_handle;
	_tmp1_ = alpm_option_get_dbpath (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_build_filename (_tmp2_, "sync", "refresh_timestamp", NULL);
	timestamp_path = _tmp3_;
	{
		GFile* timestamp_file = NULL;
		const gchar* _tmp4_;
		GFile* _tmp5_;
		GFile* _tmp6_;
		_tmp4_ = timestamp_path;
		_tmp5_ = g_file_new_for_path (_tmp4_);
		timestamp_file = _tmp5_;
		_tmp6_ = timestamp_file;
		if (g_file_query_exists (_tmp6_, NULL)) {
			GFileInfo* info = NULL;
			GFile* _tmp7_;
			GFileInfo* _tmp8_;
			GFileInfo* _tmp9_;
			GDateTime* _tmp10_;
			GDateTime* _tmp11_;
			GDateTime* _tmp12_;
			GDateTime* _tmp13_;
			_tmp7_ = timestamp_file;
			_tmp8_ = g_file_query_info (_tmp7_, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
			info = _tmp8_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (timestamp_file);
				goto __catch0_g_error;
			}
			_tmp9_ = info;
			_tmp10_ = g_file_info_get_modification_date_time (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = g_date_time_to_local (_tmp11_);
			_tmp13_ = _tmp12_;
			_g_date_time_unref0 (_tmp11_);
			result = _tmp13_;
			_g_object_unref0 (info);
			_g_object_unref0 (timestamp_file);
			_g_free0 (timestamp_path);
			return result;
		}
		_g_object_unref0 (timestamp_file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp14_;
		const gchar* _tmp15_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp14_ = e;
		_tmp15_ = _tmp14_->message;
		g_warning ("database.vala:2044: %s", _tmp15_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (timestamp_path);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = NULL;
	_g_free0 (timestamp_path);
	return result;
}

static gint64
pamac_database_get_last_refresh_age (PamacDatabase* self)
{
	GDateTime* last_modifed = NULL;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* now = NULL;
	GDateTime* _tmp2_;
	GTimeSpan elapsed_time = 0LL;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	_tmp0_ = pamac_database_get_last_refresh_time (self);
	last_modifed = _tmp0_;
	_tmp1_ = last_modifed;
	if (_tmp1_ == NULL) {
		result = G_MAXINT64;
		_g_date_time_unref0 (last_modifed);
		return result;
	}
	_tmp2_ = g_date_time_new_now_local ();
	now = _tmp2_;
	_tmp3_ = now;
	_tmp4_ = last_modifed;
	elapsed_time = g_date_time_difference (_tmp3_, _tmp4_);
	result = (gint64) elapsed_time;
	_g_date_time_unref0 (now);
	_g_date_time_unref0 (last_modifed);
	return result;
}

gboolean
pamac_database_need_refresh (PamacDatabase* self)
{
	gboolean need_refresh = FALSE;
	gint64 elapsed_time = 0LL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	need_refresh = TRUE;
	elapsed_time = pamac_database_get_last_refresh_age (self);
	if (elapsed_time < ((gint64) G_TIME_SPAN_HOUR)) {
		need_refresh = FALSE;
	} else {
		gint64 elapsed_hours = 0LL;
		PamacConfig* _tmp0_;
		guint64 _tmp1_;
		guint64 _tmp2_;
		elapsed_hours = elapsed_time / G_TIME_SPAN_HOUR;
		_tmp0_ = self->priv->_config;
		_tmp1_ = pamac_config_get_refresh_period (_tmp0_);
		_tmp2_ = _tmp1_;
		if (((guint64) elapsed_hours) < _tmp2_) {
			need_refresh = FALSE;
		}
	}
	result = need_refresh;
	return result;
}

static gboolean
____lambda28_ (PamacDatabase* self)
{
	gboolean result;
	g_signal_emit (self, pamac_database_signals[PAMAC_DATABASE_GET_UPDATES_PROGRESS_SIGNAL], 0, (guint) 95);
	result = FALSE;
	return result;
}

static gboolean
_____lambda28__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda28_ ((PamacDatabase*) self);
	return result;
}

static gboolean
____lambda29_ (PamacDatabase* self)
{
	gboolean result;
	g_signal_emit (self, pamac_database_signals[PAMAC_DATABASE_GET_UPDATES_PROGRESS_SIGNAL], 0, (guint) 100);
	result = FALSE;
	return result;
}

static gboolean
_____lambda29__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda29_ ((PamacDatabase*) self);
	return result;
}

static gboolean
____lambda30_ (PamacDatabase* self)
{
	gboolean result;
	g_signal_emit (self, pamac_database_signals[PAMAC_DATABASE_GET_UPDATES_PROGRESS_SIGNAL], 0, (guint) 100);
	result = FALSE;
	return result;
}

static gboolean
_____lambda30__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda30_ ((PamacDatabase*) self);
	return result;
}

static void
pamac_database_get_updates_real (PamacDatabase* self,
                                 PamacUpdates** updates)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (*updates != NULL);
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			GPtrArray* repos_updates = NULL;
			GPtrArray* _tmp1_;
			GPtrArray* _tmp2_;
			GPtrArray* ignored_repos_updates = NULL;
			GPtrArray* _tmp3_;
			GPtrArray* _tmp4_;
			GPtrArray* local_pkgs = NULL;
			GPtrArray* _tmp5_;
			GPtrArray* vcs_local_pkgs = NULL;
			GPtrArray* _tmp6_;
			alpm_list_t* pkgcache = NULL;
			alpm_handle_t* _tmp7_;
			alpm_db_t* _tmp8_;
			alpm_db_t* _tmp9_;
			alpm_list_t* _tmp10_;
			alpm_list_t* _tmp11_;
			GPtrArray* flatpak_updates = NULL;
			GPtrArray* _tmp83_;
			GPtrArray* _tmp84_;
			GPtrArray* _tmp85_;
			PamacConfig* _tmp86_;
			gboolean _tmp87_;
			gboolean _tmp88_;
			PamacConfig* _tmp90_;
			gboolean _tmp91_;
			gboolean _tmp92_;
			_tmp1_ = pamac_updates_get_repos_updates (*updates);
			_tmp2_ = _tmp1_;
			repos_updates = _tmp2_;
			_tmp3_ = pamac_updates_get_ignored_repos_updates (*updates);
			_tmp4_ = _tmp3_;
			ignored_repos_updates = _tmp4_;
			_tmp5_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
			local_pkgs = _tmp5_;
			_tmp6_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
			vcs_local_pkgs = _tmp6_;
			_tmp7_ = self->priv->alpm_handle;
			_tmp8_ = alpm_get_localdb (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = alpm_db_get_pkgcache (_tmp9_);
			_tmp11_ = _tmp10_;
			pkgcache = _tmp11_;
			while (TRUE) {
				alpm_list_t* _tmp12_;
				alpm_pkg_t* installed_pkg = NULL;
				alpm_list_t* _tmp13_;
				gconstpointer _tmp14_;
				alpm_pkg_t* candidate = NULL;
				alpm_pkg_t* _tmp15_;
				alpm_handle_t* _tmp16_;
				alpm_list_t* _tmp17_;
				alpm_list_t* _tmp18_;
				alpm_pkg_t* _tmp19_;
				alpm_pkg_t* _tmp20_;
				_tmp12_ = pkgcache;
				if (!(_tmp12_ != NULL)) {
					break;
				}
				_tmp13_ = pkgcache;
				_tmp14_ = _tmp13_->data;
				installed_pkg = (alpm_pkg_t*) _tmp14_;
				_tmp15_ = installed_pkg;
				_tmp16_ = self->priv->alpm_handle;
				_tmp17_ = alpm_get_syncdbs (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = alpm_sync_get_new_version (_tmp15_, _tmp18_);
				candidate = _tmp19_;
				_tmp20_ = candidate;
				if (_tmp20_ != NULL) {
					gboolean _tmp21_ = FALSE;
					alpm_handle_t* _tmp22_;
					alpm_pkg_t* _tmp23_;
					_tmp22_ = self->priv->alpm_handle;
					_tmp23_ = installed_pkg;
					if (alpm_pkg_should_ignore (_tmp22_, _tmp23_) == 1) {
						_tmp21_ = TRUE;
					} else {
						alpm_handle_t* _tmp24_;
						alpm_pkg_t* _tmp25_;
						_tmp24_ = self->priv->alpm_handle;
						_tmp25_ = candidate;
						_tmp21_ = alpm_pkg_should_ignore (_tmp24_, _tmp25_) == 1;
					}
					if (_tmp21_) {
						PamacAlpmPackageStatic* pkg = NULL;
						alpm_pkg_t* _tmp26_;
						alpm_pkg_t* _tmp27_;
						PamacAlpmPackageStatic* _tmp28_;
						GPtrArray* _tmp29_;
						PamacAlpmPackageStatic* _tmp30_;
						PamacAlpmPackage* _tmp31_;
						_tmp26_ = installed_pkg;
						_tmp27_ = candidate;
						_tmp28_ = pamac_database_initialise_pkg_data (self, _tmp26_, _tmp27_);
						pkg = _tmp28_;
						_tmp29_ = ignored_repos_updates;
						_tmp30_ = pkg;
						_tmp31_ = _g_object_ref0 ((PamacAlpmPackage*) _tmp30_);
						g_ptr_array_add (_tmp29_, _tmp31_);
						_g_object_unref0 (pkg);
					} else {
						PamacAlpmPackageStatic* pkg = NULL;
						alpm_pkg_t* _tmp32_;
						alpm_pkg_t* _tmp33_;
						PamacAlpmPackageStatic* _tmp34_;
						GPtrArray* _tmp35_;
						PamacAlpmPackageStatic* _tmp36_;
						PamacAlpmPackage* _tmp37_;
						_tmp32_ = installed_pkg;
						_tmp33_ = candidate;
						_tmp34_ = pamac_database_initialise_pkg_data (self, _tmp32_, _tmp33_);
						pkg = _tmp34_;
						_tmp35_ = repos_updates;
						_tmp36_ = pkg;
						_tmp37_ = _g_object_ref0 ((PamacAlpmPackage*) _tmp36_);
						g_ptr_array_add (_tmp35_, _tmp37_);
						_g_object_unref0 (pkg);
					}
				} else {
					PamacConfig* _tmp38_;
					gboolean _tmp39_;
					gboolean _tmp40_;
					_tmp38_ = self->priv->_config;
					_tmp39_ = pamac_config_get_check_aur_updates (_tmp38_);
					_tmp40_ = _tmp39_;
					if (_tmp40_) {
						alpm_pkg_t* pkg = NULL;
						alpm_handle_t* _tmp41_;
						alpm_pkg_t* _tmp42_;
						const gchar* _tmp43_;
						const gchar* _tmp44_;
						alpm_pkg_t* _tmp45_;
						alpm_pkg_t* _tmp46_;
						_tmp41_ = self->priv->alpm_handle;
						_tmp42_ = installed_pkg;
						_tmp43_ = alpm_pkg_get_name (_tmp42_);
						_tmp44_ = _tmp43_;
						_tmp45_ = pamac_database_get_syncpkg (self, _tmp41_, _tmp44_);
						pkg = _tmp45_;
						_tmp46_ = pkg;
						if (_tmp46_ == NULL) {
							gboolean _tmp47_ = FALSE;
							PamacConfig* _tmp48_;
							gboolean _tmp49_;
							gboolean _tmp50_;
							_tmp48_ = self->priv->_config;
							_tmp49_ = pamac_config_get_check_aur_vcs_updates (_tmp48_);
							_tmp50_ = _tmp49_;
							if (_tmp50_) {
								gboolean _tmp51_ = FALSE;
								gboolean _tmp52_ = FALSE;
								gboolean _tmp53_ = FALSE;
								alpm_pkg_t* _tmp54_;
								const gchar* _tmp55_;
								const gchar* _tmp56_;
								_tmp54_ = installed_pkg;
								_tmp55_ = alpm_pkg_get_name (_tmp54_);
								_tmp56_ = _tmp55_;
								if (g_str_has_suffix (_tmp56_, "-git")) {
									_tmp53_ = TRUE;
								} else {
									alpm_pkg_t* _tmp57_;
									const gchar* _tmp58_;
									const gchar* _tmp59_;
									_tmp57_ = installed_pkg;
									_tmp58_ = alpm_pkg_get_name (_tmp57_);
									_tmp59_ = _tmp58_;
									_tmp53_ = g_str_has_suffix (_tmp59_, "-svn");
								}
								if (_tmp53_) {
									_tmp52_ = TRUE;
								} else {
									alpm_pkg_t* _tmp60_;
									const gchar* _tmp61_;
									const gchar* _tmp62_;
									_tmp60_ = installed_pkg;
									_tmp61_ = alpm_pkg_get_name (_tmp60_);
									_tmp62_ = _tmp61_;
									_tmp52_ = g_str_has_suffix (_tmp62_, "-bzr");
								}
								if (_tmp52_) {
									_tmp51_ = TRUE;
								} else {
									alpm_pkg_t* _tmp63_;
									const gchar* _tmp64_;
									const gchar* _tmp65_;
									_tmp63_ = installed_pkg;
									_tmp64_ = alpm_pkg_get_name (_tmp63_);
									_tmp65_ = _tmp64_;
									_tmp51_ = g_str_has_suffix (_tmp65_, "-hg");
								}
								_tmp47_ = _tmp51_;
							} else {
								_tmp47_ = FALSE;
							}
							if (_tmp47_) {
								alpm_handle_t* _tmp66_;
								alpm_pkg_t* _tmp67_;
								_tmp66_ = self->priv->alpm_handle;
								_tmp67_ = installed_pkg;
								if (alpm_pkg_should_ignore (_tmp66_, _tmp67_) == 0) {
									GPtrArray* _tmp68_;
									alpm_pkg_t* _tmp69_;
									const gchar* _tmp70_;
									const gchar* _tmp71_;
									gchar* _tmp72_;
									GPtrArray* _tmp73_;
									alpm_pkg_t* _tmp74_;
									const gchar* _tmp75_;
									const gchar* _tmp76_;
									gchar* _tmp77_;
									_tmp68_ = local_pkgs;
									_tmp69_ = installed_pkg;
									_tmp70_ = alpm_pkg_get_name (_tmp69_);
									_tmp71_ = _tmp70_;
									_tmp72_ = g_strdup (_tmp71_);
									g_ptr_array_add (_tmp68_, _tmp72_);
									_tmp73_ = vcs_local_pkgs;
									_tmp74_ = installed_pkg;
									_tmp75_ = alpm_pkg_get_name (_tmp74_);
									_tmp76_ = _tmp75_;
									_tmp77_ = g_strdup (_tmp76_);
									g_ptr_array_add (_tmp73_, _tmp77_);
								}
							} else {
								GPtrArray* _tmp78_;
								alpm_pkg_t* _tmp79_;
								const gchar* _tmp80_;
								const gchar* _tmp81_;
								gchar* _tmp82_;
								_tmp78_ = local_pkgs;
								_tmp79_ = installed_pkg;
								_tmp80_ = alpm_pkg_get_name (_tmp79_);
								_tmp81_ = _tmp80_;
								_tmp82_ = g_strdup (_tmp81_);
								g_ptr_array_add (_tmp78_, _tmp82_);
							}
						}
					}
				}
				pkgcache = alpm_list_next (pkgcache);
			}
			_tmp83_ = pamac_updates_get_flatpak_updates (*updates);
			_tmp84_ = _tmp83_;
			_tmp85_ = _g_ptr_array_ref0 (_tmp84_);
			flatpak_updates = _tmp85_;
			_tmp86_ = self->priv->_config;
			_tmp87_ = pamac_config_get_check_flatpak_updates (_tmp86_);
			_tmp88_ = _tmp87_;
			if (_tmp88_) {
				PamacFlatpakPlugin* _tmp89_;
				_tmp89_ = self->priv->flatpak_plugin;
				pamac_flatpak_plugin_get_flatpak_updates (_tmp89_, &flatpak_updates);
			}
			_tmp90_ = self->priv->_config;
			_tmp91_ = pamac_config_get_check_aur_updates (_tmp90_);
			_tmp92_ = _tmp91_;
			if (_tmp92_) {
				PamacConfig* _tmp93_;
				gboolean _tmp94_;
				gboolean _tmp95_;
				GMainContext* _tmp97_;
				PamacAURPlugin* _tmp98_;
				GPtrArray* _tmp99_;
				GPtrArray* _tmp100_;
				GPtrArray* _tmp101_;
				GPtrArray* _tmp102_;
				GMainContext* _tmp103_;
				_tmp93_ = self->priv->_config;
				_tmp94_ = pamac_config_get_check_aur_vcs_updates (_tmp93_);
				_tmp95_ = _tmp94_;
				if (_tmp95_) {
					GPtrArray* _tmp96_;
					_tmp96_ = vcs_local_pkgs;
					pamac_database_refresh_vcs_sources (self, _tmp96_);
				}
				_tmp97_ = self->priv->_context;
				g_main_context_invoke_full (_tmp97_, G_PRIORITY_DEFAULT, _____lambda28__gsource_func, g_object_ref (self), g_object_unref);
				_tmp98_ = self->priv->aur_plugin;
				_tmp99_ = local_pkgs;
				_tmp100_ = pamac_aur_plugin_get_multi_infos (_tmp98_, _tmp99_);
				_tmp101_ = _tmp100_;
				_tmp102_ = vcs_local_pkgs;
				pamac_database_get_aur_updates_real (self, _tmp101_, _tmp102_, updates);
				_g_ptr_array_unref0 (_tmp101_);
				_tmp103_ = self->priv->_context;
				g_main_context_invoke_full (_tmp103_, G_PRIORITY_DEFAULT, _____lambda29__gsource_func, g_object_ref (self), g_object_unref);
			} else {
				GMainContext* _tmp104_;
				_tmp104_ = self->priv->_context;
				g_main_context_invoke_full (_tmp104_, G_PRIORITY_DEFAULT, _____lambda30__gsource_func, g_object_ref (self), g_object_unref);
			}
			_g_ptr_array_unref0 (flatpak_updates);
			_g_ptr_array_unref0 (vcs_local_pkgs);
			_g_ptr_array_unref0 (local_pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp105_;
			_tmp105_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

PamacUpdates*
pamac_database_get_updates (PamacDatabase* self)
{
	PamacUpdates* updates = NULL;
	PamacUpdates* _tmp0_;
	PamacUpdates* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = pamac_updates_new ();
	updates = _tmp0_;
	pamac_database_get_updates_real (self, &updates);
	result = updates;
	return result;
}

static void
pamac_database_get_updates_async_data_free (gpointer _data)
{
	PamacDatabaseGetUpdatesAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetUpdatesAsyncData, _data_);
}

void
pamac_database_get_updates_async (PamacDatabase* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	PamacDatabaseGetUpdatesAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetUpdatesAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_updates_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_updates_async_co (_data_);
}

PamacUpdates*
pamac_database_get_updates_finish (PamacDatabase* self,
                                   GAsyncResult* _res_)
{
	PamacUpdates* result;
	PamacDatabaseGetUpdatesAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		PamacDatabase* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->updates);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

static gboolean
_pamac_database_get_updates_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_updates_async_co (self);
	return result;
}

static gint
___lambda31_ (Block27Data* _data27_)
{
	PamacDatabase* self;
	GMainContext* _tmp0_;
	gint result;
	self = _data27_->self;
	pamac_database_get_updates_real (self, &_data27_->updates);
	_tmp0_ = self->priv->_context;
	g_main_context_invoke_full (_tmp0_, G_PRIORITY_DEFAULT, _pamac_database_get_updates_async_co_gsource_func, _data27_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda31__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda31_ (self));
	block27_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_updates_async_co (PamacDatabaseGetUpdatesAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data27_ = g_slice_new0 (Block27Data);
	_data_->_data27_->_ref_count_ = 1;
	_data_->_data27_->self = g_object_ref (_data_->self);
	_data_->_data27_->_async_data_ = _data_;
	_data_->_tmp0_ = pamac_updates_new ();
	_data_->_data27_->updates = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_updates", ____lambda31__gthread_func, block27_data_ref (_data_->_data27_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:2163: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block27_data_unref (_data_->_data27_);
		_data_->_data27_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_object_ref0 (_data_->_data27_->updates);
	_data_->result = _data_->_tmp5_;
	block27_data_unref (_data_->_data27_);
	_data_->_data27_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_refresh_vcs_sources (PamacDatabase* self,
                                    GPtrArray* vcs_local_pkgs)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (vcs_local_pkgs != NULL);
	{
		GPtrArray* pkgname_collection = NULL;
		guint pkgname_index = 0U;
		pkgname_collection = vcs_local_pkgs;
		for (pkgname_index = 0; pkgname_index < pkgname_collection->len; pkgname_index = pkgname_index + 1) {
			const gchar* pkgname = NULL;
			pkgname = (const gchar*) g_ptr_array_index (pkgname_collection, pkgname_index);
			{
				PamacAURInfos* aur_infos = NULL;
				PamacAURPlugin* _tmp0_;
				const gchar* _tmp1_;
				PamacAURInfos* _tmp2_;
				PamacAURInfos* _tmp3_;
				GFile* clone_dir = NULL;
				PamacAURInfos* _tmp4_;
				const gchar* _tmp5_;
				const gchar* _tmp6_;
				GFile* _tmp7_;
				GFile* _tmp8_;
				_tmp0_ = self->priv->aur_plugin;
				_tmp1_ = pkgname;
				_tmp2_ = pamac_aur_plugin_get_infos (_tmp0_, _tmp1_);
				aur_infos = _tmp2_;
				_tmp3_ = aur_infos;
				if (_tmp3_ == NULL) {
					_g_object_unref0 (aur_infos);
					continue;
				}
				_tmp4_ = aur_infos;
				_tmp5_ = pamac_aur_infos_get_packagebase (_tmp4_);
				_tmp6_ = _tmp5_;
				_tmp7_ = pamac_database_clone_build_files (self, _tmp6_, FALSE, NULL);
				clone_dir = _tmp7_;
				_tmp8_ = clone_dir;
				if (_tmp8_ != NULL) {
					GSubprocessLauncher* launcher = NULL;
					GSubprocessLauncher* _tmp9_;
					gchar* cwd = NULL;
					GFile* _tmp10_;
					gchar* _tmp11_;
					GSubprocessLauncher* _tmp12_;
					const gchar* _tmp13_;
					GPtrArray* cmdline = NULL;
					const gchar* _tmp14_;
					GPtrArray* _tmp15_;
					GPtrArray* _tmp16_;
					gchar* _tmp17_;
					GPtrArray* _tmp18_;
					gchar* _tmp19_;
					GPtrArray* _tmp20_;
					gchar* _tmp21_;
					GPtrArray* _tmp22_;
					gchar* _tmp23_;
					GPtrArray* _tmp24_;
					gchar* _tmp25_;
					gint status = 0;
					GSubprocessLauncher* _tmp26_;
					GPtrArray* _tmp27_;
					_tmp9_ = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_SILENCE | G_SUBPROCESS_FLAGS_STDERR_SILENCE);
					launcher = _tmp9_;
					_tmp10_ = clone_dir;
					_tmp11_ = g_file_get_path (_tmp10_);
					cwd = _tmp11_;
					_tmp12_ = launcher;
					_tmp13_ = cwd;
					g_subprocess_launcher_set_cwd (_tmp12_, _tmp13_);
					_tmp14_ = cwd;
					_tmp15_ = pamac_database_get_dynamic_user_cmdline (self, _tmp14_);
					cmdline = _tmp15_;
					_tmp16_ = cmdline;
					_tmp17_ = g_strdup ("makepkg");
					g_ptr_array_add (_tmp16_, _tmp17_);
					_tmp18_ = cmdline;
					_tmp19_ = g_strdup ("--nobuild");
					g_ptr_array_add (_tmp18_, _tmp19_);
					_tmp20_ = cmdline;
					_tmp21_ = g_strdup ("--noprepare");
					g_ptr_array_add (_tmp20_, _tmp21_);
					_tmp22_ = cmdline;
					_tmp23_ = g_strdup ("--nodeps");
					g_ptr_array_add (_tmp22_, _tmp23_);
					_tmp24_ = cmdline;
					_tmp25_ = g_strdup ("--skipinteg");
					g_ptr_array_add (_tmp24_, _tmp25_);
					_tmp26_ = launcher;
					_tmp27_ = cmdline;
					status = pamac_database_launch_subprocess (self, _tmp26_, _tmp27_, NULL);
					if (status == 0) {
						GFile* _tmp28_;
						gchar* _tmp29_;
						gchar* _tmp30_;
						_tmp28_ = clone_dir;
						_tmp29_ = g_file_get_basename (_tmp28_);
						_tmp30_ = _tmp29_;
						pamac_database_regenerate_srcinfo (self, _tmp30_, NULL);
						_g_free0 (_tmp30_);
					}
					_g_ptr_array_unref0 (cmdline);
					_g_free0 (cwd);
					_g_object_unref0 (launcher);
				}
				_g_object_unref0 (clone_dir);
				_g_object_unref0 (aur_infos);
			}
		}
	}
}

static GHashTable*
pamac_database_get_vcs_last_version (PamacDatabase* self,
                                     GPtrArray* vcs_local_pkgs)
{
	GHashTable* pkgnames_table = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	const gchar* real_aur_build_dir = NULL;
	const gchar* _tmp3_;
	GError* _inner_error0_ = NULL;
	GHashTable* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (vcs_local_pkgs != NULL, NULL);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	pkgnames_table = _tmp2_;
	_tmp3_ = pamac_database_get_real_aur_build_dir (self);
	real_aur_build_dir = _tmp3_;
	{
		GPtrArray* pkgname_collection = NULL;
		guint pkgname_index = 0U;
		pkgname_collection = vcs_local_pkgs;
		for (pkgname_index = 0; pkgname_index < pkgname_collection->len; pkgname_index = pkgname_index + 1) {
			const gchar* pkgname = NULL;
			pkgname = (const gchar*) g_ptr_array_index (pkgname_collection, pkgname_index);
			{
				GHashTable* _tmp4_;
				const gchar* _tmp5_;
				GFile* pkgdir = NULL;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				GFile* _tmp10_;
				GFile* _tmp11_;
				GFile* _tmp12_;
				_tmp4_ = self->priv->aur_vcs_pkgs;
				_tmp5_ = pkgname;
				if (g_hash_table_contains (_tmp4_, _tmp5_)) {
					continue;
				}
				_tmp6_ = real_aur_build_dir;
				_tmp7_ = pkgname;
				_tmp8_ = g_build_filename (_tmp6_, _tmp7_, NULL);
				_tmp9_ = _tmp8_;
				_tmp10_ = g_file_new_for_path (_tmp9_);
				_tmp11_ = _tmp10_;
				_g_free0 (_tmp9_);
				pkgdir = _tmp11_;
				_tmp12_ = pkgdir;
				if (g_file_query_exists (_tmp12_, NULL)) {
					GFile* srcinfo = NULL;
					GFile* _tmp13_;
					GFile* _tmp14_;
					_tmp13_ = pkgdir;
					_tmp14_ = g_file_get_child (_tmp13_, ".SRCINFO");
					srcinfo = _tmp14_;
					{
						GFileInputStream* _tmp15_ = NULL;
						GFile* _tmp16_;
						GFileInputStream* _tmp17_;
						GDataInputStream* dis = NULL;
						GDataInputStream* _tmp18_;
						gchar* line = NULL;
						GString* version = NULL;
						GString* _tmp19_;
						_tmp16_ = srcinfo;
						_tmp17_ = g_file_read (_tmp16_, NULL, &_inner_error0_);
						_tmp15_ = _tmp17_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						_tmp18_ = g_data_input_stream_new ((GInputStream*) _tmp15_);
						dis = _tmp18_;
						_tmp19_ = g_string_new ("");
						version = _tmp19_;
						while (TRUE) {
							gchar* _tmp20_ = NULL;
							GDataInputStream* _tmp21_;
							gchar* _tmp22_;
							gchar* _tmp23_;
							const gchar* _tmp24_;
							const gchar* _tmp25_;
							_tmp21_ = dis;
							_tmp22_ = g_data_input_stream_read_line (_tmp21_, NULL, NULL, &_inner_error0_);
							_tmp20_ = _tmp22_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								_g_string_free0 (version);
								_g_free0 (line);
								_g_object_unref0 (dis);
								_g_object_unref0 (_tmp15_);
								goto __catch0_g_error;
							}
							_tmp23_ = _tmp20_;
							_tmp20_ = NULL;
							_g_free0 (line);
							line = _tmp23_;
							_tmp24_ = line;
							if (!(_tmp24_ != NULL)) {
								_g_free0 (_tmp20_);
								break;
							}
							_tmp25_ = line;
							if (string_contains (_tmp25_, "pkgver = ")) {
								GString* _tmp26_;
								const gchar* _tmp27_;
								gchar** _tmp28_;
								gchar** _tmp29_;
								gchar** _tmp30_;
								gint _tmp30__length1;
								const gchar* _tmp31_;
								_tmp26_ = version;
								_tmp27_ = line;
								_tmp29_ = _tmp28_ = g_strsplit (_tmp27_, " = ", 2);
								_tmp30_ = _tmp29_;
								_tmp30__length1 = _vala_array_length (_tmp28_);
								_tmp31_ = _tmp30_[1];
								g_string_append (_tmp26_, _tmp31_);
								_tmp30_ = (_vala_array_free (_tmp30_, _tmp30__length1, (GDestroyNotify) g_free), NULL);
							} else {
								const gchar* _tmp32_;
								_tmp32_ = line;
								if (string_contains (_tmp32_, "pkgrel = ")) {
									GString* _tmp33_;
									GString* _tmp34_;
									const gchar* _tmp35_;
									gchar** _tmp36_;
									gchar** _tmp37_;
									gchar** _tmp38_;
									gint _tmp38__length1;
									const gchar* _tmp39_;
									_tmp33_ = version;
									g_string_append (_tmp33_, "-");
									_tmp34_ = version;
									_tmp35_ = line;
									_tmp37_ = _tmp36_ = g_strsplit (_tmp35_, " = ", 2);
									_tmp38_ = _tmp37_;
									_tmp38__length1 = _vala_array_length (_tmp36_);
									_tmp39_ = _tmp38_[1];
									g_string_append (_tmp34_, _tmp39_);
									_tmp38_ = (_vala_array_free (_tmp38_, _tmp38__length1, (GDestroyNotify) g_free), NULL);
								} else {
									const gchar* _tmp40_;
									_tmp40_ = line;
									if (string_contains (_tmp40_, "epoch = ")) {
										GString* _tmp41_;
										GString* _tmp42_;
										const gchar* _tmp43_;
										gchar** _tmp44_;
										gchar** _tmp45_;
										gchar** _tmp46_;
										gint _tmp46__length1;
										const gchar* _tmp47_;
										_tmp41_ = version;
										g_string_prepend (_tmp41_, ":");
										_tmp42_ = version;
										_tmp43_ = line;
										_tmp45_ = _tmp44_ = g_strsplit (_tmp43_, " = ", 2);
										_tmp46_ = _tmp45_;
										_tmp46__length1 = _vala_array_length (_tmp44_);
										_tmp47_ = _tmp46_[1];
										g_string_prepend (_tmp42_, _tmp47_);
										_tmp46_ = (_vala_array_free (_tmp46_, _tmp46__length1, (GDestroyNotify) g_free), NULL);
									} else {
										const gchar* _tmp48_;
										_tmp48_ = line;
										if (string_contains (_tmp48_, "pkgname = ")) {
											gchar* pkgname_found = NULL;
											const gchar* _tmp49_;
											gchar** _tmp50_;
											gchar** _tmp51_;
											gchar** _tmp52_;
											gint _tmp52__length1;
											const gchar* _tmp53_;
											gchar* _tmp54_;
											gchar* _tmp55_;
											const gchar* _tmp56_;
											GEqualFunc _tmp57_;
											_tmp49_ = line;
											_tmp51_ = _tmp50_ = g_strsplit (_tmp49_, " = ", 2);
											_tmp52_ = _tmp51_;
											_tmp52__length1 = _vala_array_length (_tmp50_);
											_tmp53_ = _tmp52_[1];
											_tmp54_ = g_strdup (_tmp53_);
											_tmp55_ = _tmp54_;
											_tmp52_ = (_vala_array_free (_tmp52_, _tmp52__length1, (GDestroyNotify) g_free), NULL);
											pkgname_found = _tmp55_;
											_tmp56_ = pkgname_found;
											_tmp57_ = g_str_equal;
											if (g_ptr_array_find_with_equal_func (vcs_local_pkgs, _tmp56_, _tmp57_, NULL)) {
												GHashTable* _tmp58_;
												gchar* _tmp59_;
												GString* _tmp60_;
												const gchar* _tmp61_;
												gchar* _tmp62_;
												_tmp58_ = pkgnames_table;
												_tmp59_ = pkgname_found;
												pkgname_found = NULL;
												_tmp60_ = version;
												_tmp61_ = _tmp60_->str;
												_tmp62_ = g_strdup (_tmp61_);
												g_hash_table_insert (_tmp58_, _tmp59_, _tmp62_);
											}
											_g_free0 (pkgname_found);
										}
									}
								}
							}
							_g_free0 (_tmp20_);
						}
						_g_string_free0 (version);
						_g_free0 (line);
						_g_object_unref0 (dis);
						_g_object_unref0 (_tmp15_);
					}
					goto __finally0;
					__catch0_g_error:
					{
						GError* e = NULL;
						GError* _tmp63_;
						const gchar* _tmp64_;
						e = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp63_ = e;
						_tmp64_ = _tmp63_->message;
						g_warning ("database.vala:2229: %s", _tmp64_);
						_g_error_free0 (e);
						_g_object_unref0 (srcinfo);
						_g_object_unref0 (pkgdir);
						continue;
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (srcinfo);
						_g_object_unref0 (pkgdir);
						_g_hash_table_unref0 (pkgnames_table);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
					_g_object_unref0 (srcinfo);
				}
				_g_object_unref0 (pkgdir);
			}
		}
	}
	result = pkgnames_table;
	return result;
}

static void
pamac_database_get_aur_updates_real (PamacDatabase* self,
                                     GPtrArray* aur_infos_list,
                                     GPtrArray* vcs_local_pkgs,
                                     PamacUpdates** updates)
{
	GPtrArray* aur_updates = NULL;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp1_;
	GPtrArray* outofdate = NULL;
	GPtrArray* _tmp2_;
	GPtrArray* _tmp3_;
	GPtrArray* ignored_aur_updates = NULL;
	GPtrArray* _tmp4_;
	GPtrArray* _tmp5_;
	GHashTable* vcs_versions = NULL;
	PamacConfig* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (aur_infos_list != NULL);
	g_return_if_fail (vcs_local_pkgs != NULL);
	g_return_if_fail (*updates != NULL);
	_tmp0_ = pamac_updates_get_aur_updates (*updates);
	_tmp1_ = _tmp0_;
	aur_updates = _tmp1_;
	_tmp2_ = pamac_updates_get_outofdate (*updates);
	_tmp3_ = _tmp2_;
	outofdate = _tmp3_;
	_tmp4_ = pamac_updates_get_ignored_aur_updates (*updates);
	_tmp5_ = _tmp4_;
	ignored_aur_updates = _tmp5_;
	vcs_versions = NULL;
	_tmp6_ = self->priv->_config;
	_tmp7_ = pamac_config_get_check_aur_vcs_updates (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		GHashTable* _tmp9_;
		_tmp9_ = pamac_database_get_vcs_last_version (self, vcs_local_pkgs);
		_g_hash_table_unref0 (vcs_versions);
		vcs_versions = _tmp9_;
	}
	{
		GPtrArray* aur_infos_collection = NULL;
		guint aur_infos_index = 0U;
		aur_infos_collection = aur_infos_list;
		for (aur_infos_index = 0; aur_infos_index < aur_infos_collection->len; aur_infos_index = aur_infos_index + 1) {
			PamacAURInfos* aur_infos = NULL;
			aur_infos = (PamacAURInfos*) g_ptr_array_index (aur_infos_collection, aur_infos_index);
			{
				const gchar* name = NULL;
				PamacAURInfos* _tmp10_;
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				alpm_pkg_t* local_pkg = NULL;
				alpm_handle_t* _tmp13_;
				alpm_db_t* _tmp14_;
				alpm_db_t* _tmp15_;
				const gchar* _tmp16_;
				alpm_pkg_t* _tmp17_;
				const gchar* old_version = NULL;
				alpm_pkg_t* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				const gchar* new_version = NULL;
				PamacAURPackageLinked* aur_pkg = NULL;
				PamacConfig* _tmp21_;
				gboolean _tmp22_;
				gboolean _tmp23_;
				const gchar* _tmp60_;
				const gchar* _tmp61_;
				_tmp10_ = aur_infos;
				_tmp11_ = pamac_aur_infos_get_name (_tmp10_);
				_tmp12_ = _tmp11_;
				name = _tmp12_;
				_tmp13_ = self->priv->alpm_handle;
				_tmp14_ = alpm_get_localdb (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = name;
				_tmp17_ = alpm_db_get_pkg (_tmp15_, _tmp16_);
				local_pkg = _tmp17_;
				_tmp18_ = local_pkg;
				_tmp19_ = alpm_pkg_get_version (_tmp18_);
				_tmp20_ = _tmp19_;
				old_version = _tmp20_;
				_tmp21_ = self->priv->_config;
				_tmp22_ = pamac_config_get_check_aur_vcs_updates (_tmp21_);
				_tmp23_ = _tmp22_;
				if (_tmp23_) {
					GHashTable* _tmp24_;
					const gchar* _tmp25_;
					gconstpointer _tmp26_;
					PamacAURPackageLinked* _tmp27_;
					PamacAURPackageLinked* _tmp28_;
					_tmp24_ = self->priv->aur_vcs_pkgs;
					_tmp25_ = name;
					_tmp26_ = g_hash_table_lookup (_tmp24_, _tmp25_);
					_tmp27_ = _g_object_ref0 ((PamacAURPackageLinked*) _tmp26_);
					_g_object_unref0 (aur_pkg);
					aur_pkg = _tmp27_;
					_tmp28_ = aur_pkg;
					if (_tmp28_ == NULL) {
						const gchar* vcs_version = NULL;
						GHashTable* _tmp29_;
						const gchar* _tmp30_;
						gconstpointer _tmp31_;
						const gchar* _tmp32_;
						PamacAURPackageLinked* _tmp37_;
						PamacAURPackageLinked* _tmp38_;
						PamacAURInfos* _tmp39_;
						alpm_pkg_t* _tmp40_;
						PamacAURPackageLinked* _tmp41_;
						const gchar* _tmp42_;
						GHashTable* _tmp43_;
						const gchar* _tmp44_;
						gchar* _tmp45_;
						PamacAURPackageLinked* _tmp46_;
						PamacAURPackageLinked* _tmp47_;
						_tmp29_ = vcs_versions;
						_tmp30_ = name;
						_tmp31_ = g_hash_table_lookup (_tmp29_, _tmp30_);
						vcs_version = (const gchar*) _tmp31_;
						_tmp32_ = vcs_version;
						if (_tmp32_ != NULL) {
							const gchar* _tmp33_;
							_tmp33_ = vcs_version;
							new_version = _tmp33_;
						} else {
							PamacAURInfos* _tmp34_;
							const gchar* _tmp35_;
							const gchar* _tmp36_;
							_tmp34_ = aur_infos;
							_tmp35_ = pamac_aur_infos_get_version (_tmp34_);
							_tmp36_ = _tmp35_;
							new_version = _tmp36_;
						}
						_tmp37_ = pamac_aur_package_linked_new ();
						_g_object_unref0 (aur_pkg);
						aur_pkg = _tmp37_;
						_tmp38_ = aur_pkg;
						_tmp39_ = aur_infos;
						_tmp40_ = local_pkg;
						pamac_aur_package_linked_initialise_from_aur_infos (_tmp38_, _tmp39_, _tmp40_, self, TRUE);
						_tmp41_ = aur_pkg;
						_tmp42_ = new_version;
						pamac_package_set_version ((PamacPackage*) _tmp41_, _tmp42_);
						_tmp43_ = self->priv->aur_vcs_pkgs;
						_tmp44_ = name;
						_tmp45_ = g_strdup (_tmp44_);
						_tmp46_ = aur_pkg;
						_tmp47_ = _g_object_ref0 (_tmp46_);
						g_hash_table_insert (_tmp43_, _tmp45_, _tmp47_);
					} else {
						PamacAURPackageLinked* _tmp48_;
						const gchar* _tmp49_;
						const gchar* _tmp50_;
						_tmp48_ = aur_pkg;
						_tmp49_ = pamac_package_get_version ((PamacPackage*) _tmp48_);
						_tmp50_ = _tmp49_;
						new_version = _tmp50_;
					}
				} else {
					PamacAURInfos* _tmp51_;
					const gchar* _tmp52_;
					const gchar* _tmp53_;
					PamacAURPackageLinked* _tmp54_;
					PamacAURPackageLinked* _tmp55_;
					PamacAURInfos* _tmp56_;
					alpm_pkg_t* _tmp57_;
					PamacAURPackageLinked* _tmp58_;
					const gchar* _tmp59_;
					_tmp51_ = aur_infos;
					_tmp52_ = pamac_aur_infos_get_version (_tmp51_);
					_tmp53_ = _tmp52_;
					new_version = _tmp53_;
					_tmp54_ = pamac_aur_package_linked_new ();
					_g_object_unref0 (aur_pkg);
					aur_pkg = _tmp54_;
					_tmp55_ = aur_pkg;
					_tmp56_ = aur_infos;
					_tmp57_ = local_pkg;
					pamac_aur_package_linked_initialise_from_aur_infos (_tmp55_, _tmp56_, _tmp57_, self, TRUE);
					_tmp58_ = aur_pkg;
					_tmp59_ = new_version;
					pamac_package_set_version ((PamacPackage*) _tmp58_, _tmp59_);
				}
				_tmp60_ = new_version;
				_tmp61_ = old_version;
				if (alpm_pkg_vercmp (_tmp60_, _tmp61_) == 1) {
					alpm_handle_t* _tmp62_;
					alpm_pkg_t* _tmp63_;
					_tmp62_ = self->priv->alpm_handle;
					_tmp63_ = local_pkg;
					if (alpm_pkg_should_ignore (_tmp62_, _tmp63_) == 1) {
						GPtrArray* _tmp64_;
						PamacAURPackageLinked* _tmp65_;
						PamacAURPackage* _tmp66_;
						_tmp64_ = ignored_aur_updates;
						_tmp65_ = aur_pkg;
						_tmp66_ = _g_object_ref0 ((PamacAURPackage*) _tmp65_);
						g_ptr_array_add (_tmp64_, _tmp66_);
					} else {
						GPtrArray* _tmp67_;
						PamacAURPackageLinked* _tmp68_;
						PamacAURPackage* _tmp69_;
						_tmp67_ = aur_updates;
						_tmp68_ = aur_pkg;
						_tmp69_ = _g_object_ref0 ((PamacAURPackage*) _tmp68_);
						g_ptr_array_add (_tmp67_, _tmp69_);
					}
				} else {
					PamacAURInfos* _tmp70_;
					GDateTime* _tmp71_;
					GDateTime* _tmp72_;
					_tmp70_ = aur_infos;
					_tmp71_ = pamac_aur_infos_get_outofdate (_tmp70_);
					_tmp72_ = _tmp71_;
					if (_tmp72_ != NULL) {
						GPtrArray* _tmp73_;
						PamacAURPackageLinked* _tmp74_;
						PamacAURPackage* _tmp75_;
						_tmp73_ = outofdate;
						_tmp74_ = aur_pkg;
						_tmp75_ = _g_object_ref0 ((PamacAURPackage*) _tmp74_);
						g_ptr_array_add (_tmp73_, _tmp75_);
					}
				}
				_g_object_unref0 (aur_pkg);
			}
		}
	}
	_g_hash_table_unref0 (vcs_versions);
}

static void
pamac_database_get_aur_updates_async_data_free (gpointer _data)
{
	PamacDatabaseGetAurUpdatesAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetAurUpdatesAsyncData, _data_);
}

void
pamac_database_get_aur_updates_async (PamacDatabase* self,
                                      GHashTable* ignorepkgs,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	PamacDatabaseGetAurUpdatesAsyncData* _data_;
	PamacDatabase* _tmp0_;
	GHashTable* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ignorepkgs != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetAurUpdatesAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_aur_updates_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_hash_table_ref0 (ignorepkgs);
	_g_hash_table_unref0 (_data_->ignorepkgs);
	_data_->ignorepkgs = _tmp1_;
	pamac_database_get_aur_updates_async_co (_data_);
}

PamacUpdates*
pamac_database_get_aur_updates_finish (PamacDatabase* self,
                                       GAsyncResult* _res_)
{
	PamacUpdates* result;
	PamacDatabaseGetAurUpdatesAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		PamacDatabase* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->updates);
		_g_hash_table_unref0 (_data28_->ignorepkgs);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static gboolean
_pamac_database_get_aur_updates_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_aur_updates_async_co (self);
	return result;
}

static gint
___lambda32_ (Block28Data* _data28_)
{
	PamacDatabase* self;
	GMainContext* _tmp70_;
	GError* _inner_error0_ = NULL;
	gint result;
	self = _data28_->self;
	{
		AlpmConfig* _tmp0_;
		_tmp0_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			GPtrArray* local_pkgs = NULL;
			GPtrArray* _tmp1_;
			GPtrArray* vcs_local_pkgs = NULL;
			GPtrArray* _tmp2_;
			alpm_list_t* pkgcache = NULL;
			alpm_handle_t* _tmp8_;
			alpm_db_t* _tmp9_;
			alpm_db_t* _tmp10_;
			alpm_list_t* _tmp11_;
			alpm_list_t* _tmp12_;
			PamacAURPlugin* _tmp58_;
			GPtrArray* _tmp59_;
			GPtrArray* _tmp60_;
			GPtrArray* _tmp61_;
			GPtrArray* _tmp62_;
			_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
			local_pkgs = _tmp1_;
			_tmp2_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
			vcs_local_pkgs = _tmp2_;
			{
				GHashTableIter _name_it = {0};
				GHashTableIter _tmp3_ = {0};
				const gchar* name = NULL;
				g_hash_table_iter_init (&_tmp3_, _data28_->ignorepkgs);
				_name_it = _tmp3_;
				while (TRUE) {
					gconstpointer _tmp4_;
					const gchar* _tmp5_;
					alpm_handle_t* _tmp6_;
					const gchar* _tmp7_;
					_tmp4_ = _vala_hash_set_next_value (&_name_it);
					name = (const gchar*) _tmp4_;
					_tmp5_ = name;
					if (!(_tmp5_ != NULL)) {
						break;
					}
					_tmp6_ = self->priv->alpm_handle;
					_tmp7_ = name;
					alpm_option_add_ignorepkg (_tmp6_, _tmp7_);
				}
			}
			_tmp8_ = self->priv->alpm_handle;
			_tmp9_ = alpm_get_localdb (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = alpm_db_get_pkgcache (_tmp10_);
			_tmp12_ = _tmp11_;
			pkgcache = _tmp12_;
			while (TRUE) {
				alpm_list_t* _tmp13_;
				alpm_pkg_t* installed_pkg = NULL;
				alpm_list_t* _tmp14_;
				gconstpointer _tmp15_;
				alpm_pkg_t* pkg = NULL;
				alpm_handle_t* _tmp16_;
				alpm_pkg_t* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				alpm_pkg_t* _tmp20_;
				alpm_pkg_t* _tmp21_;
				_tmp13_ = pkgcache;
				if (!(_tmp13_ != NULL)) {
					break;
				}
				_tmp14_ = pkgcache;
				_tmp15_ = _tmp14_->data;
				installed_pkg = (alpm_pkg_t*) _tmp15_;
				_tmp16_ = self->priv->alpm_handle;
				_tmp17_ = installed_pkg;
				_tmp18_ = alpm_pkg_get_name (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = pamac_database_get_syncpkg (self, _tmp16_, _tmp19_);
				pkg = _tmp20_;
				_tmp21_ = pkg;
				if (_tmp21_ == NULL) {
					gboolean _tmp22_ = FALSE;
					PamacConfig* _tmp23_;
					gboolean _tmp24_;
					gboolean _tmp25_;
					_tmp23_ = self->priv->_config;
					_tmp24_ = pamac_config_get_check_aur_vcs_updates (_tmp23_);
					_tmp25_ = _tmp24_;
					if (_tmp25_) {
						gboolean _tmp26_ = FALSE;
						gboolean _tmp27_ = FALSE;
						gboolean _tmp28_ = FALSE;
						alpm_pkg_t* _tmp29_;
						const gchar* _tmp30_;
						const gchar* _tmp31_;
						_tmp29_ = installed_pkg;
						_tmp30_ = alpm_pkg_get_name (_tmp29_);
						_tmp31_ = _tmp30_;
						if (g_str_has_suffix (_tmp31_, "-git")) {
							_tmp28_ = TRUE;
						} else {
							alpm_pkg_t* _tmp32_;
							const gchar* _tmp33_;
							const gchar* _tmp34_;
							_tmp32_ = installed_pkg;
							_tmp33_ = alpm_pkg_get_name (_tmp32_);
							_tmp34_ = _tmp33_;
							_tmp28_ = g_str_has_suffix (_tmp34_, "-svn");
						}
						if (_tmp28_) {
							_tmp27_ = TRUE;
						} else {
							alpm_pkg_t* _tmp35_;
							const gchar* _tmp36_;
							const gchar* _tmp37_;
							_tmp35_ = installed_pkg;
							_tmp36_ = alpm_pkg_get_name (_tmp35_);
							_tmp37_ = _tmp36_;
							_tmp27_ = g_str_has_suffix (_tmp37_, "-bzr");
						}
						if (_tmp27_) {
							_tmp26_ = TRUE;
						} else {
							alpm_pkg_t* _tmp38_;
							const gchar* _tmp39_;
							const gchar* _tmp40_;
							_tmp38_ = installed_pkg;
							_tmp39_ = alpm_pkg_get_name (_tmp38_);
							_tmp40_ = _tmp39_;
							_tmp26_ = g_str_has_suffix (_tmp40_, "-hg");
						}
						_tmp22_ = _tmp26_;
					} else {
						_tmp22_ = FALSE;
					}
					if (_tmp22_) {
						alpm_handle_t* _tmp41_;
						alpm_pkg_t* _tmp42_;
						_tmp41_ = self->priv->alpm_handle;
						_tmp42_ = installed_pkg;
						if (alpm_pkg_should_ignore (_tmp41_, _tmp42_) == 0) {
							GPtrArray* _tmp43_;
							alpm_pkg_t* _tmp44_;
							const gchar* _tmp45_;
							const gchar* _tmp46_;
							gchar* _tmp47_;
							GPtrArray* _tmp48_;
							alpm_pkg_t* _tmp49_;
							const gchar* _tmp50_;
							const gchar* _tmp51_;
							gchar* _tmp52_;
							_tmp43_ = local_pkgs;
							_tmp44_ = installed_pkg;
							_tmp45_ = alpm_pkg_get_name (_tmp44_);
							_tmp46_ = _tmp45_;
							_tmp47_ = g_strdup (_tmp46_);
							g_ptr_array_add (_tmp43_, _tmp47_);
							_tmp48_ = vcs_local_pkgs;
							_tmp49_ = installed_pkg;
							_tmp50_ = alpm_pkg_get_name (_tmp49_);
							_tmp51_ = _tmp50_;
							_tmp52_ = g_strdup (_tmp51_);
							g_ptr_array_add (_tmp48_, _tmp52_);
						}
					} else {
						GPtrArray* _tmp53_;
						alpm_pkg_t* _tmp54_;
						const gchar* _tmp55_;
						const gchar* _tmp56_;
						gchar* _tmp57_;
						_tmp53_ = local_pkgs;
						_tmp54_ = installed_pkg;
						_tmp55_ = alpm_pkg_get_name (_tmp54_);
						_tmp56_ = _tmp55_;
						_tmp57_ = g_strdup (_tmp56_);
						g_ptr_array_add (_tmp53_, _tmp57_);
					}
				}
				pkgcache = alpm_list_next (pkgcache);
			}
			_tmp58_ = self->priv->aur_plugin;
			_tmp59_ = local_pkgs;
			_tmp60_ = pamac_aur_plugin_get_multi_infos (_tmp58_, _tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = vcs_local_pkgs;
			pamac_database_get_aur_updates_real (self, _tmp61_, _tmp62_, &_data28_->updates);
			_g_ptr_array_unref0 (_tmp61_);
			{
				GHashTableIter _name_it = {0};
				GHashTableIter _tmp63_ = {0};
				const gchar* name = NULL;
				g_hash_table_iter_init (&_tmp63_, _data28_->ignorepkgs);
				_name_it = _tmp63_;
				while (TRUE) {
					gconstpointer _tmp64_;
					const gchar* _tmp65_;
					alpm_handle_t* _tmp66_;
					const gchar* _tmp67_;
					_tmp64_ = _vala_hash_set_next_value (&_name_it);
					name = (const gchar*) _tmp64_;
					_tmp65_ = name;
					if (!(_tmp65_ != NULL)) {
						break;
					}
					_tmp66_ = self->priv->alpm_handle;
					_tmp67_ = name;
					alpm_option_remove_ignorepkg (_tmp66_, _tmp67_);
				}
			}
			_g_ptr_array_unref0 (vcs_local_pkgs);
			_g_ptr_array_unref0 (local_pkgs);
		}
		__finally0:
		{
			AlpmConfig* _tmp68_;
			_tmp68_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gint _tmp69_ = -1;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp69_;
		}
	}
	_tmp70_ = self->priv->_context;
	g_main_context_invoke_full (_tmp70_, G_PRIORITY_DEFAULT, _pamac_database_get_aur_updates_async_co_gsource_func, _data28_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
____lambda32__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ___lambda32_ (self));
	block28_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_aur_updates_async_co (PamacDatabaseGetAurUpdatesAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data28_ = g_slice_new0 (Block28Data);
	_data_->_data28_->_ref_count_ = 1;
	_data_->_data28_->self = g_object_ref (_data_->self);
	_g_hash_table_unref0 (_data_->_data28_->ignorepkgs);
	_data_->_data28_->ignorepkgs = _data_->ignorepkgs;
	_data_->_data28_->_async_data_ = _data_;
	_data_->_tmp0_ = pamac_updates_new ();
	_data_->_data28_->updates = _data_->_tmp0_;
	{
		_data_->_tmp1_ = g_thread_try_new ("get_aur_updates", ____lambda32__gthread_func, block28_data_ref (_data_->_data28_), &_data_->_inner_error0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_g_thread_unref0 (_data_->_tmp2_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_->message;
		g_warning ("database.vala:2334: %s", _data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		block28_data_unref (_data_->_data28_);
		_data_->_data28_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _g_object_ref0 (_data_->_data28_->updates);
	_data_->result = _data_->_tmp5_;
	block28_data_unref (_data_->_data28_);
	_data_->_data28_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_search_snaps_async_data_free (gpointer _data)
{
	PamacDatabaseSearchSnapsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->search_string);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseSearchSnapsAsyncData, _data_);
}

void
pamac_database_search_snaps_async (PamacDatabase* self,
                                   const gchar* search_string,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	PamacDatabaseSearchSnapsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	_data_ = g_slice_new0 (PamacDatabaseSearchSnapsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_search_snaps_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (search_string);
	_g_free0 (_data_->search_string);
	_data_->search_string = _tmp1_;
	pamac_database_search_snaps_async_co (_data_);
}

GPtrArray*
pamac_database_search_snaps_finish (PamacDatabase* self,
                                    GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseSearchSnapsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}

static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		PamacDatabase* self;
		self = _data29_->self;
		_g_ptr_array_unref0 (_data29_->pkgs);
		_g_free0 (_data29_->search_string_down);
		_g_object_unref0 (self);
		g_slice_free (Block29Data, _data29_);
	}
}

static gboolean
_pamac_database_search_snaps_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_search_snaps_async_co (self);
	return result;
}

static gint
____lambda33_ (Block29Data* _data29_)
{
	PamacDatabase* self;
	PamacSnapPlugin* _tmp0_;
	const gchar* _tmp1_;
	GMainContext* _tmp2_;
	gint result;
	self = _data29_->self;
	_tmp0_ = self->priv->snap_plugin;
	_tmp1_ = _data29_->search_string_down;
	pamac_snap_plugin_search_snaps (_tmp0_, _tmp1_, &_data29_->pkgs);
	_tmp2_ = self->priv->_context;
	g_main_context_invoke_full (_tmp2_, G_PRIORITY_DEFAULT, _pamac_database_search_snaps_async_co_gsource_func, _data29_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda33__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda33_ (self));
	block29_data_unref (self);
	return result;
}

static gboolean
pamac_database_search_snaps_async_co (PamacDatabaseSearchSnapsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data29_ = g_slice_new0 (Block29Data);
	_data_->_data29_->_ref_count_ = 1;
	_data_->_data29_->self = g_object_ref (_data_->self);
	_data_->_data29_->_async_data_ = _data_;
	_data_->_tmp0_ = g_utf8_strdown (_data_->search_string, (gssize) -1);
	_data_->_data29_->search_string_down = _data_->_tmp0_;
	_data_->_tmp1_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data29_->pkgs = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->_config;
	_data_->_tmp3_ = pamac_config_get_enable_snap (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (_data_->_tmp4_) {
		{
			_data_->_tmp5_ = g_thread_try_new ("search_snaps", _____lambda33__gthread_func, block29_data_ref (_data_->_data29_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:2351: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block29_data_unref (_data_->_data29_);
			_data_->_data29_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp9_ = _data_->_data29_->pkgs;
	_data_->_tmp10_ = _g_ptr_array_ref0 (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block29_data_unref (_data_->_data29_);
	_data_->_data29_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gboolean
pamac_database_is_installed_snap (PamacDatabase* self,
                                  const gchar* name)
{
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (name != NULL, FALSE);
	_tmp0_ = self->priv->_config;
	_tmp1_ = pamac_config_get_enable_snap (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		PamacSnapPlugin* _tmp3_;
		_tmp3_ = self->priv->snap_plugin;
		result = pamac_snap_plugin_is_installed_snap (_tmp3_, name);
		return result;
	}
	result = FALSE;
	return result;
}

static void
pamac_database_get_snap_async_data_free (gpointer _data)
{
	PamacDatabaseGetSnapAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetSnapAsyncData, _data_);
}

void
pamac_database_get_snap_async (PamacDatabase* self,
                               const gchar* name,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	PamacDatabaseGetSnapAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetSnapAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_snap_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	pamac_database_get_snap_async_co (_data_);
}

PamacSnapPackage*
pamac_database_get_snap_finish (PamacDatabase* self,
                                GAsyncResult* _res_)
{
	PamacSnapPackage* result;
	PamacDatabaseGetSnapAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		PamacDatabase* self;
		self = _data30_->self;
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		PamacDatabase* self;
		self = _data31_->_data30_->self;
		_g_free0 (_data31_->name_copy);
		block30_data_unref (_data31_->_data30_);
		_data31_->_data30_ = NULL;
		g_slice_free (Block31Data, _data31_);
	}
}

static gboolean
_pamac_database_get_snap_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_snap_async_co (self);
	return result;
}

static gint
____lambda34_ (Block31Data* _data31_)
{
	Block30Data* _data30_;
	PamacDatabase* self;
	PamacSnapPlugin* _tmp0_;
	const gchar* _tmp1_;
	PamacSnapPackage* _tmp2_;
	GMainContext* _tmp3_;
	gint result;
	_data30_ = _data31_->_data30_;
	self = _data30_->self;
	_tmp0_ = self->priv->snap_plugin;
	_tmp1_ = _data31_->name_copy;
	_tmp2_ = pamac_snap_plugin_get_snap (_tmp0_, _tmp1_);
	_data30_->pkg = _tmp2_;
	_tmp3_ = self->priv->_context;
	g_main_context_invoke_full (_tmp3_, G_PRIORITY_DEFAULT, _pamac_database_get_snap_async_co_gsource_func, _data30_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda34__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda34_ (self));
	block31_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_snap_async_co (PamacDatabaseGetSnapAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data30_ = g_slice_new0 (Block30Data);
	_data_->_data30_->_ref_count_ = 1;
	_data_->_data30_->self = g_object_ref (_data_->self);
	_data_->_data30_->_async_data_ = _data_;
	_data_->_data30_->pkg = NULL;
	_data_->_tmp0_ = _data_->self->priv->_config;
	_data_->_tmp1_ = pamac_config_get_enable_snap (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		_data_->_data31_ = g_slice_new0 (Block31Data);
		_data_->_data31_->_ref_count_ = 1;
		_data_->_data31_->_data30_ = block30_data_ref (_data_->_data30_);
		_data_->_tmp3_ = g_strdup (_data_->name);
		_data_->_data31_->name_copy = _data_->_tmp3_;
		{
			_data_->_tmp4_ = g_thread_try_new ("get_snap", _____lambda34__gthread_func, block31_data_ref (_data_->_data31_), &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_thread_unref0 (_data_->_tmp5_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_->message;
			g_warning ("database.vala:2376: %s", _data_->_tmp7_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block31_data_unref (_data_->_data31_);
			_data_->_data31_ = NULL;
			block30_data_unref (_data_->_data30_);
			_data_->_data30_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
	}
	_data_->_tmp8_ = _data_->_data30_->pkg;
	_data_->result = _data_->_tmp8_;
	block30_data_unref (_data_->_data30_);
	_data_->_data30_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_installed_snaps_async_data_free (gpointer _data)
{
	PamacDatabaseGetInstalledSnapsAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetInstalledSnapsAsyncData, _data_);
}

void
pamac_database_get_installed_snaps_async (PamacDatabase* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	PamacDatabaseGetInstalledSnapsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetInstalledSnapsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_installed_snaps_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_installed_snaps_async_co (_data_);
}

GPtrArray*
pamac_database_get_installed_snaps_finish (PamacDatabase* self,
                                           GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetInstalledSnapsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		PamacDatabase* self;
		self = _data32_->self;
		_g_ptr_array_unref0 (_data32_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}

static gboolean
_pamac_database_get_installed_snaps_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_installed_snaps_async_co (self);
	return result;
}

static gint
____lambda35_ (Block32Data* _data32_)
{
	PamacDatabase* self;
	PamacSnapPlugin* _tmp0_;
	GMainContext* _tmp1_;
	gint result;
	self = _data32_->self;
	_tmp0_ = self->priv->snap_plugin;
	pamac_snap_plugin_get_installed_snaps (_tmp0_, &_data32_->pkgs);
	_tmp1_ = self->priv->_context;
	g_main_context_invoke_full (_tmp1_, G_PRIORITY_DEFAULT, _pamac_database_get_installed_snaps_async_co_gsource_func, _data32_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda35__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda35_ (self));
	block32_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_installed_snaps_async_co (PamacDatabaseGetInstalledSnapsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data32_ = g_slice_new0 (Block32Data);
	_data_->_data32_->_ref_count_ = 1;
	_data_->_data32_->self = g_object_ref (_data_->self);
	_data_->_data32_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data32_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_snap (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		{
			_data_->_tmp4_ = g_thread_try_new ("get_installed_snaps", _____lambda35__gthread_func, block32_data_ref (_data_->_data32_), &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_thread_unref0 (_data_->_tmp5_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_->message;
			g_warning ("database.vala:2393: %s", _data_->_tmp7_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block32_data_unref (_data_->_data32_);
			_data_->_data32_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp8_ = _data_->_data32_->pkgs;
	_data_->_tmp9_ = _g_ptr_array_ref0 (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	block32_data_unref (_data_->_data32_);
	_data_->_data32_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_installed_snap_icon_async_data_free (gpointer _data)
{
	PamacDatabaseGetInstalledSnapIconAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetInstalledSnapIconAsyncData, _data_);
}

void
pamac_database_get_installed_snap_icon_async (PamacDatabase* self,
                                              const gchar* name,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	PamacDatabaseGetInstalledSnapIconAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetInstalledSnapIconAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_installed_snap_icon_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	pamac_database_get_installed_snap_icon_async_co (_data_);
}

gchar*
pamac_database_get_installed_snap_icon_finish (PamacDatabase* self,
                                               GAsyncResult* _res_)
{
	gchar* result;
	PamacDatabaseGetInstalledSnapIconAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		PamacDatabase* self;
		self = _data33_->self;
		_g_free0 (_data33_->icon);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		PamacDatabase* self;
		self = _data34_->_data33_->self;
		_g_free0 (_data34_->name_copy);
		block33_data_unref (_data34_->_data33_);
		_data34_->_data33_ = NULL;
		g_slice_free (Block34Data, _data34_);
	}
}

static gboolean
_pamac_database_get_installed_snap_icon_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_installed_snap_icon_async_co (self);
	return result;
}

static gint
____lambda36_ (Block34Data* _data34_)
{
	Block33Data* _data33_;
	PamacDatabase* self;
	GMainContext* _tmp9_;
	GError* _inner_error0_ = NULL;
	gint result;
	_data33_ = _data34_->_data33_;
	self = _data33_->self;
	{
		gchar* _tmp0_ = NULL;
		PamacSnapPlugin* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp1_ = self->priv->snap_plugin;
		_tmp2_ = _data34_->name_copy;
		_tmp3_ = pamac_snap_plugin_get_installed_snap_icon (_tmp1_, _tmp2_, &_inner_error0_);
		_tmp0_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp0_;
		_tmp0_ = NULL;
		_g_free0 (_data33_->icon);
		_data33_->icon = _tmp4_;
		_g_free0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = _data34_->name_copy;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("database.vala:2408: %s: %s", _tmp5_, _tmp7_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gint _tmp8_ = -1;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp8_;
	}
	_tmp9_ = self->priv->_context;
	g_main_context_invoke_full (_tmp9_, G_PRIORITY_DEFAULT, _pamac_database_get_installed_snap_icon_async_co_gsource_func, _data33_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda36__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda36_ (self));
	block34_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_installed_snap_icon_async_co (PamacDatabaseGetInstalledSnapIconAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data33_ = g_slice_new0 (Block33Data);
	_data_->_data33_->_ref_count_ = 1;
	_data_->_data33_->self = g_object_ref (_data_->self);
	_data_->_data33_->_async_data_ = _data_;
	_data_->_tmp0_ = g_strdup ("");
	_data_->_data33_->icon = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_snap (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_data34_ = g_slice_new0 (Block34Data);
		_data_->_data34_->_ref_count_ = 1;
		_data_->_data34_->_data33_ = block33_data_ref (_data_->_data33_);
		_data_->_tmp4_ = g_strdup (_data_->name);
		_data_->_data34_->name_copy = _data_->_tmp4_;
		{
			_data_->_tmp5_ = g_thread_try_new ("get_installed_snap_icon", _____lambda36__gthread_func, block34_data_ref (_data_->_data34_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:2415: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block34_data_unref (_data_->_data34_);
			_data_->_data34_ = NULL;
			block33_data_unref (_data_->_data33_);
			_data_->_data33_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block34_data_unref (_data_->_data34_);
		_data_->_data34_ = NULL;
	}
	_data_->_tmp9_ = _data_->_data33_->icon;
	_data_->_tmp10_ = g_strdup (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block33_data_unref (_data_->_data33_);
	_data_->_data33_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_category_snaps_async_data_free (gpointer _data)
{
	PamacDatabaseGetCategorySnapsAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->category);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetCategorySnapsAsyncData, _data_);
}

void
pamac_database_get_category_snaps_async (PamacDatabase* self,
                                         const gchar* category,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	PamacDatabaseGetCategorySnapsAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (category != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetCategorySnapsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_category_snaps_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (category);
	_g_free0 (_data_->category);
	_data_->category = _tmp1_;
	pamac_database_get_category_snaps_async_co (_data_);
}

GPtrArray*
pamac_database_get_category_snaps_finish (PamacDatabase* self,
                                          GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetCategorySnapsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		PamacDatabase* self;
		self = _data35_->self;
		_g_ptr_array_unref0 (_data35_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		PamacDatabase* self;
		self = _data36_->_data35_->self;
		_g_free0 (_data36_->category_copy);
		block35_data_unref (_data36_->_data35_);
		_data36_->_data35_ = NULL;
		g_slice_free (Block36Data, _data36_);
	}
}

static gboolean
_pamac_database_get_category_snaps_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_category_snaps_async_co (self);
	return result;
}

static gint
____lambda37_ (Block36Data* _data36_)
{
	Block35Data* _data35_;
	PamacDatabase* self;
	PamacSnapPlugin* _tmp0_;
	const gchar* _tmp1_;
	GMainContext* _tmp2_;
	gint result;
	_data35_ = _data36_->_data35_;
	self = _data35_->self;
	_tmp0_ = self->priv->snap_plugin;
	_tmp1_ = _data36_->category_copy;
	pamac_snap_plugin_get_category_snaps (_tmp0_, _tmp1_, &_data35_->pkgs);
	_tmp2_ = self->priv->_context;
	g_main_context_invoke_full (_tmp2_, G_PRIORITY_DEFAULT, _pamac_database_get_category_snaps_async_co_gsource_func, _data35_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda37__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda37_ (self));
	block36_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_category_snaps_async_co (PamacDatabaseGetCategorySnapsAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data35_ = g_slice_new0 (Block35Data);
	_data_->_data35_->_ref_count_ = 1;
	_data_->_data35_->self = g_object_ref (_data_->self);
	_data_->_data35_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data35_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_snap (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_data36_ = g_slice_new0 (Block36Data);
		_data_->_data36_->_ref_count_ = 1;
		_data_->_data36_->_data35_ = block35_data_ref (_data_->_data35_);
		_data_->_tmp4_ = g_strdup (_data_->category);
		_data_->_data36_->category_copy = _data_->_tmp4_;
		{
			_data_->_tmp5_ = g_thread_try_new ("get_category_snaps", _____lambda37__gthread_func, block36_data_ref (_data_->_data36_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:2433: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block36_data_unref (_data_->_data36_);
			_data_->_data36_ = NULL;
			block35_data_unref (_data_->_data35_);
			_data_->_data35_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block36_data_unref (_data_->_data36_);
		_data_->_data36_ = NULL;
	}
	_data_->_tmp9_ = _data_->_data35_->pkgs;
	_data_->_tmp10_ = _g_ptr_array_ref0 (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block35_data_unref (_data_->_data35_);
	_data_->_data35_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
pamac_database_refresh_flatpak_appstream_data (PamacDatabase* self)
{
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_config;
	_tmp1_ = pamac_config_get_enable_flatpak (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		PamacFlatpakPlugin* _tmp3_;
		_tmp3_ = self->priv->flatpak_plugin;
		pamac_flatpak_plugin_refresh_appstream_data (_tmp3_);
	}
}

static void
pamac_database_refresh_flatpak_appstream_data_async_data_free (gpointer _data)
{
	PamacDatabaseRefreshFlatpakAppstreamDataAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseRefreshFlatpakAppstreamDataAsyncData, _data_);
}

void
pamac_database_refresh_flatpak_appstream_data_async (PamacDatabase* self,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	PamacDatabaseRefreshFlatpakAppstreamDataAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseRefreshFlatpakAppstreamDataAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_refresh_flatpak_appstream_data_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_refresh_flatpak_appstream_data_async_co (_data_);
}

void
pamac_database_refresh_flatpak_appstream_data_finish (PamacDatabase* self,
                                                      GAsyncResult* _res_)
{
	PamacDatabaseRefreshFlatpakAppstreamDataAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		PamacDatabase* self;
		self = _data37_->self;
		_g_object_unref0 (self);
		g_slice_free (Block37Data, _data37_);
	}
}

static gboolean
_pamac_database_refresh_flatpak_appstream_data_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_refresh_flatpak_appstream_data_async_co (self);
	return result;
}

static gint
____lambda38_ (Block37Data* _data37_)
{
	PamacDatabase* self;
	PamacFlatpakPlugin* _tmp0_;
	GMainContext* _tmp1_;
	gint result;
	self = _data37_->self;
	_tmp0_ = self->priv->flatpak_plugin;
	pamac_flatpak_plugin_refresh_appstream_data (_tmp0_);
	_tmp1_ = self->priv->_context;
	g_main_context_invoke_full (_tmp1_, G_PRIORITY_DEFAULT, _pamac_database_refresh_flatpak_appstream_data_async_co_gsource_func, _data37_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda38__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda38_ (self));
	block37_data_unref (self);
	return result;
}

static gboolean
pamac_database_refresh_flatpak_appstream_data_async_co (PamacDatabaseRefreshFlatpakAppstreamDataAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data37_ = g_slice_new0 (Block37Data);
	_data_->_data37_->_ref_count_ = 1;
	_data_->_data37_->self = g_object_ref (_data_->self);
	_data_->_data37_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_config;
	_data_->_tmp1_ = pamac_config_get_enable_flatpak (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		{
			_data_->_tmp3_ = g_thread_try_new ("refresh_flatpak_appstream_data", _____lambda38__gthread_func, block37_data_ref (_data_->_data37_), &_data_->_inner_error0_);
			_data_->_tmp4_ = _data_->_tmp3_;
			_g_thread_unref0 (_data_->_tmp4_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp5_ = _data_->e;
			_data_->_tmp6_ = _data_->_tmp5_->message;
			g_warning ("database.vala:2455: %s", _data_->_tmp6_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block37_data_unref (_data_->_data37_);
			_data_->_data37_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	block37_data_unref (_data_->_data37_);
	_data_->_data37_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GPtrArray*
pamac_database_get_flatpak_remotes_names (PamacDatabase* self)
{
	GPtrArray* list = NULL;
	GPtrArray* _tmp0_;
	PamacConfig* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GPtrArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	list = _tmp0_;
	_tmp1_ = self->priv->_config;
	_tmp2_ = pamac_config_get_enable_flatpak (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		PamacFlatpakPlugin* _tmp4_;
		_tmp4_ = self->priv->flatpak_plugin;
		pamac_flatpak_plugin_get_remotes_names (_tmp4_, &list);
	}
	result = list;
	return result;
}

static void
pamac_database_get_installed_flatpaks_async_data_free (gpointer _data)
{
	PamacDatabaseGetInstalledFlatpaksAsyncData* _data_;
	_data_ = _data;
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetInstalledFlatpaksAsyncData, _data_);
}

void
pamac_database_get_installed_flatpaks_async (PamacDatabase* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	PamacDatabaseGetInstalledFlatpaksAsyncData* _data_;
	PamacDatabase* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetInstalledFlatpaksAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_installed_flatpaks_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	pamac_database_get_installed_flatpaks_async_co (_data_);
}

GPtrArray*
pamac_database_get_installed_flatpaks_finish (PamacDatabase* self,
                                              GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetInstalledFlatpaksAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block38Data*
block38_data_ref (Block38Data* _data38_)
{
	g_atomic_int_inc (&_data38_->_ref_count_);
	return _data38_;
}

static void
block38_data_unref (void * _userdata_)
{
	Block38Data* _data38_;
	_data38_ = (Block38Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data38_->_ref_count_)) {
		PamacDatabase* self;
		self = _data38_->self;
		_g_ptr_array_unref0 (_data38_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block38Data, _data38_);
	}
}

static gboolean
_pamac_database_get_installed_flatpaks_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_installed_flatpaks_async_co (self);
	return result;
}

static gint
____lambda39_ (Block38Data* _data38_)
{
	PamacDatabase* self;
	PamacFlatpakPlugin* _tmp0_;
	GMainContext* _tmp1_;
	gint result;
	self = _data38_->self;
	_tmp0_ = self->priv->flatpak_plugin;
	pamac_flatpak_plugin_get_installed_flatpaks (_tmp0_, &_data38_->pkgs);
	_tmp1_ = self->priv->_context;
	g_main_context_invoke_full (_tmp1_, G_PRIORITY_DEFAULT, _pamac_database_get_installed_flatpaks_async_co_gsource_func, _data38_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda39__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda39_ (self));
	block38_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_installed_flatpaks_async_co (PamacDatabaseGetInstalledFlatpaksAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data38_ = g_slice_new0 (Block38Data);
	_data_->_data38_->_ref_count_ = 1;
	_data_->_data38_->self = g_object_ref (_data_->self);
	_data_->_data38_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data38_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_flatpak (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		{
			_data_->_tmp4_ = g_thread_try_new ("get_installed_flatpak", _____lambda39__gthread_func, block38_data_ref (_data_->_data38_), &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_thread_unref0 (_data_->_tmp5_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_->message;
			g_warning ("database.vala:2479: %s", _data_->_tmp7_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block38_data_unref (_data_->_data38_);
			_data_->_data38_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp8_ = _data_->_data38_->pkgs;
	_data_->_tmp9_ = _g_ptr_array_ref0 (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	block38_data_unref (_data_->_data38_);
	_data_->_data38_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_search_flatpaks_async_data_free (gpointer _data)
{
	PamacDatabaseSearchFlatpaksAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->search_string);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseSearchFlatpaksAsyncData, _data_);
}

void
pamac_database_search_flatpaks_async (PamacDatabase* self,
                                      const gchar* search_string,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	PamacDatabaseSearchFlatpaksAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (search_string != NULL);
	_data_ = g_slice_new0 (PamacDatabaseSearchFlatpaksAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_search_flatpaks_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (search_string);
	_g_free0 (_data_->search_string);
	_data_->search_string = _tmp1_;
	pamac_database_search_flatpaks_async_co (_data_);
}

GPtrArray*
pamac_database_search_flatpaks_finish (PamacDatabase* self,
                                       GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseSearchFlatpaksAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block39Data*
block39_data_ref (Block39Data* _data39_)
{
	g_atomic_int_inc (&_data39_->_ref_count_);
	return _data39_;
}

static void
block39_data_unref (void * _userdata_)
{
	Block39Data* _data39_;
	_data39_ = (Block39Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data39_->_ref_count_)) {
		PamacDatabase* self;
		self = _data39_->self;
		_g_ptr_array_unref0 (_data39_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block39Data, _data39_);
	}
}

static Block40Data*
block40_data_ref (Block40Data* _data40_)
{
	g_atomic_int_inc (&_data40_->_ref_count_);
	return _data40_;
}

static void
block40_data_unref (void * _userdata_)
{
	Block40Data* _data40_;
	_data40_ = (Block40Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data40_->_ref_count_)) {
		PamacDatabase* self;
		self = _data40_->_data39_->self;
		_g_free0 (_data40_->search_string_down);
		block39_data_unref (_data40_->_data39_);
		_data40_->_data39_ = NULL;
		g_slice_free (Block40Data, _data40_);
	}
}

static gboolean
_pamac_database_search_flatpaks_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_search_flatpaks_async_co (self);
	return result;
}

static gint
____lambda40_ (Block40Data* _data40_)
{
	Block39Data* _data39_;
	PamacDatabase* self;
	PamacFlatpakPlugin* _tmp0_;
	const gchar* _tmp1_;
	GMainContext* _tmp2_;
	gint result;
	_data39_ = _data40_->_data39_;
	self = _data39_->self;
	_tmp0_ = self->priv->flatpak_plugin;
	_tmp1_ = _data40_->search_string_down;
	pamac_flatpak_plugin_search_flatpaks (_tmp0_, _tmp1_, &_data39_->pkgs);
	_tmp2_ = self->priv->_context;
	g_main_context_invoke_full (_tmp2_, G_PRIORITY_DEFAULT, _pamac_database_search_flatpaks_async_co_gsource_func, _data39_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda40__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda40_ (self));
	block40_data_unref (self);
	return result;
}

static gboolean
pamac_database_search_flatpaks_async_co (PamacDatabaseSearchFlatpaksAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data39_ = g_slice_new0 (Block39Data);
	_data_->_data39_->_ref_count_ = 1;
	_data_->_data39_->self = g_object_ref (_data_->self);
	_data_->_data39_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data39_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_flatpak (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_data40_ = g_slice_new0 (Block40Data);
		_data_->_data40_->_ref_count_ = 1;
		_data_->_data40_->_data39_ = block39_data_ref (_data_->_data39_);
		_data_->_tmp4_ = g_utf8_strdown (_data_->search_string, (gssize) -1);
		_data_->_data40_->search_string_down = _data_->_tmp4_;
		{
			_data_->_tmp5_ = g_thread_try_new ("search_flatpaks", _____lambda40__gthread_func, block40_data_ref (_data_->_data40_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:2497: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block40_data_unref (_data_->_data40_);
			_data_->_data40_ = NULL;
			block39_data_unref (_data_->_data39_);
			_data_->_data39_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block40_data_unref (_data_->_data40_);
		_data_->_data40_ = NULL;
	}
	_data_->_tmp9_ = _data_->_data39_->pkgs;
	_data_->_tmp10_ = _g_ptr_array_ref0 (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block39_data_unref (_data_->_data39_);
	_data_->_data39_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gboolean
pamac_database_is_installed_flatpak (PamacDatabase* self,
                                     const gchar* name)
{
	PamacConfig* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (name != NULL, FALSE);
	_tmp0_ = self->priv->_config;
	_tmp1_ = pamac_config_get_enable_flatpak (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		PamacFlatpakPlugin* _tmp3_;
		_tmp3_ = self->priv->flatpak_plugin;
		result = pamac_flatpak_plugin_is_installed_flatpak (_tmp3_, name);
		return result;
	}
	result = FALSE;
	return result;
}

static void
pamac_database_get_flatpak_async_data_free (gpointer _data)
{
	PamacDatabaseGetFlatpakAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetFlatpakAsyncData, _data_);
}

void
pamac_database_get_flatpak_async (PamacDatabase* self,
                                  const gchar* id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	PamacDatabaseGetFlatpakAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetFlatpakAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_flatpak_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (id);
	_g_free0 (_data_->id);
	_data_->id = _tmp1_;
	pamac_database_get_flatpak_async_co (_data_);
}

PamacFlatpakPackage*
pamac_database_get_flatpak_finish (PamacDatabase* self,
                                   GAsyncResult* _res_)
{
	PamacFlatpakPackage* result;
	PamacDatabaseGetFlatpakAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block41Data*
block41_data_ref (Block41Data* _data41_)
{
	g_atomic_int_inc (&_data41_->_ref_count_);
	return _data41_;
}

static void
block41_data_unref (void * _userdata_)
{
	Block41Data* _data41_;
	_data41_ = (Block41Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data41_->_ref_count_)) {
		PamacDatabase* self;
		self = _data41_->self;
		_g_object_unref0 (self);
		g_slice_free (Block41Data, _data41_);
	}
}

static Block42Data*
block42_data_ref (Block42Data* _data42_)
{
	g_atomic_int_inc (&_data42_->_ref_count_);
	return _data42_;
}

static void
block42_data_unref (void * _userdata_)
{
	Block42Data* _data42_;
	_data42_ = (Block42Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data42_->_ref_count_)) {
		PamacDatabase* self;
		self = _data42_->_data41_->self;
		_g_free0 (_data42_->id_copy);
		block41_data_unref (_data42_->_data41_);
		_data42_->_data41_ = NULL;
		g_slice_free (Block42Data, _data42_);
	}
}

static gboolean
_pamac_database_get_flatpak_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_flatpak_async_co (self);
	return result;
}

static gint
____lambda41_ (Block42Data* _data42_)
{
	Block41Data* _data41_;
	PamacDatabase* self;
	PamacFlatpakPlugin* _tmp0_;
	const gchar* _tmp1_;
	PamacFlatpakPackage* _tmp2_;
	GMainContext* _tmp3_;
	gint result;
	_data41_ = _data42_->_data41_;
	self = _data41_->self;
	_tmp0_ = self->priv->flatpak_plugin;
	_tmp1_ = _data42_->id_copy;
	_tmp2_ = pamac_flatpak_plugin_get_flatpak (_tmp0_, _tmp1_);
	_data41_->pkg = _tmp2_;
	_tmp3_ = self->priv->_context;
	g_main_context_invoke_full (_tmp3_, G_PRIORITY_DEFAULT, _pamac_database_get_flatpak_async_co_gsource_func, _data41_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda41__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda41_ (self));
	block42_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_flatpak_async_co (PamacDatabaseGetFlatpakAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data41_ = g_slice_new0 (Block41Data);
	_data_->_data41_->_ref_count_ = 1;
	_data_->_data41_->self = g_object_ref (_data_->self);
	_data_->_data41_->_async_data_ = _data_;
	_data_->_data41_->pkg = NULL;
	_data_->_tmp0_ = _data_->self->priv->_config;
	_data_->_tmp1_ = pamac_config_get_enable_flatpak (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		_data_->_data42_ = g_slice_new0 (Block42Data);
		_data_->_data42_->_ref_count_ = 1;
		_data_->_data42_->_data41_ = block41_data_ref (_data_->_data41_);
		_data_->_tmp3_ = g_strdup (_data_->id);
		_data_->_data42_->id_copy = _data_->_tmp3_;
		{
			_data_->_tmp4_ = g_thread_try_new ("get_flatpak", _____lambda41__gthread_func, block42_data_ref (_data_->_data42_), &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_thread_unref0 (_data_->_tmp5_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_->message;
			g_warning ("database.vala:2522: %s", _data_->_tmp7_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block42_data_unref (_data_->_data42_);
			_data_->_data42_ = NULL;
			block41_data_unref (_data_->_data41_);
			_data_->_data41_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block42_data_unref (_data_->_data42_);
		_data_->_data42_ = NULL;
	}
	_data_->_tmp8_ = _data_->_data41_->pkg;
	_data_->result = _data_->_tmp8_;
	block41_data_unref (_data_->_data41_);
	_data_->_data41_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
pamac_database_get_category_flatpaks_async_data_free (gpointer _data)
{
	PamacDatabaseGetCategoryFlatpaksAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->category);
	_g_ptr_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (PamacDatabaseGetCategoryFlatpaksAsyncData, _data_);
}

void
pamac_database_get_category_flatpaks_async (PamacDatabase* self,
                                            const gchar* category,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	PamacDatabaseGetCategoryFlatpaksAsyncData* _data_;
	PamacDatabase* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (category != NULL);
	_data_ = g_slice_new0 (PamacDatabaseGetCategoryFlatpaksAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, pamac_database_get_category_flatpaks_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (category);
	_g_free0 (_data_->category);
	_data_->category = _tmp1_;
	pamac_database_get_category_flatpaks_async_co (_data_);
}

GPtrArray*
pamac_database_get_category_flatpaks_finish (PamacDatabase* self,
                                             GAsyncResult* _res_)
{
	GPtrArray* result;
	PamacDatabaseGetCategoryFlatpaksAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block43Data*
block43_data_ref (Block43Data* _data43_)
{
	g_atomic_int_inc (&_data43_->_ref_count_);
	return _data43_;
}

static void
block43_data_unref (void * _userdata_)
{
	Block43Data* _data43_;
	_data43_ = (Block43Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data43_->_ref_count_)) {
		PamacDatabase* self;
		self = _data43_->self;
		_g_ptr_array_unref0 (_data43_->pkgs);
		_g_object_unref0 (self);
		g_slice_free (Block43Data, _data43_);
	}
}

static Block44Data*
block44_data_ref (Block44Data* _data44_)
{
	g_atomic_int_inc (&_data44_->_ref_count_);
	return _data44_;
}

static void
block44_data_unref (void * _userdata_)
{
	Block44Data* _data44_;
	_data44_ = (Block44Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data44_->_ref_count_)) {
		PamacDatabase* self;
		self = _data44_->_data43_->self;
		_g_free0 (_data44_->category_copy);
		block43_data_unref (_data44_->_data43_);
		_data44_->_data43_ = NULL;
		g_slice_free (Block44Data, _data44_);
	}
}

static gboolean
_pamac_database_get_category_flatpaks_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = pamac_database_get_category_flatpaks_async_co (self);
	return result;
}

static gint
____lambda42_ (Block44Data* _data44_)
{
	Block43Data* _data43_;
	PamacDatabase* self;
	PamacFlatpakPlugin* _tmp0_;
	const gchar* _tmp1_;
	GMainContext* _tmp2_;
	gint result;
	_data43_ = _data44_->_data43_;
	self = _data43_->self;
	_tmp0_ = self->priv->flatpak_plugin;
	_tmp1_ = _data44_->category_copy;
	pamac_flatpak_plugin_get_category_flatpaks (_tmp0_, _tmp1_, &_data43_->pkgs);
	_tmp2_ = self->priv->_context;
	g_main_context_invoke_full (_tmp2_, G_PRIORITY_DEFAULT, _pamac_database_get_category_flatpaks_async_co_gsource_func, _data43_->_async_data_, NULL);
	result = 0;
	return result;
}

static gpointer
_____lambda42__gthread_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) ____lambda42_ (self));
	block44_data_unref (self);
	return result;
}

static gboolean
pamac_database_get_category_flatpaks_async_co (PamacDatabaseGetCategoryFlatpaksAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data43_ = g_slice_new0 (Block43Data);
	_data_->_data43_->_ref_count_ = 1;
	_data_->_data43_->self = g_object_ref (_data_->self);
	_data_->_data43_->_async_data_ = _data_;
	_data_->_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_data_->_data43_->pkgs = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_config;
	_data_->_tmp2_ = pamac_config_get_enable_flatpak (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_data44_ = g_slice_new0 (Block44Data);
		_data_->_data44_->_ref_count_ = 1;
		_data_->_data44_->_data43_ = block43_data_ref (_data_->_data43_);
		_data_->_tmp4_ = g_strdup (_data_->category);
		_data_->_data44_->category_copy = _data_->_tmp4_;
		{
			_data_->_tmp5_ = g_thread_try_new ("get_category_flatpaks", _____lambda42__gthread_func, block44_data_ref (_data_->_data44_), &_data_->_inner_error0_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_g_thread_unref0 (_data_->_tmp6_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_state_ = 1;
			return FALSE;
			_state_1:
			;
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->message;
			g_warning ("database.vala:2540: %s", _data_->_tmp8_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block44_data_unref (_data_->_data44_);
			_data_->_data44_ = NULL;
			block43_data_unref (_data_->_data43_);
			_data_->_data43_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		block44_data_unref (_data_->_data44_);
		_data_->_data44_ = NULL;
	}
	_data_->_tmp9_ = _data_->_data43_->pkgs;
	_data_->_tmp10_ = _g_ptr_array_ref0 (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	block43_data_unref (_data_->_data43_);
	_data_->_data43_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

PamacConfig*
pamac_database_get_config (PamacDatabase* self)
{
	PamacConfig* result;
	PamacConfig* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_config;
	result = _tmp0_;
	return result;
}

void
pamac_database_set_config (PamacDatabase* self,
                           PamacConfig* value)
{
	PamacConfig* old_value;
	g_return_if_fail (self != NULL);
	old_value = pamac_database_get_config (self);
	if (old_value != value) {
		PamacConfig* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_config);
		self->priv->_config = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pamac_database_properties[PAMAC_DATABASE_CONFIG_PROPERTY]);
	}
}

GMainContext*
pamac_database_get_context (PamacDatabase* self)
{
	GMainContext* result;
	GMainContext* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_context;
	result = _tmp0_;
	return result;
}

static void
pamac_database_set_context (PamacDatabase* self,
                            GMainContext* value)
{
	GMainContext* old_value;
	g_return_if_fail (self != NULL);
	old_value = pamac_database_get_context (self);
	if (old_value != value) {
		self->priv->_context = value;
		g_object_notify_by_pspec ((GObject *) self, pamac_database_properties[PAMAC_DATABASE_CONTEXT_PROPERTY]);
	}
}

gboolean
pamac_database_get_dbs_missing (PamacDatabase* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_dbs_missing;
	return result;
}

static void
pamac_database_set_dbs_missing (PamacDatabase* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = pamac_database_get_dbs_missing (self);
	if (old_value != value) {
		self->priv->_dbs_missing = value;
		g_object_notify_by_pspec ((GObject *) self, pamac_database_properties[PAMAC_DATABASE_DBS_MISSING_PROPERTY]);
	}
}

static gpointer
_alpm_config_ref0 (gpointer self)
{
	return self ? alpm_config_ref (self) : NULL;
}

static void
_cb_evt_alpm_cb_event (void* ctx,
                       alpm_event_t* data)
{
	cb_evt (ctx, data);
}

static void
_pamac_database_____lambda43_ (PamacDatabase* self)
{
	PamacAURPlugin* _tmp0_;
	PamacConfig* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	_tmp0_ = self->priv->aur_plugin;
	_tmp1_ = self->priv->_config;
	_tmp2_ = pamac_config_get_aur_build_dir (_tmp1_);
	_tmp3_ = _tmp2_;
	pamac_aur_plugin_set_real_build_dir (_tmp0_, _tmp3_);
}

static void
__pamac_database_____lambda43__g_object_notify (GObject* _sender,
                                                GParamSpec* pspec,
                                                gpointer self)
{
	_pamac_database_____lambda43_ ((PamacDatabase*) self);
}

static GObject *
pamac_database_constructor (GType type,
                            guint n_construct_properties,
                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PamacDatabase * self;
	PamacConfig* _tmp0_;
	AlpmConfig* _tmp1_;
	AlpmConfig* _tmp2_;
	AlpmConfig* _tmp3_;
	GMainContext* _tmp4_;
	GHashFunc _tmp5_;
	GEqualFunc _tmp6_;
	GHashTable* _tmp7_;
	GHashFunc _tmp8_;
	GEqualFunc _tmp9_;
	GHashTable* _tmp10_;
	GHashFunc _tmp11_;
	GEqualFunc _tmp12_;
	GHashTable* _tmp13_;
	gchar* user_agent = NULL;
	gchar* _tmp14_;
	SoupSession* _tmp15_;
	SoupSession* _tmp16_;
	const gchar* _tmp17_;
	SoupSession* _tmp18_;
	const gchar* _tmp19_;
	PamacConfig* _tmp44_;
	gboolean _tmp45_;
	gboolean _tmp46_;
	PamacConfig* _tmp56_;
	gboolean _tmp57_;
	gboolean _tmp58_;
	PamacConfig* _tmp68_;
	gboolean _tmp69_;
	gboolean _tmp70_;
	PamacConfig* _tmp75_;
	gboolean _tmp76_;
	gboolean _tmp77_;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (pamac_database_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAMAC_TYPE_DATABASE, PamacDatabase);
	_tmp0_ = self->priv->_config;
	_tmp1_ = pamac_config_get_alpm_config (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _alpm_config_ref0 (_tmp2_);
	_alpm_config_unref0 (self->priv->alpm_config);
	self->priv->alpm_config = _tmp3_;
	_tmp4_ = g_main_context_default ();
	pamac_database_set_context (self, _tmp4_);
	_tmp5_ = g_str_hash;
	_tmp6_ = g_str_equal;
	_tmp7_ = g_hash_table_new_full (_tmp5_, _tmp6_, _g_free0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->aur_vcs_pkgs);
	self->priv->aur_vcs_pkgs = _tmp7_;
	_tmp8_ = g_str_hash;
	_tmp9_ = g_str_equal;
	_tmp10_ = g_hash_table_new_full (_tmp8_, _tmp9_, NULL, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->pkgs_cache);
	self->priv->pkgs_cache = _tmp10_;
	_tmp11_ = g_str_hash;
	_tmp12_ = g_str_equal;
	_tmp13_ = g_hash_table_new_full (_tmp11_, _tmp12_, NULL, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->aur_pkgs_cache);
	self->priv->aur_pkgs_cache = _tmp13_;
	_tmp14_ = get_user_agent ();
	user_agent = _tmp14_;
	_tmp15_ = soup_session_new ();
	_g_object_unref0 (self->priv->soup_session);
	self->priv->soup_session = _tmp15_;
	_tmp16_ = self->priv->soup_session;
	_tmp17_ = user_agent;
	soup_session_set_user_agent (_tmp16_, _tmp17_);
	_tmp18_ = self->priv->soup_session;
	soup_session_set_timeout (_tmp18_, (guint) 10);
	_tmp19_ = user_agent;
	g_setenv ("HTTP_USER_AGENT", _tmp19_, TRUE);
	{
		AlpmConfig* _tmp20_;
		_tmp20_ = self->priv->alpm_config;
		g_rec_mutex_lock (&self->priv->__lock_alpm_config);
		{
			AlpmConfig* _tmp21_;
			alpm_handle_t* _tmp22_;
			alpm_handle_t* _tmp23_;
			GHashTable* _tmp40_;
			GHashTable* _tmp41_;
			GHashTable* _tmp42_;
			_tmp21_ = self->priv->alpm_config;
			_tmp22_ = alpm_config_get_handle (_tmp21_, FALSE, FALSE, TRUE);
			_alpm_release0 (self->priv->alpm_handle);
			self->priv->alpm_handle = _tmp22_;
			_tmp23_ = self->priv->alpm_handle;
			if (_tmp23_ == NULL) {
				{
					AlpmConfig* _tmp24_;
					_tmp24_ = self->priv->alpm_config;
					g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
				}
				_g_free0 (user_agent);
				return obj;
			} else {
				alpm_handle_t* _tmp33_;
				AlpmConfig* _tmp34_;
				alpm_handle_t* _tmp35_;
				AlpmConfig* _tmp36_;
				alpm_handle_t* _tmp37_;
				AlpmConfig* _tmp38_;
				alpm_handle_t* _tmp39_;
				{
					GHashTableIter _name_it = {0};
					PamacConfig* _tmp25_;
					GHashTable* _tmp26_;
					GHashTable* _tmp27_;
					GHashTableIter _tmp28_ = {0};
					const gchar* name = NULL;
					_tmp25_ = self->priv->_config;
					_tmp26_ = pamac_config_get_ignorepkgs (_tmp25_);
					_tmp27_ = _tmp26_;
					g_hash_table_iter_init (&_tmp28_, _tmp27_);
					_name_it = _tmp28_;
					while (TRUE) {
						gconstpointer _tmp29_;
						const gchar* _tmp30_;
						alpm_handle_t* _tmp31_;
						const gchar* _tmp32_;
						_tmp29_ = _vala_hash_set_next_value (&_name_it);
						name = (const gchar*) _tmp29_;
						_tmp30_ = name;
						if (!(_tmp30_ != NULL)) {
							break;
						}
						_tmp31_ = self->priv->alpm_handle;
						_tmp32_ = name;
						alpm_option_add_ignorepkg (_tmp31_, _tmp32_);
					}
				}
				_tmp33_ = self->priv->alpm_handle;
				alpm_option_set_eventcb (_tmp33_, _cb_evt_alpm_cb_event, self);
				_tmp34_ = self->priv->alpm_config;
				_tmp35_ = self->priv->alpm_handle;
				alpm_config_register_syncdbs (_tmp34_, _tmp35_);
				_tmp36_ = self->priv->alpm_config;
				_tmp37_ = alpm_config_get_handle (_tmp36_, TRUE, FALSE, TRUE);
				_alpm_release0 (self->priv->files_handle);
				self->priv->files_handle = _tmp37_;
				_tmp38_ = self->priv->alpm_config;
				_tmp39_ = self->priv->files_handle;
				alpm_config_register_syncdbs (_tmp38_, _tmp39_);
			}
			_tmp40_ = self->priv->aur_vcs_pkgs;
			g_hash_table_remove_all (_tmp40_);
			_tmp41_ = self->priv->pkgs_cache;
			g_hash_table_remove_all (_tmp41_);
			_tmp42_ = self->priv->aur_pkgs_cache;
			g_hash_table_remove_all (_tmp42_);
		}
		__finally0:
		{
			AlpmConfig* _tmp43_;
			_tmp43_ = self->priv->alpm_config;
			g_rec_mutex_unlock (&self->priv->__lock_alpm_config);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (user_agent);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
		}
	}
	_tmp44_ = self->priv->_config;
	_tmp45_ = pamac_config_get_support_aur (_tmp44_);
	_tmp46_ = _tmp45_;
	if (_tmp46_) {
		PamacConfig* _tmp47_;
		PamacAURPlugin* _tmp48_;
		PamacAURPlugin* _tmp49_;
		_tmp47_ = self->priv->_config;
		_tmp48_ = pamac_config_get_aur_plugin (_tmp47_);
		_g_object_unref0 (self->priv->aur_plugin);
		self->priv->aur_plugin = _tmp48_;
		_tmp49_ = self->priv->aur_plugin;
		if (_tmp49_ == NULL) {
			PamacConfig* _tmp50_;
			_tmp50_ = self->priv->_config;
			pamac_config_set_enable_aur (_tmp50_, FALSE);
		} else {
			PamacAURPlugin* _tmp51_;
			PamacConfig* _tmp52_;
			const gchar* _tmp53_;
			const gchar* _tmp54_;
			PamacConfig* _tmp55_;
			_tmp51_ = self->priv->aur_plugin;
			_tmp52_ = self->priv->_config;
			_tmp53_ = pamac_config_get_aur_build_dir (_tmp52_);
			_tmp54_ = _tmp53_;
			pamac_aur_plugin_set_real_build_dir (_tmp51_, _tmp54_);
			_tmp55_ = self->priv->_config;
			g_signal_connect_object ((GObject*) _tmp55_, "notify::aur-build-dir", (GCallback) __pamac_database_____lambda43__g_object_notify, self, 0);
		}
	}
	_tmp56_ = self->priv->_config;
	_tmp57_ = pamac_config_get_support_appstream (_tmp56_);
	_tmp58_ = _tmp57_;
	if (_tmp58_) {
		PamacConfig* _tmp59_;
		PamacAppstreamPlugin* _tmp60_;
		PamacAppstreamPlugin* _tmp61_;
		_tmp59_ = self->priv->_config;
		_tmp60_ = pamac_config_get_appstream_plugin (_tmp59_);
		_g_object_unref0 (self->priv->appstream_plugin);
		self->priv->appstream_plugin = _tmp60_;
		_tmp61_ = self->priv->appstream_plugin;
		if (_tmp61_ == NULL) {
			PamacConfig* _tmp62_;
			_tmp62_ = self->priv->_config;
			pamac_config_set_enable_appstream (_tmp62_, FALSE);
		} else {
			PamacConfig* _tmp63_;
			gboolean _tmp64_;
			gboolean _tmp65_;
			_tmp63_ = self->priv->_config;
			_tmp64_ = pamac_config_get_enable_appstream (_tmp63_);
			_tmp65_ = _tmp64_;
			if (_tmp65_) {
				PamacAppstreamPlugin* _tmp66_;
				GPtrArray* _tmp67_;
				_tmp66_ = self->priv->appstream_plugin;
				_tmp67_ = pamac_database_get_repos_names (self);
				pamac_appstream_plugin_load (_tmp66_, _tmp67_);
			}
		}
	}
	_tmp68_ = self->priv->_config;
	_tmp69_ = pamac_config_get_support_snap (_tmp68_);
	_tmp70_ = _tmp69_;
	if (_tmp70_) {
		PamacConfig* _tmp71_;
		PamacSnapPlugin* _tmp72_;
		PamacSnapPlugin* _tmp73_;
		_tmp71_ = self->priv->_config;
		_tmp72_ = pamac_config_get_snap_plugin (_tmp71_);
		_g_object_unref0 (self->priv->snap_plugin);
		self->priv->snap_plugin = _tmp72_;
		_tmp73_ = self->priv->snap_plugin;
		if (_tmp73_ == NULL) {
			PamacConfig* _tmp74_;
			_tmp74_ = self->priv->_config;
			pamac_config_set_enable_snap (_tmp74_, FALSE);
		}
	}
	_tmp75_ = self->priv->_config;
	_tmp76_ = pamac_config_get_support_flatpak (_tmp75_);
	_tmp77_ = _tmp76_;
	if (_tmp77_) {
		PamacConfig* _tmp78_;
		PamacFlatpakPlugin* _tmp79_;
		PamacFlatpakPlugin* _tmp80_;
		_tmp78_ = self->priv->_config;
		_tmp79_ = pamac_config_get_flatpak_plugin (_tmp78_);
		_g_object_unref0 (self->priv->flatpak_plugin);
		self->priv->flatpak_plugin = _tmp79_;
		_tmp80_ = self->priv->flatpak_plugin;
		if (_tmp80_ == NULL) {
			PamacConfig* _tmp81_;
			_tmp81_ = self->priv->_config;
			pamac_config_set_enable_flatpak (_tmp81_, FALSE);
		} else {
			PamacFlatpakPlugin* _tmp82_;
			PamacConfig* _tmp83_;
			guint64 _tmp84_;
			guint64 _tmp85_;
			PamacConfig* _tmp86_;
			gboolean _tmp87_;
			gboolean _tmp88_;
			_tmp82_ = self->priv->flatpak_plugin;
			_tmp83_ = self->priv->_config;
			_tmp84_ = pamac_config_get_refresh_period (_tmp83_);
			_tmp85_ = _tmp84_;
			pamac_flatpak_plugin_set_refresh_period (_tmp82_, _tmp85_);
			_tmp86_ = self->priv->_config;
			_tmp87_ = pamac_config_get_enable_flatpak (_tmp86_);
			_tmp88_ = _tmp87_;
			if (_tmp88_) {
				PamacFlatpakPlugin* _tmp89_;
				_tmp89_ = self->priv->flatpak_plugin;
				pamac_flatpak_plugin_load_appstream_data (_tmp89_);
			}
		}
	}
	_g_free0 (user_agent);
	return obj;
}

static void
pamac_database_class_init (PamacDatabaseClass * klass,
                           gpointer klass_data)
{
	pamac_database_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PamacDatabase_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_pamac_database_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_pamac_database_set_property;
	G_OBJECT_CLASS (klass)->constructor = pamac_database_constructor;
	G_OBJECT_CLASS (klass)->finalize = pamac_database_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_DATABASE_CONFIG_PROPERTY, pamac_database_properties[PAMAC_DATABASE_CONFIG_PROPERTY] = g_param_spec_object ("config", "config", "config", PAMAC_TYPE_CONFIG, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_DATABASE_CONTEXT_PROPERTY, pamac_database_properties[PAMAC_DATABASE_CONTEXT_PROPERTY] = g_param_spec_boxed ("context", "context", "context", G_TYPE_MAIN_CONTEXT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_DATABASE_DBS_MISSING_PROPERTY, pamac_database_properties[PAMAC_DATABASE_DBS_MISSING_PROPERTY] = g_param_spec_boolean ("dbs-missing", "dbs-missing", "dbs-missing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	pamac_database_signals[PAMAC_DATABASE_GET_UPDATES_PROGRESS_SIGNAL] = g_signal_new ("get-updates-progress", PAMAC_TYPE_DATABASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
	pamac_database_signals[PAMAC_DATABASE_EMIT_WARNING_SIGNAL] = g_signal_new ("emit-warning", PAMAC_TYPE_DATABASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
pamac_database_instance_init (PamacDatabase * self,
                              gpointer klass)
{
	self->priv = pamac_database_get_instance_private (self);
	g_rec_mutex_init (&self->priv->__lock_alpm_config);
	self->vercmp = _alpm_pkg_vercmp_gcompare_func;
}

static void
pamac_database_finalize (GObject * obj)
{
	PamacDatabase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAMAC_TYPE_DATABASE, PamacDatabase);
	g_rec_mutex_clear (&self->priv->__lock_alpm_config);
	_alpm_config_unref0 (self->priv->alpm_config);
	_alpm_release0 (self->priv->alpm_handle);
	_alpm_release0 (self->priv->files_handle);
	_g_hash_table_unref0 (self->priv->aur_vcs_pkgs);
	_g_hash_table_unref0 (self->priv->pkgs_cache);
	_g_hash_table_unref0 (self->priv->aur_pkgs_cache);
	_g_ptr_array_unref0 (self->priv->mirrors_countries);
	_g_free0 (self->priv->mirrors_choosen_country);
	_g_ptr_array_unref0 (self->priv->groups_names);
	_g_ptr_array_unref0 (self->priv->repos_names);
	_g_ptr_array_unref0 (self->priv->categories_names);
	_g_object_unref0 (self->priv->aur_plugin);
	_g_object_unref0 (self->priv->appstream_plugin);
	_g_object_unref0 (self->priv->snap_plugin);
	_g_object_unref0 (self->priv->flatpak_plugin);
	_g_object_unref0 (self->priv->soup_session);
	_g_object_unref0 (self->priv->_config);
	G_OBJECT_CLASS (pamac_database_parent_class)->finalize (obj);
}

static GType
pamac_database_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PamacDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pamac_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PamacDatabase), 0, (GInstanceInitFunc) pamac_database_instance_init, NULL };
	GType pamac_database_type_id;
	pamac_database_type_id = g_type_register_static (G_TYPE_OBJECT, "PamacDatabase", &g_define_type_info, 0);
	PamacDatabase_private_offset = g_type_add_instance_private (pamac_database_type_id, sizeof (PamacDatabasePrivate));
	return pamac_database_type_id;
}

GType
pamac_database_get_type (void)
{
	static volatile gsize pamac_database_type_id__once = 0;
	if (g_once_init_enter (&pamac_database_type_id__once)) {
		GType pamac_database_type_id;
		pamac_database_type_id = pamac_database_get_type_once ();
		g_once_init_leave (&pamac_database_type_id__once, pamac_database_type_id);
	}
	return pamac_database_type_id__once;
}

static void
_vala_pamac_database_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	PamacDatabase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PAMAC_TYPE_DATABASE, PamacDatabase);
	switch (property_id) {
		case PAMAC_DATABASE_CONFIG_PROPERTY:
		g_value_set_object (value, pamac_database_get_config (self));
		break;
		case PAMAC_DATABASE_CONTEXT_PROPERTY:
		g_value_set_boxed (value, pamac_database_get_context (self));
		break;
		case PAMAC_DATABASE_DBS_MISSING_PROPERTY:
		g_value_set_boolean (value, pamac_database_get_dbs_missing (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_pamac_database_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	PamacDatabase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PAMAC_TYPE_DATABASE, PamacDatabase);
	switch (property_id) {
		case PAMAC_DATABASE_CONFIG_PROPERTY:
		pamac_database_set_config (self, g_value_get_object (value));
		break;
		case PAMAC_DATABASE_CONTEXT_PROPERTY:
		pamac_database_set_context (self, g_value_get_boxed (value));
		break;
		case PAMAC_DATABASE_DBS_MISSING_PROPERTY:
		pamac_database_set_dbs_missing (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gint
alpm_pkg_compare_name (alpm_pkg_t* pkg_a,
                       alpm_pkg_t* pkg_b)
{
	GCompareFunc _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gint result;
	g_return_val_if_fail (pkg_a != NULL, 0);
	g_return_val_if_fail (pkg_b != NULL, 0);
	_tmp0_ = ((GCompareFunc) g_strcmp0);
	_tmp1_ = alpm_pkg_get_name (pkg_a);
	_tmp2_ = _tmp1_;
	_tmp3_ = alpm_pkg_get_name (pkg_b);
	_tmp4_ = _tmp3_;
	result = _tmp0_ (_tmp2_, _tmp4_);
	return result;
}

gint
pkg_compare_name (PamacPackage* pkg_a,
                  PamacPackage* pkg_b)
{
	GCompareFunc _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gint result;
	g_return_val_if_fail (pkg_a != NULL, 0);
	g_return_val_if_fail (pkg_b != NULL, 0);
	_tmp0_ = ((GCompareFunc) g_strcmp0);
	_tmp1_ = pamac_package_get_name (pkg_a);
	_tmp2_ = _tmp1_;
	_tmp3_ = pamac_package_get_name (pkg_b);
	_tmp4_ = _tmp3_;
	result = _tmp0_ (_tmp2_, _tmp4_);
	return result;
}

void
cb_evt (void* ctx,
        alpm_event_t* data)
{
	g_return_if_fail (data != NULL);
	switch (data->type) {
		case ALPM_EVENT_DATABASE_MISSING:
		{
			PamacDatabase* database = NULL;
			PamacDatabase* _tmp0_;
			PamacDatabase* _tmp1_;
			_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (ctx, PAMAC_TYPE_DATABASE, PamacDatabase));
			database = _tmp0_;
			_tmp1_ = database;
			pamac_database_set_dbs_missing (_tmp1_, TRUE);
			_g_object_unref0 (database);
			break;
		}
		default:
		{
			break;
		}
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

