update deprecated code

This commit is contained in:
Chris Cromer 2019-07-06 20:28:51 -04:00
parent d7cf388ece
commit 3b66f68b2c
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
38 changed files with 592 additions and 361 deletions

View File

@ -11,7 +11,6 @@ find_program ('glib-compile-resources')
find_program ('gtk-update-icon-cache', 'gtk-update-icon-cache.3.0') find_program ('gtk-update-icon-cache', 'gtk-update-icon-cache.3.0')
find_program ('glib-compile-schemas') find_program ('glib-compile-schemas')
find_program ('g-ir-compiler') find_program ('g-ir-compiler')
gdk_3_0_dep = dependency('gdk-3.0')
gtk_3_0_dep = dependency('gtk+-3.0') gtk_3_0_dep = dependency('gtk+-3.0')
json_glib_1_0_dep = dependency('json-glib-1.0') json_glib_1_0_dep = dependency('json-glib-1.0')
libalpm_dep = dependency('libalpm') libalpm_dep = dependency('libalpm')
@ -19,13 +18,19 @@ libcurl_dep = dependency('libcurl')
libnotify_dep = dependency('libnotify') libnotify_dep = dependency('libnotify')
libsoup_2_4_dep = dependency('libsoup-2.4') libsoup_2_4_dep = dependency('libsoup-2.4')
polkit_gobject_1_dep = dependency('polkit-gobject-1') polkit_gobject_1_dep = dependency('polkit-gobject-1')
vte_2_91_dep = dependency('vte-2.91')
if KDE_TRAY if KDE_TRAY
appindicator3_0_1_dep = dependency('appindicator3-0.1') appindicator3_0_1_dep = dependency('appindicator3-0.1')
endif endif
atk_dep = dependency('atk')
cairo_dep = dependency('cairo')
gdk_3_0_dep = dependency('gdk-3.0')
gdk_pixbuf_2_0_dep = dependency('gdk-pixbuf-2.0')
gio_2_0_dep = dependency('gio-2.0') gio_2_0_dep = dependency('gio-2.0')
glib_2_0_dep = dependency('glib-2.0') glib_2_0_dep = dependency('glib-2.0')
gobject_2_0_dep = dependency('gobject-2.0') gobject_2_0_dep = dependency('gobject-2.0')
pango_dep = dependency('pango')
vte_2_91_dep = dependency('vte-2.91')
x11_dep = dependency('x11')
subdir('po') subdir('po')
cfg_dbus_data = configuration_data() cfg_dbus_data = configuration_data()

View File

@ -1,8 +1,8 @@
### AutoVala Project ### ### AutoVala Project ###
autovala_version: 30 autovala_version: 30
project_name: pamac project_name: pamac
project_version: 6.7.2 project_version: 7.0.0
vala_version: 0.38 vala_version: 0.44
custom: data/systemd/pamac-system.service /usr/lib/systemd/system custom: data/systemd/pamac-system.service /usr/lib/systemd/system
custom: data/systemd/pamac-cleancache.service /usr/lib/systemd/system custom: data/systemd/pamac-cleancache.service /usr/lib/systemd/system
@ -22,20 +22,20 @@ define: KDE_TRAY
vapidir: src/vapis vapidir: src/vapis
vala_binary: src/pamac-clean-cache/pamac-clean-cache vala_binary: src/pamac-clean-cache/pamac-clean-cache
*version: 6.7.2 *version: 7.0.0
vala_local_package: pamacclassic vala_local_package: Pamac
vala_vapi: ../vapis/libalpm.vapi
vala_package: posix vala_package: posix
vala_check_package: gtk+-3.0 vala_check_package: gtk+-3.0
vala_check_package: json-glib-1.0 vala_check_package: json-glib-1.0
*vala_check_package: glib-2.0 *vala_check_package: glib-2.0
*vala_check_package: gobject-2.0
*vala_source: clean_cache.vala *vala_source: clean_cache.vala
*vala_source: pamac_config.vala
vala_binary: src/pamac-install/pamac-install vala_binary: src/pamac-install/pamac-install
*version: 6.7.2 *version: 7.0.0
use_gresource: pamac_installer_gresource_xml use_gresource: pamac_installer_gresource_xml
vala_local_package: pamacclassic vala_local_package: Pamac
vala_vapi: ../vapis/libalpm.vapi
vala_check_package: gtk+-3.0 vala_check_package: gtk+-3.0
vala_check_package: json-glib-1.0 vala_check_package: json-glib-1.0
*vala_check_package: gio-2.0 *vala_check_package: gio-2.0
@ -45,10 +45,11 @@ vala_check_package: json-glib-1.0
*vala_source: progress_dialog.vala *vala_source: progress_dialog.vala
vala_binary: src/pamac-manager/pamac-manager vala_binary: src/pamac-manager/pamac-manager
*version: 6.7.2 *version: 7.0.0
alias: pamac-updater alias: pamac-updater
use_gresource: pamac_manager_gresource_xml use_gresource: pamac_manager_gresource_xml
vala_local_package: pamacclassic vala_local_package: Pamac
vala_vapi: ../vapis/libalpm.vapi
vala_check_package: gtk+-3.0 vala_check_package: gtk+-3.0
vala_check_package: json-glib-1.0 vala_check_package: json-glib-1.0
*vala_check_package: gio-2.0 *vala_check_package: gio-2.0
@ -59,8 +60,8 @@ vala_check_package: json-glib-1.0
*vala_source: manager_window.vala *vala_source: manager_window.vala
vala_binary: src/pamac-system-daemon/pamac-system-daemon vala_binary: src/pamac-system-daemon/pamac-system-daemon
*version: 6.7.2 *version: 7.0.0
vala_local_package: pamacclassic vala_local_package: Pamac
vala_package: posix vala_package: posix
vala_check_package: gtk+-3.0 vala_check_package: gtk+-3.0
vala_check_package: json-glib-1.0 vala_check_package: json-glib-1.0
@ -71,14 +72,11 @@ vala_check_package: polkit-gobject-1
*vala_check_package: gio-2.0 *vala_check_package: gio-2.0
*vala_check_package: glib-2.0 *vala_check_package: glib-2.0
*vala_check_package: gobject-2.0 *vala_check_package: gobject-2.0
*vala_source: alpm_config.vala
*vala_source: mirrors_config.vala
*vala_source: pamac_config.vala
*vala_source: system_daemon.vala *vala_source: system_daemon.vala
vala_binary: src/pamac-tray/pamac-tray vala_binary: src/pamac-tray/pamac-tray
*version: 6.7.2 *version: 7.0.0
vala_local_package: pamacclassic vala_local_package: Pamac
vala_package: posix vala_package: posix
vala_check_package: json-glib-1.0 vala_check_package: json-glib-1.0
vala_check_package: libalpm vala_check_package: libalpm
@ -96,13 +94,11 @@ vala_source: tray-appindicator.vala
else else
vala_source: tray-gtk.vala vala_source: tray-gtk.vala
end end
*vala_source: alpm_config.vala
*vala_source: pamac_config.vala
*vala_source: tray.vala *vala_source: tray.vala
vala_binary: src/pamac-user-daemon/pamac-user-daemon vala_binary: src/pamac-user-daemon/pamac-user-daemon
*version: 6.7.2 *version: 7.0.0
vala_local_package: pamacclassic vala_local_package: Pamac
vala_package: posix vala_package: posix
vala_check_package: gtk+-3.0 vala_check_package: gtk+-3.0
vala_check_package: json-glib-1.0 vala_check_package: json-glib-1.0
@ -111,31 +107,31 @@ vala_check_package: libsoup-2.4
*vala_check_package: gio-2.0 *vala_check_package: gio-2.0
*vala_check_package: glib-2.0 *vala_check_package: glib-2.0
*vala_check_package: gobject-2.0 *vala_check_package: gobject-2.0
*vala_source: alpm_config.vala
*vala_source: pamac_config.vala
*vala_source: user_daemon.vala *vala_source: user_daemon.vala
vala_library: src/pamac-classic vala_library: src/pamac
*version: 6.7.2 *version: 7.0.0
namespace: pamacclassic *namespace: Pamac
use_gresource: pamac_transaction_gresource_xml use_gresource: pamac_transaction_gresource_xml
vala_package: posix *vala_package: posix
vala_check_package: gdk-3.0 *vala_check_package: atk
vala_check_package: gtk+-3.0 *vala_check_package: cairo
vala_check_package: json-glib-1.0 *vala_check_package: gdk-3.0
vala_check_package: libalpm *vala_check_package: gdk-pixbuf-2.0
vala_check_package: libnotify
vala_check_package: libsoup-2.4
vala_check_package: vte-2.91
*vala_check_package: gio-2.0 *vala_check_package: gio-2.0
*vala_check_package: glib-2.0 *vala_check_package: glib-2.0
*vala_check_package: gobject-2.0 *vala_check_package: gobject-2.0
*vala_check_package: gtk+-3.0
*vala_check_package: json-glib-1.0
*vala_check_package: libalpm
*vala_check_package: libsoup-2.4
*vala_check_package: pango
*vala_check_package: vte-2.91
*vala_check_package: x11
*c_library: m *c_library: m
if NOT DISABLE_AUR
vala_source: aur.vala
end
*vala_source: alpm_config.vala *vala_source: alpm_config.vala
*vala_source: aur.vala
*vala_source: choose_ignorepkgs_dialog.vala *vala_source: choose_ignorepkgs_dialog.vala
*vala_source: choose_provider_dialog.vala *vala_source: choose_provider_dialog.vala
*vala_source: common.vala *vala_source: common.vala
@ -166,23 +162,15 @@ end
*translate: vala src/mirrors_config.vala *translate: vala src/mirrors_config.vala
*translate: vala src/package.vala *translate: vala src/package.vala
*translate: vala src/pamac-clean-cache/clean_cache.vala *translate: vala src/pamac-clean-cache/clean_cache.vala
*translate: vala src/pamac-clean-cache/pamac_config.vala
*translate: vala src/pamac-install/installer.vala *translate: vala src/pamac-install/installer.vala
*translate: vala src/pamac-install/progress_dialog.vala *translate: vala src/pamac-install/progress_dialog.vala
*translate: vala src/pamac-manager/history_dialog.vala *translate: vala src/pamac-manager/history_dialog.vala
*translate: vala src/pamac-manager/manager.vala *translate: vala src/pamac-manager/manager.vala
*translate: vala src/pamac-manager/manager_window.vala *translate: vala src/pamac-manager/manager_window.vala
*translate: vala src/pamac-system-daemon/alpm_config.vala
*translate: vala src/pamac-system-daemon/mirrors_config.vala
*translate: vala src/pamac-system-daemon/pamac_config.vala
*translate: vala src/pamac-system-daemon/system_daemon.vala *translate: vala src/pamac-system-daemon/system_daemon.vala
*translate: vala src/pamac-tray/alpm_config.vala
*translate: vala src/pamac-tray/pamac_config.vala
*translate: vala src/pamac-tray/tray-appindicator.vala *translate: vala src/pamac-tray/tray-appindicator.vala
*translate: vala src/pamac-tray/tray-gtk.vala *translate: vala src/pamac-tray/tray-gtk.vala
*translate: vala src/pamac-tray/tray.vala *translate: vala src/pamac-tray/tray.vala
*translate: vala src/pamac-user-daemon/alpm_config.vala
*translate: vala src/pamac-user-daemon/pamac_config.vala
*translate: vala src/pamac-user-daemon/user_daemon.vala *translate: vala src/pamac-user-daemon/user_daemon.vala
*translate: vala src/pamac_config.vala *translate: vala src/pamac_config.vala
*translate: vala src/preferences_dialog.vala *translate: vala src/preferences_dialog.vala

View File

@ -1,24 +1,16 @@
src/pamac-clean-cache/clean_cache.vala src/pamac-clean-cache/clean_cache.vala
src/pamac-clean-cache/pamac_config.vala
src/pamac-install/installer.vala src/pamac-install/installer.vala
src/pamac-install/progress_dialog.vala src/pamac-install/progress_dialog.vala
src/pamac-manager/history_dialog.vala src/pamac-manager/history_dialog.vala
src/pamac-manager/manager.vala src/pamac-manager/manager.vala
src/pamac-manager/manager_window.vala src/pamac-manager/manager_window.vala
src/pamac-system-daemon/alpm_config.vala
src/pamac-system-daemon/mirrors_config.vala
src/pamac-system-daemon/pamac_config.vala
src/pamac-system-daemon/system_daemon.vala src/pamac-system-daemon/system_daemon.vala
src/pamac-tray/tray-appindicator.vala src/pamac-tray/tray-appindicator.vala
src/pamac-tray/tray-gtk.vala src/pamac-tray/tray-gtk.vala
src/pamac-tray/alpm_config.vala
src/pamac-tray/pamac_config.vala
src/pamac-tray/tray.vala src/pamac-tray/tray.vala
src/pamac-user-daemon/alpm_config.vala
src/pamac-user-daemon/pamac_config.vala
src/pamac-user-daemon/user_daemon.vala src/pamac-user-daemon/user_daemon.vala
src/aur.vala
src/alpm_config.vala src/alpm_config.vala
src/aur.vala
src/choose_ignorepkgs_dialog.vala src/choose_ignorepkgs_dialog.vala
src/choose_provider_dialog.vala src/choose_provider_dialog.vala
src/common.vala src/common.vala

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Pamac\n" "Project-Id-Version: Pamac\n"
"Report-Msgid-Bugs-To: cromer@cromnix.org\n" "Report-Msgid-Bugs-To: cromer@cromnix.org\n"
"POT-Creation-Date: 2019-06-29 12:27-0400\n" "POT-Creation-Date: 2019-07-06 20:25-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -1,4 +1,4 @@
namespace pamacclassic { namespace Pamac {
public const string DATADIR = "@DATADIR@"; public const string DATADIR = "@DATADIR@";
public const string PKGDATADIR = "@PKGDATADIR@"; public const string PKGDATADIR = "@PKGDATADIR@";
public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";

View File

@ -1,11 +1,15 @@
posix posix
atk
cairo
gdk-3.0 gdk-3.0
gtk+-3.0 gdk-pixbuf-2.0
json-glib-1.0
libalpm
libnotify
libsoup-2.4
vte-2.91
gio-2.0 gio-2.0
glib-2.0 glib-2.0
gobject-2.0 gobject-2.0
gtk+-3.0
json-glib-1.0
libalpm
libsoup-2.4
pango
vte-2.91
x11

10
src/Pamac.pc Normal file
View File

@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=@DOLLAR@{prefix}/${CMAKE_INSTALL_LIBDIR}
includedir=@DOLLAR@{prefix}/${CMAKE_INSTALL_INCLUDEDIR}
Name: Pamac
Description: Pamac
Version: 7.0.0
Libs: -L@DOLLAR@{libdir} -lPamac
Cflags: -I@DOLLAR@{includedir}
Requires: atk cairo gdk-3.0 gdk-pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gtk+-3.0 json-glib-1.0 libalpm libsoup-2.4 pango vte-2.91 x11

View File

@ -1,7 +1,7 @@
/* /*
* alpm_config * alpm_config
* *
* Copyright (C) 2017 Chris Cromer <cromer@cromnix.org> * Copyright (C) 2017-2019 Chris Cromer <cromer@cromnix.org>
* Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org> * Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
//using Alpm
[Compact] [Compact]
class AlpmRepo { class AlpmRepo {
public string name; public string name;
@ -43,7 +45,7 @@ class AlpmRepo {
} }
class AlpmConfig { public class AlpmConfig {
string conf_path; string conf_path;
string? rootdir; string? rootdir;
string? dbpath; string? dbpath;
@ -330,10 +332,10 @@ class AlpmConfig {
} }
} }
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} else { } else {
GLib.stderr.printf ("File '%s' doesn't exist.\n", path); stderr.printf ("File '%s' doesn't exist.\n", path);
} }
} }
@ -390,10 +392,10 @@ class AlpmConfig {
} }
reload (); reload ();
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} else { } else {
GLib.stderr.printf ("File '%s' doesn't exist.\n", conf_path); stderr.printf ("File '%s' doesn't exist.\n", conf_path);
} }
} }
@ -477,7 +479,7 @@ class AlpmConfig {
siglevel_mask |= (Alpm.Signature.Level.DATABASE_MARGINAL_OK | Alpm.Signature.Level.DATABASE_UNKNOWN_OK); siglevel_mask |= (Alpm.Signature.Level.DATABASE_MARGINAL_OK | Alpm.Signature.Level.DATABASE_UNKNOWN_OK);
} }
} else { } else {
GLib.stderr.printf("unrecognized siglevel: %s\n", conf_string); stderr.printf("unrecognized siglevel: %s\n", conf_string);
} }
} }
siglevel &= ~Alpm.Signature.Level.USE_DEFAULT; siglevel &= ~Alpm.Signature.Level.USE_DEFAULT;

View File

@ -18,7 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace AUR { //using Json
//using Soup
//using Alpm
namespace Pamac {
// AUR urls // AUR urls
const string aur_url = "http://aur.archlinux.org"; const string aur_url = "http://aur.archlinux.org";
const string rpc_url = aur_url + "/rpc/?v=5"; const string rpc_url = aur_url + "/rpc/?v=5";

View File

@ -19,6 +19,7 @@
*/ */
//using GIO //using GIO
//using Gtk
namespace Pamac { namespace Pamac {

View File

@ -1,93 +1,99 @@
cfg_pamac_classic = configuration_data() cfg_pamac = configuration_data()
cfg_pamac_classic.set('DATADIR', join_paths(get_option('prefix'),get_option('datadir'))) cfg_pamac.set('DATADIR', join_paths(get_option('prefix'),get_option('datadir')))
cfg_pamac_classic.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('datadir'),'pamac')) cfg_pamac.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('datadir'),'pamac'))
cfg_pamac_classic.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_classic.set('RELEASE_NAME', 'pamac') cfg_pamac.set('RELEASE_NAME', 'pamac')
cfg_pamac_classic.set('PREFIX', get_option('prefix')) cfg_pamac.set('PREFIX', get_option('prefix'))
cfg_pamac_classic.set('VERSION', '6.7.2') cfg_pamac.set('VERSION', '7.0.0')
cfg_pamac_classic.set('TESTSRCDIR', meson.source_root()) cfg_pamac.set('TESTSRCDIR', meson.source_root())
cfgfile_1 = configure_file( cfgfile_1 = configure_file(
input: 'Config.vala.base', input: 'Config.vala.base',
output: 'Config.vala', output: 'Config.vala',
configuration: cfg_pamac_classic) configuration: cfg_pamac)
pamac_classic_deps = [gdk_3_0_dep] pamac_deps = [atk_dep]
pamac_classic_deps += [gtk_3_0_dep] pamac_deps += [cairo_dep]
pamac_classic_deps += [json_glib_1_0_dep] pamac_deps += [gdk_3_0_dep]
pamac_classic_deps += [libalpm_dep] pamac_deps += [gdk_pixbuf_2_0_dep]
pamac_classic_deps += [libnotify_dep] pamac_deps += [gio_2_0_dep]
pamac_classic_deps += [libsoup_2_4_dep] pamac_deps += [glib_2_0_dep]
pamac_classic_deps += [vte_2_91_dep] pamac_deps += [gobject_2_0_dep]
pamac_classic_deps += [gio_2_0_dep] pamac_deps += [gtk_3_0_dep]
pamac_classic_deps += [glib_2_0_dep] pamac_deps += [json_glib_1_0_dep]
pamac_classic_deps += [gobject_2_0_dep] pamac_deps += [libalpm_dep]
pamac_classic_sources = [cfgfile_1] pamac_deps += [libsoup_2_4_dep]
if not DISABLE_AUR pamac_deps += [pango_dep]
pamac_classic_sources += ['aur.vala'] pamac_deps += [vte_2_91_dep]
endif pamac_deps += [x11_dep]
pamac_classic_sources += ['alpm_config.vala'] pamac_sources = [cfgfile_1]
pamac_classic_sources += ['choose_ignorepkgs_dialog.vala'] pamac_sources += ['alpm_config.vala']
pamac_classic_sources += ['choose_provider_dialog.vala'] pamac_sources += ['aur.vala']
pamac_classic_sources += ['common.vala'] pamac_sources += ['choose_ignorepkgs_dialog.vala']
pamac_classic_sources += ['mirrors_config.vala'] pamac_sources += ['choose_provider_dialog.vala']
pamac_classic_sources += ['package.vala'] pamac_sources += ['common.vala']
pamac_classic_sources += ['pamac_config.vala'] pamac_sources += ['mirrors_config.vala']
pamac_classic_sources += ['preferences_dialog.vala'] pamac_sources += ['package.vala']
pamac_classic_sources += ['progress_box.vala'] pamac_sources += ['pamac_config.vala']
pamac_classic_sources += ['transaction.vala'] pamac_sources += ['preferences_dialog.vala']
pamac_classic_sources += ['transaction_sum_dialog.vala'] pamac_sources += ['progress_box.vala']
pamac_classic_sources += [pamac_transaction_gresource_xml_file_c] pamac_sources += ['transaction.vala']
pamac_classic_vala_args = ['--pkg','posix'] pamac_sources += ['transaction_sum_dialog.vala']
pamac_classic_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_sources += [pamac_transaction_gresource_xml_file_c]
pamac_classic_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.transaction.gresource.xml')] pamac_vala_args = ['--pkg','posix']
pamac_classic_c_args = [] pamac_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.transaction.gresource.xml')]
pamac_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_classic_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_vala_args += ['-D', 'ENABLE_UPDATE_ICON']
pamac_classic_c_args += ['-DENABLE_UPDATE_ICON'] pamac_c_args += ['-DENABLE_UPDATE_ICON']
endif endif
if ENABLE_HAMBURGER if ENABLE_HAMBURGER
pamac_classic_vala_args += ['-D', 'ENABLE_HAMBURGER'] pamac_vala_args += ['-D', 'ENABLE_HAMBURGER']
pamac_classic_c_args += ['-DENABLE_HAMBURGER'] pamac_c_args += ['-DENABLE_HAMBURGER']
endif endif
if KDE_TRAY if KDE_TRAY
pamac_classic_vala_args += ['-D', 'KDE_TRAY'] pamac_vala_args += ['-D', 'KDE_TRAY']
pamac_classic_c_args += ['-DKDE_TRAY'] pamac_c_args += ['-DKDE_TRAY']
endif endif
if DISABLE_AUR if DISABLE_AUR
pamac_classic_vala_args += ['-D', 'DISABLE_AUR'] pamac_vala_args += ['-D', 'DISABLE_AUR']
pamac_classic_c_args += ['-DDISABLE_AUR'] pamac_c_args += ['-DDISABLE_AUR']
endif endif
pamac_classic_deps += [meson.get_compiler('c').find_library('m', required : false)] pamac_deps += [meson.get_compiler('c').find_library('m', required : false)]
pamac_classic_link_args = ['-rdynamic'] pamac_link_args = ['-rdynamic']
pamacclassic_library = shared_library('pamacclassic', pamac_classic_sources, Pamac_library = shared_library('Pamac', pamac_sources,
dependencies: pamac_classic_deps, dependencies: pamac_deps,
vala_args: pamac_classic_vala_args, vala_args: pamac_vala_args,
c_args: pamac_classic_c_args, c_args: pamac_c_args,
link_args: pamac_classic_link_args, link_args: pamac_link_args,
version: '6.7.2', version: '7.0.0',
soversion: '6', soversion: '7',
install: true, install: true,
install_dir: [true, true, true]) install_dir: [true, true, true])
pamac_classic_requires = [] pamac_requires = []
pamac_classic_requires += ['gdk-3.0'] pamac_requires += ['atk']
pamac_classic_requires += ['gtk+-3.0'] pamac_requires += ['cairo']
pamac_classic_requires += ['json-glib-1.0'] pamac_requires += ['gdk-3.0']
pamac_classic_requires += ['libalpm'] pamac_requires += ['gdk-pixbuf-2.0']
pamac_classic_requires += ['libnotify'] pamac_requires += ['gio-2.0']
pamac_classic_requires += ['libsoup-2.4'] pamac_requires += ['glib-2.0']
pamac_classic_requires += ['vte-2.91'] pamac_requires += ['gobject-2.0']
pamac_classic_requires += ['gio-2.0'] pamac_requires += ['gtk+-3.0']
pamac_classic_requires += ['glib-2.0'] pamac_requires += ['json-glib-1.0']
pamac_classic_requires += ['gobject-2.0'] pamac_requires += ['libalpm']
pamac_requires += ['libsoup-2.4']
pamac_requires += ['pango']
pamac_requires += ['vte-2.91']
pamac_requires += ['x11']
pkg_mod = import('pkgconfig') pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : pamacclassic_library, pkg_mod.generate(libraries : Pamac_library,
version : '6.7.2', version : '7.0.0',
name : 'pamacclassic', name : 'Pamac',
filebase : 'pamacclassic', filebase : 'Pamac',
description : 'pamacclassic', description : 'Pamac',
requires : pamac_classic_requires) requires : pamac_requires)
install_data(join_paths(meson.current_source_dir(),'pamacclassic.deps'),install_dir: join_paths(get_option('prefix'),'share','vala','vapi')) install_data(join_paths(meson.current_source_dir(),'Pamac.deps'),install_dir: join_paths(get_option('prefix'),'share','vala','vapi'))

View File

@ -19,7 +19,7 @@
*/ */
namespace Pamac { namespace Pamac {
class MirrorsConfig { public class MirrorsConfig {
string conf_path; string conf_path;
public string choosen_generation_method { get; private set; } public string choosen_generation_method { get; private set; }
@ -69,10 +69,10 @@ namespace Pamac {
} }
} }
} catch (Error e) { } catch (Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} else { } else {
GLib.stderr.printf ("File '%s' doesn't exist.\n", path); stderr.printf ("File '%s' doesn't exist.\n", path);
} }
} }
@ -121,10 +121,10 @@ namespace Pamac {
dos.put_string (new_line); dos.put_string (new_line);
} }
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} else { } else {
GLib.stderr.printf ("File '%s' doesn't exist.\n", file.get_path ()); stderr.printf ("File '%s' doesn't exist.\n", file.get_path ());
} }
} }
} }

View File

@ -4,7 +4,7 @@ cfg_pamac_clean_cache.set('PKGDATADIR', join_paths(get_option('prefix'),get_opti
cfg_pamac_clean_cache.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac_clean_cache.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_clean_cache.set('RELEASE_NAME', 'pamac') cfg_pamac_clean_cache.set('RELEASE_NAME', 'pamac')
cfg_pamac_clean_cache.set('PREFIX', get_option('prefix')) cfg_pamac_clean_cache.set('PREFIX', get_option('prefix'))
cfg_pamac_clean_cache.set('VERSION', '6.7.2') cfg_pamac_clean_cache.set('VERSION', '7.0.0')
cfg_pamac_clean_cache.set('TESTSRCDIR', meson.source_root()) cfg_pamac_clean_cache.set('TESTSRCDIR', meson.source_root())
cfgfile_4 = configure_file( cfgfile_4 = configure_file(
@ -15,13 +15,12 @@ cfgfile_4 = configure_file(
pamac_clean_cache_deps = [gtk_3_0_dep] pamac_clean_cache_deps = [gtk_3_0_dep]
pamac_clean_cache_deps += [json_glib_1_0_dep] pamac_clean_cache_deps += [json_glib_1_0_dep]
pamac_clean_cache_deps += [glib_2_0_dep] pamac_clean_cache_deps += [glib_2_0_dep]
pamac_clean_cache_deps += [gobject_2_0_dep]
pamac_clean_cache_sources = [cfgfile_4] pamac_clean_cache_sources = [cfgfile_4]
pamac_clean_cache_sources += ['clean_cache.vala'] pamac_clean_cache_sources += ['clean_cache.vala']
pamac_clean_cache_sources += ['pamac_config.vala'] pamac_clean_cache_sources += [join_paths(meson.current_source_dir(),'../vapis/libalpm.vapi')]
pamac_clean_cache_vala_args = ['--pkg','posix'] pamac_clean_cache_vala_args = ['--pkg','posix']
pamac_clean_cache_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_clean_cache_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_clean_cache_dependencies = [pamacclassic_library] pamac_clean_cache_dependencies = [Pamac_library]
pamac_clean_cache_c_args = [] pamac_clean_cache_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_clean_cache_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_clean_cache_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

@ -1 +0,0 @@
../pamac_config.vala

View File

@ -32,8 +32,10 @@ namespace Pamac {
public override void startup () { public override void startup () {
// i18n // i18n
Intl.textdomain ("pamac"); Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
Intl.setlocale (LocaleCategory.ALL, ""); Intl.setlocale (LocaleCategory.ALL, "");
Intl.textdomain(Constants.GETTEXT_PACKAGE);
Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" );
base.startup (); base.startup ();

View File

@ -4,7 +4,7 @@ cfg_pamac_install.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('
cfg_pamac_install.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac_install.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_install.set('RELEASE_NAME', 'pamac') cfg_pamac_install.set('RELEASE_NAME', 'pamac')
cfg_pamac_install.set('PREFIX', get_option('prefix')) cfg_pamac_install.set('PREFIX', get_option('prefix'))
cfg_pamac_install.set('VERSION', '6.7.2') cfg_pamac_install.set('VERSION', '7.0.0')
cfg_pamac_install.set('TESTSRCDIR', meson.source_root()) cfg_pamac_install.set('TESTSRCDIR', meson.source_root())
cfgfile_5 = configure_file( cfgfile_5 = configure_file(
@ -21,9 +21,10 @@ pamac_install_sources = [cfgfile_5]
pamac_install_sources += ['installer.vala'] pamac_install_sources += ['installer.vala']
pamac_install_sources += ['progress_dialog.vala'] pamac_install_sources += ['progress_dialog.vala']
pamac_install_sources += [pamac_installer_gresource_xml_file_c] pamac_install_sources += [pamac_installer_gresource_xml_file_c]
pamac_install_sources += [join_paths(meson.current_source_dir(),'../vapis/libalpm.vapi')]
pamac_install_vala_args = ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_install_vala_args = ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_install_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.installer.gresource.xml')] pamac_install_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.installer.gresource.xml')]
pamac_install_dependencies = [pamacclassic_library] pamac_install_dependencies = [Pamac_library]
pamac_install_c_args = [] pamac_install_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_install_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_install_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

@ -31,8 +31,10 @@ namespace Pamac {
public override void startup () { public override void startup () {
// i18n // i18n
Intl.textdomain ("pamac"); Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
Intl.setlocale (LocaleCategory.ALL, ""); Intl.setlocale (LocaleCategory.ALL, "");
Intl.textdomain(Constants.GETTEXT_PACKAGE);
Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" );
base.startup (); base.startup ();

View File

@ -100,8 +100,11 @@ namespace Pamac {
Gtk.Label updated_label; Gtk.Label updated_label;
[GtkChild] [GtkChild]
Gtk.Stack properties_stack; Gtk.Stack properties_stack;
#if DISABLE_AUR
#else
[GtkChild] [GtkChild]
Gtk.StackSwitcher properties_stackswitcher; Gtk.StackSwitcher properties_stackswitcher;
#endif
[GtkChild] [GtkChild]
Gtk.Grid deps_grid; Gtk.Grid deps_grid;
[GtkChild] [GtkChild]
@ -1525,7 +1528,7 @@ namespace Pamac {
} }
} }
} }
right_click_menu.popup (null, null, null, event.button, event.time); right_click_menu.popup_at_pointer (event);
return true; return true;
} }
} }
@ -1606,7 +1609,7 @@ namespace Pamac {
upgrade_item.sensitive = true; upgrade_item.sensitive = true;
} }
} }
right_click_menu.popup (null, null, null, event.button, event.time); right_click_menu.popup_at_pointer (event);
return true; return true;
} }
} }
@ -1887,12 +1890,11 @@ namespace Pamac {
refresh_packages_list (); refresh_packages_list ();
} }
void on_menu_button_toggled () {
#if ENABLE_HAMBURGER #if ENABLE_HAMBURGER
void on_menu_button_toggled () {
preferences_button.sensitive = !(transaction_running || sysupgrade_running); preferences_button.sensitive = !(transaction_running || sysupgrade_running);
#endif
} }
#endif
[GtkCallback] [GtkCallback]
void on_history_button_clicked () { void on_history_button_clicked () {
@ -1902,7 +1904,7 @@ namespace Pamac {
} }
var file = GLib.File.new_for_path ("/var/log/pacman.log"); var file = GLib.File.new_for_path ("/var/log/pacman.log");
if (!file.query_exists ()) { if (!file.query_exists ()) {
GLib.stderr.printf ("File '%s' doesn't exist.\n", file.get_path ()); stderr.printf ("File '%s' doesn't exist.\n", file.get_path ());
} else { } else {
StringBuilder text = new StringBuilder (); StringBuilder text = new StringBuilder ();
try { try {
@ -1916,7 +1918,7 @@ namespace Pamac {
text.prepend (line + "\n"); text.prepend (line + "\n");
} }
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf ("%s\n", e.message); stderr.printf ("%s\n", e.message);
} }
var history_dialog = new HistoryDialog (this); var history_dialog = new HistoryDialog (this);
history_dialog.textview.buffer.set_text (text.str, (int) text.len); history_dialog.textview.buffer.set_text (text.str, (int) text.len);

View File

@ -4,7 +4,7 @@ cfg_pamac_manager.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('
cfg_pamac_manager.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac_manager.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_manager.set('RELEASE_NAME', 'pamac') cfg_pamac_manager.set('RELEASE_NAME', 'pamac')
cfg_pamac_manager.set('PREFIX', get_option('prefix')) cfg_pamac_manager.set('PREFIX', get_option('prefix'))
cfg_pamac_manager.set('VERSION', '6.7.2') cfg_pamac_manager.set('VERSION', '7.0.0')
cfg_pamac_manager.set('TESTSRCDIR', meson.source_root()) cfg_pamac_manager.set('TESTSRCDIR', meson.source_root())
cfgfile_6 = configure_file( cfgfile_6 = configure_file(
@ -22,9 +22,10 @@ pamac_manager_sources += ['history_dialog.vala']
pamac_manager_sources += ['manager.vala'] pamac_manager_sources += ['manager.vala']
pamac_manager_sources += ['manager_window.vala'] pamac_manager_sources += ['manager_window.vala']
pamac_manager_sources += [pamac_manager_gresource_xml_file_c] pamac_manager_sources += [pamac_manager_gresource_xml_file_c]
pamac_manager_sources += [join_paths(meson.current_source_dir(),'../vapis/libalpm.vapi')]
pamac_manager_vala_args = ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_manager_vala_args = ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_manager_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.manager.gresource.xml')] pamac_manager_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.manager.gresource.xml')]
pamac_manager_dependencies = [pamacclassic_library] pamac_manager_dependencies = [Pamac_library]
pamac_manager_c_args = [] pamac_manager_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_manager_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_manager_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

@ -1 +0,0 @@
../alpm_config.vala

View File

@ -4,7 +4,7 @@ cfg_pamac_system_daemon.set('PKGDATADIR', join_paths(get_option('prefix'),get_op
cfg_pamac_system_daemon.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac_system_daemon.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_system_daemon.set('RELEASE_NAME', 'pamac') cfg_pamac_system_daemon.set('RELEASE_NAME', 'pamac')
cfg_pamac_system_daemon.set('PREFIX', get_option('prefix')) cfg_pamac_system_daemon.set('PREFIX', get_option('prefix'))
cfg_pamac_system_daemon.set('VERSION', '6.7.2') cfg_pamac_system_daemon.set('VERSION', '7.0.0')
cfg_pamac_system_daemon.set('TESTSRCDIR', meson.source_root()) cfg_pamac_system_daemon.set('TESTSRCDIR', meson.source_root())
cfgfile_7 = configure_file( cfgfile_7 = configure_file(
@ -22,13 +22,10 @@ pamac_system_daemon_deps += [gio_2_0_dep]
pamac_system_daemon_deps += [glib_2_0_dep] pamac_system_daemon_deps += [glib_2_0_dep]
pamac_system_daemon_deps += [gobject_2_0_dep] pamac_system_daemon_deps += [gobject_2_0_dep]
pamac_system_daemon_sources = [cfgfile_7] pamac_system_daemon_sources = [cfgfile_7]
pamac_system_daemon_sources += ['alpm_config.vala']
pamac_system_daemon_sources += ['mirrors_config.vala']
pamac_system_daemon_sources += ['pamac_config.vala']
pamac_system_daemon_sources += ['system_daemon.vala'] pamac_system_daemon_sources += ['system_daemon.vala']
pamac_system_daemon_vala_args = ['--pkg','posix'] pamac_system_daemon_vala_args = ['--pkg','posix']
pamac_system_daemon_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_system_daemon_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_system_daemon_dependencies = [pamacclassic_library] pamac_system_daemon_dependencies = [Pamac_library]
pamac_system_daemon_c_args = [] pamac_system_daemon_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_system_daemon_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_system_daemon_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

@ -1 +0,0 @@
../mirrors_config.vala

View File

@ -1 +0,0 @@
../pamac_config.vala

View File

@ -1,7 +1,7 @@
/* /*
* pamac-vala * pamac-vala
* *
* Copyright (C) 2017 Chris Cromer <cromer@cromnix.org> * Copyright (C) 2017-2019 Chris Cromer <cromer@cromnix.org>
* Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org> * Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -18,9 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// i18n
const string GETTEXT_PACKAGE = "pamac";
Pamac.SystemDaemon system_daemon; Pamac.SystemDaemon system_daemon;
MainLoop loop; MainLoop loop;
@ -140,7 +137,7 @@ namespace Pamac {
refreshed = false; refreshed = false;
} }
public void set_environment_variables (HashTable<string,string> variables) { public void set_environment_variables (HashTable<string,string> variables) throws DBusError, IOError {
string[] keys = { "HTTP_USER_AGENT", string[] keys = { "HTTP_USER_AGENT",
"http_proxy", "http_proxy",
"https_proxy", "https_proxy",
@ -155,7 +152,7 @@ namespace Pamac {
} }
} }
public ErrorInfos get_current_error () { public ErrorInfos get_current_error () throws DBusError, IOError {
return current_error; return current_error;
} }
@ -277,7 +274,7 @@ namespace Pamac {
return true; return true;
} }
public string[] get_mirrors_countries () { public string[] get_mirrors_countries () throws DBusError, IOError {
string[] countries = {}; string[] countries = {};
try { try {
string countries_str; string countries_str;
@ -297,7 +294,7 @@ namespace Pamac {
return countries; return countries;
} }
public bool get_lock (GLib.BusName sender) { public bool get_lock (GLib.BusName sender) throws DBusError, IOError {
if (lock_id == sender) { if (lock_id == sender) {
return true; return true;
} else if (lock_id == "") { } else if (lock_id == "") {
@ -307,7 +304,7 @@ namespace Pamac {
return false; return false;
} }
public bool unlock (GLib.BusName sender) { public bool unlock (GLib.BusName sender) throws DBusError, IOError {
if (lock_id == sender) { if (lock_id == sender) {
lock_id = new BusName (""); lock_id = new BusName ("");
return true; return true;
@ -354,14 +351,14 @@ namespace Pamac {
return authorized; return authorized;
} }
public void start_get_authorization (GLib.BusName sender) { public void start_get_authorization (GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
get_authorization_finished (authorized); get_authorization_finished (authorized);
}); });
} }
public void start_save_pamac_config () { public void start_save_pamac_config () throws DBusError, IOError {
var pamac_config = new Pamac.Config (); var pamac_config = new Pamac.Config ();
pamac_config.reload (); pamac_config.reload ();
#if DISABLE_AUR #if DISABLE_AUR
@ -379,7 +376,7 @@ namespace Pamac {
write_alpm_config_finished ((alpm_handle.checkspace == 1)); write_alpm_config_finished ((alpm_handle.checkspace == 1));
} }
public void start_write_alpm_config (HashTable<string,Variant> new_alpm_conf_, GLib.BusName sender) { public void start_write_alpm_config (HashTable<string,Variant> new_alpm_conf_, GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
if (authorized ) { if (authorized ) {
@ -413,7 +410,7 @@ namespace Pamac {
generate_mirrors_list_finished (); generate_mirrors_list_finished ();
} }
public void start_generate_mirrors_list (GLib.BusName sender) { public void start_generate_mirrors_list (GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
if (authorized) { if (authorized) {
@ -426,7 +423,7 @@ namespace Pamac {
}); });
} }
public void clean_cache (uint64 keep_nb, bool only_uninstalled, GLib.BusName sender) { public void clean_cache (uint64 keep_nb, bool only_uninstalled, GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
if (authorized) { if (authorized) {
@ -446,7 +443,7 @@ namespace Pamac {
}); });
} }
public void start_write_mirrors_config (HashTable<string,Variant> new_mirrors_conf, GLib.BusName sender) { public void start_write_mirrors_config (HashTable<string,Variant> new_mirrors_conf, GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
var mirrors_config = new MirrorsConfig ("/etc/pacman-mirrors.conf"); var mirrors_config = new MirrorsConfig ("/etc/pacman-mirrors.conf");
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
@ -458,7 +455,7 @@ namespace Pamac {
}); });
} }
public void start_set_pkgreason (string pkgname, uint reason, GLib.BusName sender) { public void start_set_pkgreason (string pkgname, uint reason, GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
if (authorized) { if (authorized) {
@ -535,7 +532,7 @@ namespace Pamac {
} }
} }
public void start_refresh (bool force, GLib.BusName sender) { public void start_refresh (bool force, GLib.BusName sender) throws DBusError, IOError {
if (lock_id != sender) { if (lock_id != sender) {
refresh_finished (false); refresh_finished (false);
return; return;
@ -644,7 +641,7 @@ namespace Pamac {
private async void check_aur_dep_list (string[] pkgnames) { private async void check_aur_dep_list (string[] pkgnames) {
string[] dep_types = {"Depends", "MakeDepends", "CheckDepends"}; string[] dep_types = {"Depends", "MakeDepends", "CheckDepends"};
string[] dep_to_check = {}; string[] dep_to_check = {};
Json.Array results = yield AUR.multiinfo (pkgnames); Json.Array results = yield multiinfo (pkgnames);
results.foreach_element ((array, index, node) => { results.foreach_element ((array, index, node) => {
unowned Json.Object? pkg_info = node.get_object (); unowned Json.Object? pkg_info = node.get_object ();
// create fake db desc file // create fake db desc file
@ -722,12 +719,12 @@ namespace Pamac {
try { try {
dos.put_string ("%s\n".printf (_node.get_string ())); dos.put_string ("%s\n".printf (_node.get_string ()));
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
}); });
dos.put_string ("\n"); dos.put_string ("\n");
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} }
// provides // provides
@ -739,12 +736,12 @@ namespace Pamac {
try { try {
dos.put_string ("%s\n".printf (_node.get_string ())); dos.put_string ("%s\n".printf (_node.get_string ()));
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
}); });
dos.put_string ("\n"); dos.put_string ("\n");
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} }
// replaces // replaces
@ -756,17 +753,17 @@ namespace Pamac {
try { try {
dos.put_string ("%s\n".printf (_node.get_string ())); dos.put_string ("%s\n".printf (_node.get_string ()));
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
}); });
dos.put_string ("\n"); dos.put_string ("\n");
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} }
} }
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); stderr.printf("%s\n", e.message);
} }
} }
}); });
@ -803,7 +800,10 @@ namespace Pamac {
}; };
get_updates_finished (updates); get_updates_finished (updates);
} else { } else {
#if DISABLE_AUR
#else
string[] local_pkgs = {}; string[] local_pkgs = {};
#endif
unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache; unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache;
while (pkgcache != null) { while (pkgcache != null) {
unowned Alpm.Package installed_pkg = pkgcache.data; unowned Alpm.Package installed_pkg = pkgcache.data;
@ -842,8 +842,8 @@ namespace Pamac {
if (check_aur_updates) { if (check_aur_updates) {
// get aur updates // get aur updates
if (!aur_updates_checked) { if (!aur_updates_checked) {
AUR.multiinfo.begin (local_pkgs, (obj, res) => { multiinfo.begin (local_pkgs, (obj, res) => {
aur_updates_results = AUR.multiinfo.end (res); aur_updates_results = multiinfo.end (res);
aur_updates_checked = true; aur_updates_checked = true;
var updates = Updates () { var updates = Updates () {
is_syncfirst = false, is_syncfirst = false,
@ -899,9 +899,9 @@ namespace Pamac {
#endif #endif
#if DISABLE_AUR #if DISABLE_AUR
public void start_get_updates () { public void start_get_updates () throws DBusError, IOError {
#else #else
public void start_get_updates (bool check_aur_updates_) { public void start_get_updates (bool check_aur_updates_) throws DBusError, IOError {
check_aur_updates = check_aur_updates_; check_aur_updates = check_aur_updates_;
#endif #endif
try { try {
@ -938,7 +938,13 @@ namespace Pamac {
if (errno != 0) { if (errno != 0) {
current_error.details = { Alpm.strerror (errno) }; current_error.details = { Alpm.strerror (errno) };
} }
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
success = false; success = false;
} else { } else {
success = trans_prepare_real (); success = trans_prepare_real ();
@ -947,7 +953,7 @@ namespace Pamac {
trans_prepare_finished (success); trans_prepare_finished (success);
} }
public void start_sysupgrade_prepare (bool enable_downgrade_, string[] temporary_ignorepkgs_, GLib.BusName sender) { public void start_sysupgrade_prepare (bool enable_downgrade_, string[] temporary_ignorepkgs_, GLib.BusName sender) throws DBusError, IOError {
if (lock_id != sender) { if (lock_id != sender) {
trans_prepare_finished (false); trans_prepare_finished (false);
return; return;
@ -1162,7 +1168,13 @@ namespace Pamac {
break; break;
} }
current_error.details = (owned) details; current_error.details = (owned) details;
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
success = false; success = false;
} else { } else {
// Search for holdpkg in target list // Search for holdpkg in target list
@ -1180,7 +1192,13 @@ namespace Pamac {
if (found_locked_pkg) { if (found_locked_pkg) {
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
current_error.details = (owned) details; current_error.details = (owned) details;
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
success = false; success = false;
} }
} }
@ -1215,7 +1233,13 @@ namespace Pamac {
if (success) { if (success) {
success = trans_prepare_real (); success = trans_prepare_real ();
} else { } else {
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
} }
} }
trans_prepare_finished (success); trans_prepare_finished (success);
@ -1378,7 +1402,13 @@ namespace Pamac {
} }
pkgs_to_remove.next (); pkgs_to_remove.next ();
} }
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
try { try {
Process.spawn_command_line_sync ("rm -f %ssync/aur.db".printf (alpm_handle.dbpath)); Process.spawn_command_line_sync ("rm -f %ssync/aur.db".printf (alpm_handle.dbpath));
} catch (SpawnError e) { } catch (SpawnError e) {
@ -1391,7 +1421,13 @@ namespace Pamac {
trans_prepare (); trans_prepare ();
} }
} else { } else {
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
} }
} }
if (!success) { if (!success) {
@ -1408,14 +1444,14 @@ namespace Pamac {
string[] to_install_, string[] to_install_,
string[] to_remove_, string[] to_remove_,
string[] to_load_, string[] to_load_,
GLib.BusName sender) { GLib.BusName sender) throws DBusError, IOError {
#else #else
public void start_trans_prepare (Alpm.TransFlag flags_, public void start_trans_prepare (Alpm.TransFlag flags_,
string[] to_install_, string[] to_install_,
string[] to_remove_, string[] to_remove_,
string[] to_load_, string[] to_load_,
string[] to_build_, string[] to_build_,
GLib.BusName sender) { GLib.BusName sender) throws DBusError, IOError {
#endif #endif
if (lock_id != sender) { if (lock_id != sender) {
trans_prepare_finished (false); trans_prepare_finished (false);
@ -1451,14 +1487,14 @@ namespace Pamac {
#endif #endif
} }
public void choose_provider (int provider) { public void choose_provider (int provider) throws DBusError, IOError {
provider_mutex.lock (); provider_mutex.lock ();
choosen_provider = provider; choosen_provider = provider;
provider_cond.signal (); provider_cond.signal ();
provider_mutex.unlock (); provider_mutex.unlock ();
} }
public TransactionSummary get_transaction_summary () { public TransactionSummary get_transaction_summary () throws DBusError, IOError {
UpdateInfos[] to_install = {}; UpdateInfos[] to_install = {};
UpdateInfos[] to_upgrade = {}; UpdateInfos[] to_upgrade = {};
UpdateInfos[] to_downgrade = {}; UpdateInfos[] to_downgrade = {};
@ -1502,9 +1538,9 @@ namespace Pamac {
to_remove += (owned) infos; to_remove += (owned) infos;
pkgs_to_remove.next (); pkgs_to_remove.next ();
} }
UpdateInfos[] conflicts_to_remove = {};
#if DISABLE_AUR #if DISABLE_AUR
#else #else
UpdateInfos[] conflicts_to_remove = {};
foreach (unowned UpdateInfos infos in aur_conflicts_to_remove){ foreach (unowned UpdateInfos infos in aur_conflicts_to_remove){
conflicts_to_remove += infos; conflicts_to_remove += infos;
} }
@ -1540,7 +1576,13 @@ namespace Pamac {
current_error.errno = (uint) errno; current_error.errno = (uint) errno;
// cancel the download return an EXTERNAL_DOWNLOAD error // cancel the download return an EXTERNAL_DOWNLOAD error
if (errno == Alpm.Errno.EXTERNAL_DOWNLOAD && cancellable.is_cancelled ()) { if (errno == Alpm.Errno.EXTERNAL_DOWNLOAD && cancellable.is_cancelled ()) {
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
trans_commit_finished (false); trans_commit_finished (false);
return; return;
} }
@ -1595,7 +1637,13 @@ namespace Pamac {
} }
success = false; success = false;
} }
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
to_install_as_dep.foreach_remove ((pkgname, val) => { to_install_as_dep.foreach_remove ((pkgname, val) => {
unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname); unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname);
if (pkg != null) { if (pkg != null) {
@ -1607,7 +1655,7 @@ namespace Pamac {
trans_commit_finished (success); trans_commit_finished (success);
} }
public void start_trans_commit (GLib.BusName sender) { public void start_trans_commit (GLib.BusName sender) throws DBusError, IOError {
check_authorization.begin (sender, (obj, res) => { check_authorization.begin (sender, (obj, res) => {
bool authorized = check_authorization.end (res); bool authorized = check_authorization.end (res);
if (authorized) { if (authorized) {
@ -1617,13 +1665,19 @@ namespace Pamac {
stderr.printf ("Thread Error %s\n", e.message); stderr.printf ("Thread Error %s\n", e.message);
} }
} else { } else {
try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
trans_commit_finished (false); trans_commit_finished (false);
} }
}); });
} }
public void trans_release (GLib.BusName sender) { public void trans_release (GLib.BusName sender) throws DBusError, IOError {
if (lock_id != sender) { if (lock_id != sender) {
return; return;
} }
@ -1631,7 +1685,7 @@ namespace Pamac {
remove_ignorepkgs (); remove_ignorepkgs ();
} }
public void trans_cancel (GLib.BusName sender) { public void trans_cancel (GLib.BusName sender) throws DBusError, IOError {
if (lock_id != sender) { if (lock_id != sender) {
return; return;
} }
@ -1644,7 +1698,7 @@ namespace Pamac {
} }
[DBus (no_reply = true)] [DBus (no_reply = true)]
public void quit () { public void quit () throws DBusError, IOError {
// wait for all tasks to be processed // wait for all tasks to be processed
ThreadPool.free ((owned) thread_pool, false, true); ThreadPool.free ((owned) thread_pool, false, true);
loop.quit (); loop.quit ();
@ -2066,8 +2120,10 @@ void on_bus_acquired (DBusConnection conn) {
void main () { void main () {
// i18n // i18n
Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
Intl.setlocale (LocaleCategory.ALL, ""); Intl.setlocale (LocaleCategory.ALL, "");
Intl.textdomain (GETTEXT_PACKAGE); Intl.textdomain(Constants.GETTEXT_PACKAGE);
Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" );
Bus.own_name (BusType.SYSTEM, Bus.own_name (BusType.SYSTEM,
"org.pamac.system", "org.pamac.system",

View File

@ -1 +0,0 @@
../alpm_config.vala

View File

@ -4,7 +4,7 @@ cfg_pamac_tray.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('dat
cfg_pamac_tray.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac_tray.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_tray.set('RELEASE_NAME', 'pamac') cfg_pamac_tray.set('RELEASE_NAME', 'pamac')
cfg_pamac_tray.set('PREFIX', get_option('prefix')) cfg_pamac_tray.set('PREFIX', get_option('prefix'))
cfg_pamac_tray.set('VERSION', '6.7.2') cfg_pamac_tray.set('VERSION', '7.0.0')
cfg_pamac_tray.set('TESTSRCDIR', meson.source_root()) cfg_pamac_tray.set('TESTSRCDIR', meson.source_root())
cfgfile_3 = configure_file( cfgfile_3 = configure_file(
@ -29,12 +29,10 @@ pamac_tray_sources += ['tray-appindicator.vala']
else else
pamac_tray_sources += ['tray-gtk.vala'] pamac_tray_sources += ['tray-gtk.vala']
endif endif
pamac_tray_sources += ['alpm_config.vala']
pamac_tray_sources += ['pamac_config.vala']
pamac_tray_sources += ['tray.vala'] pamac_tray_sources += ['tray.vala']
pamac_tray_vala_args = ['--pkg','posix'] pamac_tray_vala_args = ['--pkg','posix']
pamac_tray_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_tray_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_tray_dependencies = [pamacclassic_library] pamac_tray_dependencies = [Pamac_library]
pamac_tray_c_args = [] pamac_tray_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_tray_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_tray_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

@ -1 +0,0 @@
../pamac_config.vala

View File

@ -32,7 +32,7 @@ namespace Pamac {
// Show popup menu on right button // Show popup menu on right button
void menu_popup (uint button, uint time) { void menu_popup (uint button, uint time) {
menu.popup (null, null, null, button, time); menu.popup_at_pointer (null);
} }
public override void set_tooltip (string info) { public override void set_tooltip (string info) {

View File

@ -18,9 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// i18n
const string GETTEXT_PACKAGE = "pamac";
const string update_icon_name = "pamac-tray-update"; const string update_icon_name = "pamac-tray-update";
const string noupdate_icon_name = "pamac-tray-no-update"; const string noupdate_icon_name = "pamac-tray-no-update";
const string noupdate_info = _("Your system is up-to-date"); const string noupdate_info = _("Your system is up-to-date");
@ -28,15 +25,15 @@ const string noupdate_info = _("Your system is up-to-date");
namespace Pamac { namespace Pamac {
[DBus (name = "org.pamac.user")] [DBus (name = "org.pamac.user")]
interface UserDaemon : Object { interface UserDaemon : Object {
public abstract void refresh_handle () throws IOError; public abstract void refresh_handle () throws DBusError, IOError;
public abstract string get_lockfile () throws IOError; public abstract string get_lockfile () throws DBusError, IOError;
#if DISABLE_AUR #if DISABLE_AUR
public abstract void start_get_updates () throws IOError; public abstract void start_get_updates () throws DBusError, IOError;
#else #else
public abstract void start_get_updates (bool check_aur_updates) throws IOError; public abstract void start_get_updates (bool check_aur_updates) throws DBusError, IOError;
#endif #endif
[DBus (no_reply = true)] [DBus (no_reply = true)]
public abstract void quit () throws IOError; public abstract void quit () throws DBusError, IOError;
public signal void get_updates_finished (Updates updates); public signal void get_updates_finished (Updates updates);
} }
@ -71,6 +68,8 @@ namespace Pamac {
daemon.quit (); daemon.quit ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }
} }
@ -132,6 +131,8 @@ namespace Pamac {
#endif #endif
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }
return true; return true;
@ -233,6 +234,8 @@ namespace Pamac {
daemon.refresh_handle (); daemon.refresh_handle ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
check_updates (); check_updates ();
} }
@ -274,8 +277,10 @@ namespace Pamac {
public override void startup () { public override void startup () {
// i18n // i18n
Intl.textdomain ("pamac"); Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
Intl.setlocale (LocaleCategory.ALL, ""); Intl.setlocale (LocaleCategory.ALL, "");
Intl.textdomain(Constants.GETTEXT_PACKAGE);
Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" );
var pamac_config = new Pamac.Config (); var pamac_config = new Pamac.Config ();
// if refresh period is 0, just return so tray will exit // if refresh period is 0, just return so tray will exit
@ -303,6 +308,10 @@ namespace Pamac {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
//try standard lock file //try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck"); lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
//try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
} }
Timeout.add (200, check_extern_lock); Timeout.add (200, check_extern_lock);
// wait 30 seconds before check updates // wait 30 seconds before check updates

View File

@ -1 +0,0 @@
../alpm_config.vala

View File

@ -4,7 +4,7 @@ cfg_pamac_user_daemon.set('PKGDATADIR', join_paths(get_option('prefix'),get_opti
cfg_pamac_user_daemon.set('GETTEXT_PACKAGE', 'pamac') cfg_pamac_user_daemon.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_user_daemon.set('RELEASE_NAME', 'pamac') cfg_pamac_user_daemon.set('RELEASE_NAME', 'pamac')
cfg_pamac_user_daemon.set('PREFIX', get_option('prefix')) cfg_pamac_user_daemon.set('PREFIX', get_option('prefix'))
cfg_pamac_user_daemon.set('VERSION', '6.7.2') cfg_pamac_user_daemon.set('VERSION', '7.0.0')
cfg_pamac_user_daemon.set('TESTSRCDIR', meson.source_root()) cfg_pamac_user_daemon.set('TESTSRCDIR', meson.source_root())
cfgfile_2 = configure_file( cfgfile_2 = configure_file(
@ -20,12 +20,10 @@ pamac_user_daemon_deps += [gio_2_0_dep]
pamac_user_daemon_deps += [glib_2_0_dep] pamac_user_daemon_deps += [glib_2_0_dep]
pamac_user_daemon_deps += [gobject_2_0_dep] pamac_user_daemon_deps += [gobject_2_0_dep]
pamac_user_daemon_sources = [cfgfile_2] pamac_user_daemon_sources = [cfgfile_2]
pamac_user_daemon_sources += ['alpm_config.vala']
pamac_user_daemon_sources += ['pamac_config.vala']
pamac_user_daemon_sources += ['user_daemon.vala'] pamac_user_daemon_sources += ['user_daemon.vala']
pamac_user_daemon_vala_args = ['--pkg','posix'] pamac_user_daemon_vala_args = ['--pkg','posix']
pamac_user_daemon_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] pamac_user_daemon_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_user_daemon_dependencies = [pamacclassic_library] pamac_user_daemon_dependencies = [Pamac_library]
pamac_user_daemon_c_args = [] pamac_user_daemon_c_args = []
if ENABLE_UPDATE_ICON if ENABLE_UPDATE_ICON
pamac_user_daemon_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] pamac_user_daemon_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

@ -1 +0,0 @@
../pamac_config.vala

View File

@ -34,10 +34,10 @@ namespace Pamac {
#else #else
private bool check_aur_updates; private bool check_aur_updates;
private bool aur_updates_checked; private bool aur_updates_checked;
#endif
private Json.Array aur_updates_results; private Json.Array aur_updates_results;
private HashTable<string, Json.Array> aur_search_results; private HashTable<string, Json.Array> aur_search_results;
private HashTable<string, Json.Object> aur_infos; private HashTable<string, Json.Object> aur_infos;
#endif
public signal void get_updates_finished (Updates updates); public signal void get_updates_finished (Updates updates);
@ -49,10 +49,16 @@ namespace Pamac {
aur_search_results = new HashTable<string, Json.Array> (str_hash, str_equal); aur_search_results = new HashTable<string, Json.Array> (str_hash, str_equal);
aur_infos = new HashTable<string, Json.Object> (str_hash, str_equal); aur_infos = new HashTable<string, Json.Object> (str_hash, str_equal);
#endif #endif
try {
refresh_handle (); refresh_handle ();
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
} }
public void refresh_handle () { public void refresh_handle () throws DBusError, IOError {
alpm_config.reload (); alpm_config.reload ();
alpm_handle = alpm_config.get_handle (); alpm_handle = alpm_config.get_handle ();
if (alpm_handle == null) { if (alpm_handle == null) {
@ -67,15 +73,15 @@ namespace Pamac {
} }
} }
public bool get_checkspace () { public bool get_checkspace () throws DBusError, IOError {
return alpm_handle.checkspace == 1 ? true : false; return alpm_handle.checkspace == 1 ? true : false;
} }
public string get_lockfile () { public string get_lockfile () throws DBusError, IOError {
return alpm_handle.lockfile; return alpm_handle.lockfile;
} }
public string[] get_ignorepkgs () { public string[] get_ignorepkgs () throws DBusError, IOError {
string[] result = {}; string[] result = {};
unowned Alpm.List<unowned string> ignorepkgs = alpm_handle.ignorepkgs; unowned Alpm.List<unowned string> ignorepkgs = alpm_handle.ignorepkgs;
while (ignorepkgs != null) { while (ignorepkgs != null) {
@ -86,14 +92,14 @@ namespace Pamac {
return result; return result;
} }
public bool should_hold (string pkgname) { public bool should_hold (string pkgname) throws DBusError, IOError {
if (alpm_config.get_holdpkgs ().find_custom (pkgname, strcmp) != null) { if (alpm_config.get_holdpkgs ().find_custom (pkgname, strcmp) != null) {
return true; return true;
} }
return false; return false;
} }
public uint get_pkg_reason (string pkgname) { public uint get_pkg_reason (string pkgname) throws DBusError, IOError {
unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname); unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname);
if (pkg != null) { if (pkg != null) {
return pkg.reason; return pkg.reason;
@ -101,7 +107,7 @@ namespace Pamac {
return 0; return 0;
} }
public uint get_pkg_origin (string pkgname) { public uint get_pkg_origin (string pkgname) throws DBusError, IOError {
unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname); unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname);
if (pkg != null) { if (pkg != null) {
return pkg.origin; return pkg.origin;
@ -153,7 +159,7 @@ namespace Pamac {
} }
} }
public async AlpmPackage[] get_installed_pkgs () { public async AlpmPackage[] get_installed_pkgs () throws DBusError, IOError {
AlpmPackage[] pkgs = {}; AlpmPackage[] pkgs = {};
unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache; unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache;
while (pkgcache != null) { while (pkgcache != null) {
@ -164,7 +170,7 @@ namespace Pamac {
return pkgs; return pkgs;
} }
public async AlpmPackage[] get_explicitly_installed_pkgs () { public async AlpmPackage[] get_explicitly_installed_pkgs () throws DBusError, IOError {
AlpmPackage[] pkgs = {}; AlpmPackage[] pkgs = {};
unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache; unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache;
while (pkgcache != null) { while (pkgcache != null) {
@ -177,7 +183,7 @@ namespace Pamac {
return pkgs; return pkgs;
} }
public async AlpmPackage[] get_foreign_pkgs () { public async AlpmPackage[] get_foreign_pkgs () throws DBusError, IOError {
AlpmPackage[] pkgs = {}; AlpmPackage[] pkgs = {};
unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache; unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache;
while (pkgcache != null) { while (pkgcache != null) {
@ -201,7 +207,7 @@ namespace Pamac {
return pkgs; return pkgs;
} }
public async AlpmPackage[] get_orphans () { public async AlpmPackage[] get_orphans () throws DBusError, IOError {
AlpmPackage[] pkgs = {}; AlpmPackage[] pkgs = {};
unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache; unowned Alpm.List<unowned Alpm.Package> pkgcache = alpm_handle.localdb.pkgcache;
while (pkgcache != null) { while (pkgcache != null) {
@ -224,11 +230,11 @@ namespace Pamac {
return pkgs; return pkgs;
} }
public AlpmPackage get_installed_pkg (string pkgname) { public AlpmPackage get_installed_pkg (string pkgname) throws DBusError, IOError {
return initialise_pkg_struct (alpm_handle.localdb.get_pkg (pkgname)); return initialise_pkg_struct (alpm_handle.localdb.get_pkg (pkgname));
} }
public AlpmPackage find_installed_satisfier (string depstring) { public AlpmPackage find_installed_satisfier (string depstring) throws DBusError, IOError {
return initialise_pkg_struct (Alpm.find_satisfier (alpm_handle.localdb.pkgcache, depstring)); return initialise_pkg_struct (Alpm.find_satisfier (alpm_handle.localdb.pkgcache, depstring));
} }
@ -246,7 +252,7 @@ namespace Pamac {
return pkg; return pkg;
} }
public AlpmPackage get_sync_pkg (string pkgname) { public AlpmPackage get_sync_pkg (string pkgname) throws DBusError, IOError {
return initialise_pkg_struct (get_syncpkg (pkgname)); return initialise_pkg_struct (get_syncpkg (pkgname));
} }
@ -264,7 +270,7 @@ namespace Pamac {
return pkg; return pkg;
} }
public AlpmPackage find_sync_satisfier (string depstring) { public AlpmPackage find_sync_satisfier (string depstring) throws DBusError, IOError {
return initialise_pkg_struct (find_dbs_satisfier (depstring)); return initialise_pkg_struct (find_dbs_satisfier (depstring));
} }
@ -293,7 +299,7 @@ namespace Pamac {
return result; return result;
} }
public async AlpmPackage[] search_pkgs (string search_string) { public async AlpmPackage[] search_pkgs (string search_string) throws DBusError, IOError {
AlpmPackage[] result = {}; AlpmPackage[] result = {};
Alpm.List<unowned Alpm.Package> alpm_pkgs = search_all_dbs (search_string); Alpm.List<unowned Alpm.Package> alpm_pkgs = search_all_dbs (search_string);
unowned Alpm.List<unowned Alpm.Package> list = alpm_pkgs; unowned Alpm.List<unowned Alpm.Package> list = alpm_pkgs;
@ -323,9 +329,9 @@ namespace Pamac {
}; };
} }
public async AURPackage[] search_in_aur (string search_string) { public async AURPackage[] search_in_aur (string search_string) throws DBusError, IOError {
if (!aur_search_results.contains (search_string)) { if (!aur_search_results.contains (search_string)) {
Json.Array pkgs = yield AUR.search (search_string.split (" ")); Json.Array pkgs = yield search (search_string.split (" "));
aur_search_results.insert (search_string, pkgs); aur_search_results.insert (search_string, pkgs);
} }
AURPackage[] result = {}; AURPackage[] result = {};
@ -340,7 +346,7 @@ namespace Pamac {
return result; return result;
} }
public async AURPackageDetails get_aur_details (string pkgname) { public async AURPackageDetails get_aur_details (string pkgname) throws DBusError, IOError {
string name = ""; string name = "";
string version = ""; string version = "";
string desc = ""; string desc = "";
@ -362,7 +368,7 @@ namespace Pamac {
string[] conflicts = {}; string[] conflicts = {};
var details = AURPackageDetails (); var details = AURPackageDetails ();
if (!aur_infos.contains (pkgname)) { if (!aur_infos.contains (pkgname)) {
Json.Array results = yield AUR.multiinfo ({pkgname}); Json.Array results = yield multiinfo ({pkgname});
if (results.get_length () > 0) { if (results.get_length () > 0) {
aur_infos.insert (pkgname, results.get_object_element (0)); aur_infos.insert (pkgname, results.get_object_element (0));
} }
@ -483,7 +489,7 @@ namespace Pamac {
} }
#endif #endif
public string[] get_repos_names () { public string[] get_repos_names () throws DBusError, IOError {
string[] repos_names = {}; string[] repos_names = {};
unowned Alpm.List<unowned Alpm.DB> syncdbs = alpm_handle.syncdbs; unowned Alpm.List<unowned Alpm.DB> syncdbs = alpm_handle.syncdbs;
while (syncdbs != null) { while (syncdbs != null) {
@ -494,7 +500,7 @@ namespace Pamac {
return repos_names; return repos_names;
} }
public async AlpmPackage[] get_repo_pkgs (string repo) { public async AlpmPackage[] get_repo_pkgs (string repo) throws DBusError, IOError {
AlpmPackage[] pkgs = {}; AlpmPackage[] pkgs = {};
unowned Alpm.List<unowned Alpm.DB> syncdbs = alpm_handle.syncdbs; unowned Alpm.List<unowned Alpm.DB> syncdbs = alpm_handle.syncdbs;
while (syncdbs != null) { while (syncdbs != null) {
@ -518,7 +524,7 @@ namespace Pamac {
return pkgs; return pkgs;
} }
public string[] get_groups_names () { public string[] get_groups_names () throws DBusError, IOError {
string[] groups_names = {}; string[] groups_names = {};
unowned Alpm.List<unowned Alpm.Group> groupcache = alpm_handle.localdb.groupcache; unowned Alpm.List<unowned Alpm.Group> groupcache = alpm_handle.localdb.groupcache;
while (groupcache != null) { while (groupcache != null) {
@ -574,7 +580,7 @@ namespace Pamac {
return result; return result;
} }
public async AlpmPackage[] get_group_pkgs (string groupname) { public async AlpmPackage[] get_group_pkgs (string groupname) throws DBusError, IOError {
AlpmPackage[] pkgs = {}; AlpmPackage[] pkgs = {};
Alpm.List<unowned Alpm.Package> alpm_pkgs = group_pkgs (groupname); Alpm.List<unowned Alpm.Package> alpm_pkgs = group_pkgs (groupname);
unowned Alpm.List<unowned Alpm.Package> list = alpm_pkgs; unowned Alpm.List<unowned Alpm.Package> list = alpm_pkgs;
@ -586,7 +592,7 @@ namespace Pamac {
return pkgs; return pkgs;
} }
public string[] get_pkg_uninstalled_optdeps (string pkgname) { public string[] get_pkg_uninstalled_optdeps (string pkgname) throws DBusError, IOError {
string[] optdeps = {}; string[] optdeps = {};
unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (pkgname); unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (pkgname);
if (alpm_pkg == null) { if (alpm_pkg == null) {
@ -605,7 +611,7 @@ namespace Pamac {
return optdeps; return optdeps;
} }
public AlpmPackageDetails get_pkg_details (string pkgname) { public AlpmPackageDetails get_pkg_details (string pkgname) throws DBusError, IOError {
string name = ""; string name = "";
string version = ""; string version = "";
string desc = ""; string desc = "";
@ -779,7 +785,7 @@ namespace Pamac {
return details; return details;
} }
public string[] get_pkg_files (string pkgname) { public string[] get_pkg_files (string pkgname) throws DBusError, IOError {
string[] files = {}; string[] files = {};
unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (pkgname); unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (pkgname);
if (alpm_pkg != null) { if (alpm_pkg != null) {
@ -813,7 +819,10 @@ namespace Pamac {
private int get_updates () { private int get_updates () {
AlpmPackage[] updates_infos = {}; AlpmPackage[] updates_infos = {};
#if DISABLE_AUR
#else
unowned Alpm.Package? pkg = null; unowned Alpm.Package? pkg = null;
#endif
unowned Alpm.Package? candidate = null; unowned Alpm.Package? candidate = null;
// use a tmp handle // use a tmp handle
var tmp_handle = alpm_config.get_handle (false, true); var tmp_handle = alpm_config.get_handle (false, true);
@ -843,7 +852,10 @@ namespace Pamac {
syncdbs.next (); syncdbs.next ();
} }
} }
#if DISABLE_AUR
#else
string[] local_pkgs = {}; string[] local_pkgs = {};
#endif
unowned Alpm.List<unowned Alpm.Package> pkgcache = tmp_handle.localdb.pkgcache; unowned Alpm.List<unowned Alpm.Package> pkgcache = tmp_handle.localdb.pkgcache;
while (pkgcache != null) { while (pkgcache != null) {
unowned Alpm.Package installed_pkg = pkgcache.data; unowned Alpm.Package installed_pkg = pkgcache.data;
@ -882,8 +894,8 @@ namespace Pamac {
if (check_aur_updates) { if (check_aur_updates) {
// get aur updates // get aur updates
if (!aur_updates_checked) { if (!aur_updates_checked) {
AUR.multiinfo.begin (local_pkgs, (obj, res) => { multiinfo.begin (local_pkgs, (obj, res) => {
aur_updates_results = AUR.multiinfo.end (res); aur_updates_results = multiinfo.end (res);
aur_updates_checked = true; aur_updates_checked = true;
var updates = Updates () { var updates = Updates () {
repos_updates = (owned) updates_infos, repos_updates = (owned) updates_infos,
@ -936,16 +948,16 @@ namespace Pamac {
#endif #endif
#if DISABLE_AUR #if DISABLE_AUR
public void start_get_updates () { public void start_get_updates () throws DBusError, IOError {
#else #else
public void start_get_updates (bool check_aur_updates_) { public void start_get_updates (bool check_aur_updates_) throws DBusError, IOError {
check_aur_updates = check_aur_updates_; check_aur_updates = check_aur_updates_;
#endif #endif
new Thread<int> ("get updates thread", get_updates); new Thread<int> ("get updates thread", get_updates);
} }
[DBus (no_reply = true)] [DBus (no_reply = true)]
public void quit () { public void quit () throws DBusError, IOError {
loop.quit (); loop.quit ();
} }
// End of Daemon Object // End of Daemon Object
@ -1020,8 +1032,10 @@ void on_bus_acquired (DBusConnection conn) {
void main () { void main () {
// i18n // i18n
Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
Intl.setlocale (LocaleCategory.ALL, ""); Intl.setlocale (LocaleCategory.ALL, "");
Intl.textdomain (GETTEXT_PACKAGE); Intl.textdomain(Constants.GETTEXT_PACKAGE);
Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" );
Bus.own_name (BusType.SESSION, Bus.own_name (BusType.SESSION,
"org.pamac.user", "org.pamac.user",

View File

@ -19,7 +19,7 @@
*/ */
namespace Pamac { namespace Pamac {
class Config { public class Config {
HashTable<string,string> _environment_variables; HashTable<string,string> _environment_variables;
public bool recurse { get; private set; } public bool recurse { get; private set; }

View File

@ -1,10 +0,0 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=@DOLLAR@{prefix}/${CMAKE_INSTALL_LIBDIR}
includedir=@DOLLAR@{prefix}/${CMAKE_INSTALL_INCLUDEDIR}
Name: pamacclassic
Description: pamacclassic
Version: 6.7.2
Libs: -L@DOLLAR@{libdir} -lpamacclassic
Cflags: -I@DOLLAR@{includedir}
Requires: gdk-3.0 gtk+-3.0 json-glib-1.0 libalpm libnotify libsoup-2.4 vte-2.91 gio-2.0 glib-2.0 gobject-2.0

View File

@ -1,7 +1,7 @@
/* /*
* pamac-vala * pamac-vala
* *
* Copyright (C) 2017 Chris Cromer <cromer@cromnix.org> * Copyright (C) 2017-2019 Chris Cromer <cromer@cromnix.org>
* Copyright (C) 2015-2017 Guillaume Benoit <guillaume@manjaro.org> * Copyright (C) 2015-2017 Guillaume Benoit <guillaume@manjaro.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -117,8 +117,8 @@ namespace Pamac {
cache_only_uninstalled_checkbutton.active = transaction.rm_only_uninstalled; cache_only_uninstalled_checkbutton.active = transaction.rm_only_uninstalled;
// Set up terminal // Set up terminal
terminal_background.set_use_alpha (false); terminal_background.use_alpha = false;
terminal_foreground.set_use_alpha (false); terminal_foreground.use_alpha = false;
Gdk.RGBA rgba = Gdk.RGBA (); Gdk.RGBA rgba = Gdk.RGBA ();
bool tmp = rgba.parse (transaction.terminal_background); bool tmp = rgba.parse (transaction.terminal_background);
terminal_background.rgba = rgba; terminal_background.rgba = rgba;
@ -274,10 +274,10 @@ namespace Pamac {
void on_select_font () { void on_select_font () {
var settings = new Settings ("org.pamac.main"); var settings = new Settings ("org.pamac.main");
settings.set_string ("terminal-font", terminal_font.get_font_name ()); settings.set_string ("terminal-font", terminal_font.get_font ());
config_changed(); config_changed();
transaction.start_save_pamac_config (); transaction.start_save_pamac_config ();
transaction.update_terminal_font (terminal_font.get_font_name ()); transaction.update_terminal_font (terminal_font.get_font ());
} }
#if DISABLE_AUR #if DISABLE_AUR

View File

@ -1,7 +1,7 @@
/* /*
* pamac-vala * pamac-vala
* *
* Copyright (C) 2017 Chris Cromer <cromer@cromnix.org> * Copyright (C) 2017-2019 Chris Cromer <cromer@cromnix.org>
* Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org> * Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -19,82 +19,85 @@
*/ */
//using Math //using Math
//using Vte
//using Posix
namespace Pamac { namespace Pamac {
[DBus (name = "org.pamac.user")] [DBus (name = "org.pamac.user")]
interface UserDaemon : Object { interface UserDaemon : Object {
public abstract void refresh_handle () throws IOError; public abstract void refresh_handle () throws DBusError, IOError;
public abstract AlpmPackage get_installed_pkg (string pkgname) throws IOError; public abstract AlpmPackage get_installed_pkg (string pkgname) throws DBusError, IOError;
public abstract bool get_checkspace () throws IOError; public abstract bool get_checkspace () throws DBusError, IOError;
public abstract string[] get_ignorepkgs () throws IOError; public abstract string[] get_ignorepkgs () throws DBusError, IOError;
public abstract bool should_hold (string pkgname) throws IOError; public abstract bool should_hold (string pkgname) throws DBusError, IOError;
public abstract uint get_pkg_reason (string pkgname) throws IOError; public abstract uint get_pkg_reason (string pkgname) throws DBusError, IOError;
public abstract uint get_pkg_origin (string pkgname) throws IOError; public abstract uint get_pkg_origin (string pkgname) throws DBusError, IOError;
public abstract async AlpmPackage[] get_installed_pkgs () throws IOError; public abstract async AlpmPackage[] get_installed_pkgs () throws DBusError, IOError;
public abstract async AlpmPackage[] get_explicitly_installed_pkgs () throws IOError; public abstract async AlpmPackage[] get_explicitly_installed_pkgs () throws DBusError, IOError;
public abstract async AlpmPackage[] get_foreign_pkgs () throws IOError; public abstract async AlpmPackage[] get_foreign_pkgs () throws DBusError, IOError;
public abstract async AlpmPackage[] get_orphans () throws IOError; public abstract async AlpmPackage[] get_orphans () throws DBusError, IOError;
public abstract AlpmPackage find_installed_satisfier (string depstring) throws IOError; public abstract AlpmPackage find_installed_satisfier (string depstring) throws DBusError, IOError;
public abstract AlpmPackage get_sync_pkg (string pkgname) throws IOError; public abstract AlpmPackage get_sync_pkg (string pkgname) throws DBusError, IOError;
public abstract AlpmPackage find_sync_satisfier (string depstring) throws IOError; public abstract AlpmPackage find_sync_satisfier (string depstring) throws DBusError, IOError;
public abstract async AlpmPackage[] search_pkgs (string search_string) throws IOError; public abstract async AlpmPackage[] search_pkgs (string search_string) throws DBusError, IOError;
#if DISABLE_AUR #if DISABLE_AUR
#else #else
public abstract async AURPackage[] search_in_aur (string search_string) throws IOError; public abstract async AURPackage[] search_in_aur (string search_string) throws DBusError, IOError;
#endif #endif
public abstract string[] get_repos_names () throws IOError; public abstract string[] get_repos_names () throws DBusError, IOError;
public abstract async AlpmPackage[] get_repo_pkgs (string repo) throws IOError; public abstract async AlpmPackage[] get_repo_pkgs (string repo) throws DBusError, IOError;
public abstract string[] get_groups_names () throws IOError; public abstract string[] get_groups_names () throws DBusError, IOError;
public abstract async AlpmPackage[] get_group_pkgs (string groupname) throws IOError; public abstract async AlpmPackage[] get_group_pkgs (string groupname) throws DBusError, IOError;
public abstract AlpmPackageDetails get_pkg_details (string pkgname) throws IOError; public abstract AlpmPackageDetails get_pkg_details (string pkgname) throws DBusError, IOError;
public abstract string[] get_pkg_files (string pkgname) throws IOError; public abstract string[] get_pkg_files (string pkgname) throws DBusError, IOError;
#if DISABLE_AUR #if DISABLE_AUR
#else #else
public abstract async AURPackageDetails get_aur_details (string pkgname) throws IOError; public abstract async AURPackageDetails get_aur_details (string pkgname) throws DBusError, IOError;
#endif #endif
public abstract string[] get_pkg_uninstalled_optdeps (string pkgname) throws IOError; public abstract string[] get_pkg_uninstalled_optdeps (string pkgname) throws DBusError, IOError;
#if DISABLE_AUR #if DISABLE_AUR
public abstract void start_get_updates () throws IOError; public abstract void start_get_updates () throws DBusError, IOError;
#else #else
public abstract void start_get_updates (bool check_aur_updates) throws IOError; public abstract void start_get_updates (bool check_aur_updates) throws DBusError, IOError;
#endif #endif
[DBus (no_reply = true)] [DBus (no_reply = true)]
public abstract void quit () throws IOError; public abstract void quit () throws DBusError, IOError;
public signal void get_updates_finished (Updates updates); public signal void get_updates_finished (Updates updates);
} }
[DBus (name = "org.pamac.system")] [DBus (name = "org.pamac.system")]
interface SystemDaemon : Object { interface SystemDaemon : Object {
public abstract void set_environment_variables (HashTable<string,string> variables) throws IOError; public abstract void set_environment_variables (HashTable<string,string> variables) throws DBusError, IOError;
public abstract string[] get_mirrors_countries () throws IOError; public abstract string[] get_mirrors_countries () throws DBusError, IOError;
public abstract ErrorInfos get_current_error () throws IOError; public abstract ErrorInfos get_current_error () throws DBusError, IOError;
public abstract bool get_lock () throws IOError; public abstract bool get_lock () throws DBusError, IOError;
public abstract bool unlock () throws IOError; public abstract bool unlock () throws DBusError, IOError;
public abstract void start_get_authorization () throws IOError; public abstract void start_get_authorization () throws DBusError, IOError;
public abstract void start_save_pamac_config () throws IOError; public abstract void start_save_pamac_config () throws DBusError, IOError;
public abstract void start_write_alpm_config (HashTable<string,Variant> new_alpm_conf) throws IOError; public abstract void start_write_alpm_config (HashTable<string,Variant> new_alpm_conf) throws DBusError, IOError;
public abstract void start_write_mirrors_config (HashTable<string,Variant> new_mirrors_conf) throws IOError; public abstract void start_write_mirrors_config (HashTable<string,Variant> new_mirrors_conf) throws DBusError, IOError;
public abstract void start_generate_mirrors_list () throws IOError; public abstract void start_generate_mirrors_list () throws DBusError, IOError;
public abstract void clean_cache (uint64 keep_nb, bool only_uninstalled) throws IOError; public abstract void clean_cache (uint64 keep_nb, bool only_uninstalled) throws DBusError, IOError;
public abstract void start_set_pkgreason (string pkgname, uint reason) throws IOError; public abstract void start_set_pkgreason (string pkgname, uint reason) throws DBusError, IOError;
public abstract void start_refresh (bool force) throws IOError; public abstract void start_refresh (bool force) throws DBusError, IOError;
public abstract void start_sysupgrade_prepare (bool enable_downgrade, string[] temporary_ignorepkgs) throws IOError; public abstract void start_sysupgrade_prepare (bool enable_downgrade, string[] temporary_ignorepkgs) throws DBusError, IOError;
#if DISABLE_AUR #if DISABLE_AUR
public abstract void start_trans_prepare (int transflags, string[] to_install, string[] to_remove, string[] to_load) throws IOError; public abstract void start_trans_prepare (int transflags, string[] to_install, string[] to_remove, string[] to_load) throws DBusError, IOError;
#else #else
public abstract void start_trans_prepare (int transflags, string[] to_install, string[] to_remove, string[] to_load, string[] to_build) throws IOError; public abstract void start_trans_prepare (int transflags, string[] to_install, string[] to_remove, string[] to_load, string[] to_build) throws DBusError, IOError;
#endif #endif
public abstract void choose_provider (int provider) throws IOError; public abstract void choose_provider (int provider) throws DBusError, IOError;
public abstract TransactionSummary get_transaction_summary () throws IOError; public abstract TransactionSummary get_transaction_summary () throws DBusError, IOError;
public abstract void start_trans_commit () throws IOError; public abstract void start_trans_commit () throws DBusError, IOError;
public abstract void trans_release () throws IOError; public abstract void trans_release () throws DBusError, IOError;
public abstract void trans_cancel () throws IOError; public abstract void trans_cancel () throws DBusError, IOError;
#if DISABLE_AUR #if DISABLE_AUR
public abstract void start_get_updates () throws IOError; public abstract void start_get_updates () throws DBusError, IOError;
#else #else
public abstract void start_get_updates (bool check_aur_updates) throws IOError; public abstract void start_get_updates (bool check_aur_updates) throws DBusError, IOError;
#endif #endif
[DBus (no_reply = true)] [DBus (no_reply = true)]
public abstract void quit () throws IOError; public abstract void quit () throws DBusError, IOError;
public signal void get_updates_finished (Updates updates); public signal void get_updates_finished (Updates updates);
public signal void emit_event (uint primary_event, uint secondary_event, string[] details); public signal void emit_event (uint primary_event, uint secondary_event, string[] details);
public signal void emit_providers (string depend, string[] providers); public signal void emit_providers (string depend, string[] providers);
@ -344,6 +347,9 @@ namespace Pamac {
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
return ErrorInfos (); return ErrorInfos ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return ErrorInfos ();
} }
} }
@ -354,6 +360,8 @@ namespace Pamac {
countries = system_daemon.get_mirrors_countries (); countries = system_daemon.get_mirrors_countries ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return countries; return countries;
} }
@ -365,6 +373,8 @@ namespace Pamac {
locked = system_daemon.get_lock (); locked = system_daemon.get_lock ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return locked; return locked;
} }
@ -375,6 +385,8 @@ namespace Pamac {
unlocked = system_daemon.unlock (); unlocked = system_daemon.unlock ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return unlocked; return unlocked;
} }
@ -390,6 +402,8 @@ namespace Pamac {
system_daemon.start_get_authorization (); system_daemon.start_get_authorization ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
yield; yield;
system_daemon.disconnect (handler_id); system_daemon.disconnect (handler_id);
@ -403,6 +417,9 @@ namespace Pamac {
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
system_daemon.save_pamac_config_finished.disconnect (on_save_pamac_config_finished); system_daemon.save_pamac_config_finished.disconnect (on_save_pamac_config_finished);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
system_daemon.save_pamac_config_finished.disconnect (on_save_pamac_config_finished);
} }
} }
@ -413,6 +430,9 @@ namespace Pamac {
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
system_daemon.write_alpm_config_finished.disconnect (on_write_alpm_config_finished); system_daemon.write_alpm_config_finished.disconnect (on_write_alpm_config_finished);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
system_daemon.write_alpm_config_finished.disconnect (on_write_alpm_config_finished);
} }
} }
@ -423,6 +443,9 @@ namespace Pamac {
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
system_daemon.write_mirrors_config_finished.disconnect (on_write_mirrors_config_finished); system_daemon.write_mirrors_config_finished.disconnect (on_write_mirrors_config_finished);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
system_daemon.write_mirrors_config_finished.disconnect (on_write_mirrors_config_finished);
} }
} }
@ -435,7 +458,7 @@ namespace Pamac {
copy_item.activate.connect (() => {term.copy_clipboard ();}); copy_item.activate.connect (() => {term.copy_clipboard ();});
right_click_menu.append (copy_item); right_click_menu.append (copy_item);
right_click_menu.show_all (); right_click_menu.show_all ();
right_click_menu.popup (null, null, null, event.button, event.time); right_click_menu.popup_at_pointer (event);
return true; return true;
} }
} }
@ -480,8 +503,8 @@ namespace Pamac {
} }
} catch (Error e) { } catch (Error e) {
// cancelled // cancelled
process.send_signal (Posix.SIGINT); process.send_signal (Posix.Signal.INT);
process.send_signal (Posix.SIGKILL); process.send_signal (Posix.Signal.KILL);
} }
Idle.add ((owned) callback); Idle.add ((owned) callback);
}); });
@ -529,6 +552,11 @@ namespace Pamac {
stop_progressbar_pulse (); stop_progressbar_pulse ();
system_daemon.generate_mirrors_list_data.disconnect (on_generate_mirrors_list_data); system_daemon.generate_mirrors_list_data.disconnect (on_generate_mirrors_list_data);
system_daemon.generate_mirrors_list_finished.disconnect (on_generate_mirrors_list_finished); system_daemon.generate_mirrors_list_finished.disconnect (on_generate_mirrors_list_finished);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
stop_progressbar_pulse ();
system_daemon.generate_mirrors_list_data.disconnect (on_generate_mirrors_list_data);
system_daemon.generate_mirrors_list_finished.disconnect (on_generate_mirrors_list_finished);
} }
} }
@ -537,6 +565,8 @@ namespace Pamac {
system_daemon.clean_cache (keep_nb, only_uninstalled); system_daemon.clean_cache (keep_nb, only_uninstalled);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }
@ -547,6 +577,9 @@ namespace Pamac {
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
system_daemon.set_pkgreason_finished.disconnect (on_set_pkgreason_finished); system_daemon.set_pkgreason_finished.disconnect (on_set_pkgreason_finished);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
system_daemon.set_pkgreason_finished.disconnect (on_set_pkgreason_finished);
} }
} }
@ -566,6 +599,11 @@ namespace Pamac {
system_daemon.refresh_finished.disconnect (on_refresh_finished); system_daemon.refresh_finished.disconnect (on_refresh_finished);
success = false; success = false;
finish_transaction (); finish_transaction ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
system_daemon.refresh_finished.disconnect (on_refresh_finished);
success = false;
finish_transaction ();
} }
} else { } else {
success = false; success = false;
@ -579,6 +617,8 @@ namespace Pamac {
user_daemon.refresh_handle (); user_daemon.refresh_handle ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }
@ -588,6 +628,8 @@ namespace Pamac {
checkspace = user_daemon.get_checkspace (); checkspace = user_daemon.get_checkspace ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return checkspace; return checkspace;
} }
@ -598,6 +640,8 @@ namespace Pamac {
ignorepkgs = user_daemon.get_ignorepkgs (); ignorepkgs = user_daemon.get_ignorepkgs ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return ignorepkgs; return ignorepkgs;
} }
@ -613,6 +657,14 @@ namespace Pamac {
desc = "", desc = "",
repo = "" repo = ""
}; };
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return AlpmPackage () {
name = "",
version = "",
desc = "",
repo = ""
};
} }
} }
@ -627,6 +679,14 @@ namespace Pamac {
desc = "", desc = "",
repo = "" repo = ""
}; };
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return AlpmPackage () {
name = "",
version = "",
desc = "",
repo = ""
};
} }
} }
@ -636,6 +696,8 @@ namespace Pamac {
should_hold = user_daemon.should_hold (pkgname); should_hold = user_daemon.should_hold (pkgname);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return should_hold; return should_hold;
} }
@ -646,6 +708,8 @@ namespace Pamac {
reason = user_daemon.get_pkg_reason (pkgname); reason = user_daemon.get_pkg_reason (pkgname);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return reason; return reason;
} }
@ -656,6 +720,8 @@ namespace Pamac {
origin = user_daemon.get_pkg_origin (pkgname); origin = user_daemon.get_pkg_origin (pkgname);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return origin; return origin;
} }
@ -666,6 +732,8 @@ namespace Pamac {
pkgs = yield user_daemon.get_installed_pkgs (); pkgs = yield user_daemon.get_installed_pkgs ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -676,6 +744,8 @@ namespace Pamac {
pkgs = yield user_daemon.get_explicitly_installed_pkgs (); pkgs = yield user_daemon.get_explicitly_installed_pkgs ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -686,6 +756,8 @@ namespace Pamac {
pkgs = yield user_daemon.get_foreign_pkgs (); pkgs = yield user_daemon.get_foreign_pkgs ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -696,6 +768,8 @@ namespace Pamac {
pkgs = yield user_daemon.get_orphans (); pkgs = yield user_daemon.get_orphans ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -711,6 +785,14 @@ namespace Pamac {
desc = "", desc = "",
repo = "" repo = ""
}; };
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return AlpmPackage () {
name = "",
version = "",
desc = "",
repo = ""
};
} }
} }
@ -725,6 +807,14 @@ namespace Pamac {
desc = "", desc = "",
repo = "" repo = ""
}; };
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return AlpmPackage () {
name = "",
version = "",
desc = "",
repo = ""
};
} }
} }
@ -734,6 +824,8 @@ namespace Pamac {
pkgs = yield user_daemon.search_pkgs (search_string); pkgs = yield user_daemon.search_pkgs (search_string);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -746,6 +838,8 @@ namespace Pamac {
pkgs = yield user_daemon.search_in_aur (search_string); pkgs = yield user_daemon.search_in_aur (search_string);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -757,6 +851,8 @@ namespace Pamac {
repos_names = user_daemon.get_repos_names (); repos_names = user_daemon.get_repos_names ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return repos_names; return repos_names;
} }
@ -767,6 +863,8 @@ namespace Pamac {
pkgs = yield user_daemon.get_repo_pkgs (repo); pkgs = yield user_daemon.get_repo_pkgs (repo);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -777,6 +875,8 @@ namespace Pamac {
groups_names = user_daemon.get_groups_names (); groups_names = user_daemon.get_groups_names ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return groups_names; return groups_names;
} }
@ -787,6 +887,8 @@ namespace Pamac {
pkgs = yield user_daemon.get_group_pkgs (group_name); pkgs = yield user_daemon.get_group_pkgs (group_name);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkgs; return pkgs;
} }
@ -797,6 +899,8 @@ namespace Pamac {
optdeps = user_daemon.get_pkg_uninstalled_optdeps (pkgname); optdeps = user_daemon.get_pkg_uninstalled_optdeps (pkgname);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return optdeps; return optdeps;
} }
@ -820,6 +924,22 @@ namespace Pamac {
downloadsize = "", downloadsize = "",
installsize = "" installsize = ""
}; };
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return AlpmPackageDetails () {
name = "",
version = "",
desc = "",
repo = "",
url = "",
packager = "",
builddate = "",
installdate = "",
reason = "",
has_signature = "",
downloadsize = "",
installsize = ""
};
} }
} }
@ -829,6 +949,9 @@ namespace Pamac {
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
return {}; return {};
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
return {};
} }
} }
@ -847,6 +970,8 @@ namespace Pamac {
pkg = yield user_daemon.get_aur_details (pkgname); pkg = yield user_daemon.get_aur_details (pkgname);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
return pkg; return pkg;
} }
@ -864,6 +989,10 @@ namespace Pamac {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
success = false; success = false;
finish_transaction (); finish_transaction ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
success = false;
finish_transaction ();
} }
} }
@ -879,6 +1008,10 @@ namespace Pamac {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
success = false; success = false;
finish_transaction (); finish_transaction ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
success = false;
finish_transaction ();
} }
} }
@ -897,6 +1030,10 @@ namespace Pamac {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
success = false; success = false;
finish_transaction (); finish_transaction ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
success = false;
finish_transaction ();
} }
} }
@ -989,6 +1126,11 @@ namespace Pamac {
stop_progressbar_pulse (); stop_progressbar_pulse ();
success = false; success = false;
finish_transaction (); finish_transaction ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
stop_progressbar_pulse ();
success = false;
finish_transaction ();
} }
} }
@ -1056,6 +1198,8 @@ namespace Pamac {
system_daemon.choose_provider (index); system_daemon.choose_provider (index);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }
index++; index++;
@ -1077,6 +1221,8 @@ namespace Pamac {
summary = system_daemon.get_transaction_summary (); summary = system_daemon.get_transaction_summary ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
var iter = Gtk.TreeIter (); var iter = Gtk.TreeIter ();
if (summary.to_remove.length > 0) { if (summary.to_remove.length > 0) {
@ -1206,6 +1352,10 @@ namespace Pamac {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
success = false; success = false;
finish_transaction (); finish_transaction ();
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
success = false;
finish_transaction ();
} }
} }
@ -1297,6 +1447,8 @@ namespace Pamac {
system_daemon.trans_cancel (); system_daemon.trans_cancel ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
#if DISABLE_AUR #if DISABLE_AUR
#else #else
@ -1312,6 +1464,8 @@ namespace Pamac {
system_daemon.trans_release (); system_daemon.trans_release ();
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
warning_textbuffer = new StringBuilder (); warning_textbuffer = new StringBuilder ();
} }
@ -1324,6 +1478,8 @@ namespace Pamac {
} }
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }
@ -1982,6 +2138,8 @@ namespace Pamac {
system_daemon.set_environment_variables (pamac_config.environment_variables); system_daemon.set_environment_variables (pamac_config.environment_variables);
} catch (IOError e) { } catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message); stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
} }
} }

View File

@ -38,9 +38,9 @@ namespace Alpm {
} }
public int capabilities(); public int capabilities();
public unowned Package? find_satisfier(Alpm.List<weak Package> pkgs, string depstring); public unowned Package? find_satisfier(Alpm.List<unowned Package> pkgs, string depstring);
public unowned Package? pkg_find(Alpm.List<weak Package> haystack, string needle); public unowned Package? pkg_find(Alpm.List<unowned Package> haystack, string needle);
public int pkg_vercmp(string a, string b); public int pkg_vercmp(string a, string b);
@ -48,7 +48,7 @@ namespace Alpm {
* If a member exists in several databases, only the first database is used. * If a member exists in several databases, only the first database is used.
* IgnorePkg is also handled. * IgnorePkg is also handled.
*/ */
public Alpm.List<unowned Package?> find_group_pkgs(Alpm.List<DB> dbs, string name); public Alpm.List<unowned Package?> find_group_pkgs(Alpm.List<unowned DB> dbs, string name);
/** Returns the string corresponding to an error number. */ /** Returns the string corresponding to an error number. */
public unowned string strerror(Errno err); public unowned string strerror(Errno err);
@ -193,7 +193,7 @@ namespace Alpm {
public unowned DB localdb { public unowned DB localdb {
[CCode (cname = "alpm_get_localdb")] get; [CCode (cname = "alpm_get_localdb")] get;
} }
public unowned Alpm.List<weak DB> syncdbs { public unowned Alpm.List<unowned DB> syncdbs {
[CCode (cname = "alpm_get_syncdbs")] get; [CCode (cname = "alpm_get_syncdbs")] get;
} }
@ -252,7 +252,7 @@ namespace Alpm {
public string? fetch_pkgurl(string url); public string? fetch_pkgurl(string url);
[CCode (cname = "alpm_find_dbs_satisfier")] [CCode (cname = "alpm_find_dbs_satisfier")]
public unowned Package? find_dbs_satisfier(Alpm.List<DB> dbs, string depstring); public unowned Package? find_dbs_satisfier(Alpm.List<unowned DB> dbs, string depstring);
/** Returns the current error code from the handle. */ /** Returns the current error code from the handle. */
[CCode (cname = "alpm_errno")] [CCode (cname = "alpm_errno")]
@ -380,7 +380,7 @@ namespace Alpm {
public unowned Package? get_pkg(string name); public unowned Package? get_pkg(string name);
public unowned Group? get_group(string name); public unowned Group? get_group(string name);
public Alpm.List<weak Package> search(Alpm.List<weak string> needles); public Alpm.List<unowned Package> search(Alpm.List<unowned string> needles);
public int check_pgp_signature(out SigList siglist); public int check_pgp_signature(out SigList siglist);
} }
@ -550,7 +550,7 @@ namespace Alpm {
public Alpm.List<string> compute_optionalfor(); public Alpm.List<string> compute_optionalfor();
[CCode (cname = "alpm_sync_newversion")] [CCode (cname = "alpm_sync_newversion")]
public unowned Package? sync_newversion(Alpm.List<weak DB> dbs); public unowned Package? sync_newversion(Alpm.List<unowned DB> dbs);
public int check_pgp_signature(out SigList siglist); public int check_pgp_signature(out SigList siglist);
} }