From 3b66f68b2c6df7db32e2e8fed68b845e13c68f1a Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 6 Jul 2019 20:28:51 -0400 Subject: [PATCH] update deprecated code --- meson.build | 9 +- pamac.avprj | 78 +++--- po/POTFILES.in | 10 +- po/pamac.pot | 2 +- src/Config.vala.base | 2 +- src/{pamacclassic.deps => Pamac.deps} | 16 +- src/Pamac.pc | 10 + src/alpm_config.vala | 16 +- src/aur.vala | 6 +- src/choose_ignorepkgs_dialog.vala | 1 + src/meson.build | 154 +++++------ src/mirrors_config.vala | 10 +- src/pamac-clean-cache/meson.build | 7 +- src/pamac-clean-cache/pamac_config.vala | 1 - src/pamac-install/installer.vala | 4 +- src/pamac-install/meson.build | 5 +- src/pamac-manager/manager.vala | 4 +- src/pamac-manager/manager_window.vala | 16 +- src/pamac-manager/meson.build | 5 +- src/pamac-system-daemon/alpm_config.vala | 1 - src/pamac-system-daemon/meson.build | 7 +- src/pamac-system-daemon/mirrors_config.vala | 1 - src/pamac-system-daemon/pamac_config.vala | 1 - src/pamac-system-daemon/system_daemon.vala | 154 +++++++---- src/pamac-tray/alpm_config.vala | 1 - src/pamac-tray/meson.build | 6 +- src/pamac-tray/pamac_config.vala | 1 - src/pamac-tray/tray-gtk.vala | 2 +- src/pamac-tray/tray.vala | 27 +- src/pamac-user-daemon/alpm_config.vala | 1 - src/pamac-user-daemon/meson.build | 6 +- src/pamac-user-daemon/pamac_config.vala | 1 - src/pamac-user-daemon/user_daemon.vala | 84 +++--- src/pamac_config.vala | 2 +- src/pamacclassic.pc | 10 - src/preferences_dialog.vala | 10 +- src/transaction.vala | 268 ++++++++++++++++---- src/vapis/libalpm.vapi | 14 +- 38 files changed, 592 insertions(+), 361 deletions(-) rename src/{pamacclassic.deps => Pamac.deps} (73%) create mode 100644 src/Pamac.pc delete mode 120000 src/pamac-clean-cache/pamac_config.vala delete mode 120000 src/pamac-system-daemon/alpm_config.vala delete mode 120000 src/pamac-system-daemon/mirrors_config.vala delete mode 120000 src/pamac-system-daemon/pamac_config.vala delete mode 120000 src/pamac-tray/alpm_config.vala delete mode 120000 src/pamac-tray/pamac_config.vala delete mode 120000 src/pamac-user-daemon/alpm_config.vala delete mode 120000 src/pamac-user-daemon/pamac_config.vala delete mode 100644 src/pamacclassic.pc diff --git a/meson.build b/meson.build index 1c6ce25..de76df9 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,6 @@ find_program ('glib-compile-resources') find_program ('gtk-update-icon-cache', 'gtk-update-icon-cache.3.0') find_program ('glib-compile-schemas') find_program ('g-ir-compiler') -gdk_3_0_dep = dependency('gdk-3.0') gtk_3_0_dep = dependency('gtk+-3.0') json_glib_1_0_dep = dependency('json-glib-1.0') libalpm_dep = dependency('libalpm') @@ -19,13 +18,19 @@ libcurl_dep = dependency('libcurl') libnotify_dep = dependency('libnotify') libsoup_2_4_dep = dependency('libsoup-2.4') polkit_gobject_1_dep = dependency('polkit-gobject-1') -vte_2_91_dep = dependency('vte-2.91') if KDE_TRAY appindicator3_0_1_dep = dependency('appindicator3-0.1') 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') glib_2_0_dep = dependency('glib-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') cfg_dbus_data = configuration_data() diff --git a/pamac.avprj b/pamac.avprj index f8f9f55..965c4fe 100644 --- a/pamac.avprj +++ b/pamac.avprj @@ -1,8 +1,8 @@ ### AutoVala Project ### autovala_version: 30 project_name: pamac -project_version: 6.7.2 -vala_version: 0.38 +project_version: 7.0.0 +vala_version: 0.44 custom: data/systemd/pamac-system.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 vala_binary: src/pamac-clean-cache/pamac-clean-cache -*version: 6.7.2 -vala_local_package: pamacclassic +*version: 7.0.0 +vala_local_package: Pamac +vala_vapi: ../vapis/libalpm.vapi vala_package: posix vala_check_package: gtk+-3.0 vala_check_package: json-glib-1.0 *vala_check_package: glib-2.0 -*vala_check_package: gobject-2.0 *vala_source: clean_cache.vala -*vala_source: pamac_config.vala vala_binary: src/pamac-install/pamac-install -*version: 6.7.2 +*version: 7.0.0 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: json-glib-1.0 *vala_check_package: gio-2.0 @@ -45,10 +45,11 @@ vala_check_package: json-glib-1.0 *vala_source: progress_dialog.vala vala_binary: src/pamac-manager/pamac-manager -*version: 6.7.2 +*version: 7.0.0 alias: pamac-updater 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: json-glib-1.0 *vala_check_package: gio-2.0 @@ -59,8 +60,8 @@ vala_check_package: json-glib-1.0 *vala_source: manager_window.vala vala_binary: src/pamac-system-daemon/pamac-system-daemon -*version: 6.7.2 -vala_local_package: pamacclassic +*version: 7.0.0 +vala_local_package: Pamac vala_package: posix vala_check_package: gtk+-3.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: glib-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_binary: src/pamac-tray/pamac-tray -*version: 6.7.2 -vala_local_package: pamacclassic +*version: 7.0.0 +vala_local_package: Pamac vala_package: posix vala_check_package: json-glib-1.0 vala_check_package: libalpm @@ -96,13 +94,11 @@ vala_source: tray-appindicator.vala else vala_source: tray-gtk.vala end -*vala_source: alpm_config.vala -*vala_source: pamac_config.vala *vala_source: tray.vala vala_binary: src/pamac-user-daemon/pamac-user-daemon -*version: 6.7.2 -vala_local_package: pamacclassic +*version: 7.0.0 +vala_local_package: Pamac vala_package: posix vala_check_package: gtk+-3.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: glib-2.0 *vala_check_package: gobject-2.0 -*vala_source: alpm_config.vala -*vala_source: pamac_config.vala *vala_source: user_daemon.vala -vala_library: src/pamac-classic -*version: 6.7.2 -namespace: pamacclassic +vala_library: src/pamac +*version: 7.0.0 +*namespace: Pamac use_gresource: pamac_transaction_gresource_xml -vala_package: posix -vala_check_package: gdk-3.0 -vala_check_package: gtk+-3.0 -vala_check_package: json-glib-1.0 -vala_check_package: libalpm -vala_check_package: libnotify -vala_check_package: libsoup-2.4 -vala_check_package: vte-2.91 +*vala_package: posix +*vala_check_package: atk +*vala_check_package: cairo +*vala_check_package: gdk-3.0 +*vala_check_package: gdk-pixbuf-2.0 *vala_check_package: gio-2.0 *vala_check_package: glib-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 -if NOT DISABLE_AUR -vala_source: aur.vala -end *vala_source: alpm_config.vala +*vala_source: aur.vala *vala_source: choose_ignorepkgs_dialog.vala *vala_source: choose_provider_dialog.vala *vala_source: common.vala @@ -166,23 +162,15 @@ end *translate: vala src/mirrors_config.vala *translate: vala src/package.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/progress_dialog.vala *translate: vala src/pamac-manager/history_dialog.vala *translate: vala src/pamac-manager/manager.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-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-gtk.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_config.vala *translate: vala src/preferences_dialog.vala diff --git a/po/POTFILES.in b/po/POTFILES.in index ad653db..4625979 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,24 +1,16 @@ src/pamac-clean-cache/clean_cache.vala -src/pamac-clean-cache/pamac_config.vala src/pamac-install/installer.vala src/pamac-install/progress_dialog.vala src/pamac-manager/history_dialog.vala src/pamac-manager/manager.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-tray/tray-appindicator.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-user-daemon/alpm_config.vala -src/pamac-user-daemon/pamac_config.vala src/pamac-user-daemon/user_daemon.vala -src/aur.vala src/alpm_config.vala +src/aur.vala src/choose_ignorepkgs_dialog.vala src/choose_provider_dialog.vala src/common.vala diff --git a/po/pamac.pot b/po/pamac.pot index e16e45b..460b0b3 100644 --- a/po/pamac.pot +++ b/po/pamac.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Pamac\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/Config.vala.base b/src/Config.vala.base index ba56978..1b5095e 100644 --- a/src/Config.vala.base +++ b/src/Config.vala.base @@ -1,4 +1,4 @@ -namespace pamacclassic { +namespace Pamac { public const string DATADIR = "@DATADIR@"; public const string PKGDATADIR = "@PKGDATADIR@"; public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; diff --git a/src/pamacclassic.deps b/src/Pamac.deps similarity index 73% rename from src/pamacclassic.deps rename to src/Pamac.deps index 280bc7a..6184a05 100644 --- a/src/pamacclassic.deps +++ b/src/Pamac.deps @@ -1,11 +1,15 @@ posix +atk +cairo gdk-3.0 -gtk+-3.0 -json-glib-1.0 -libalpm -libnotify -libsoup-2.4 -vte-2.91 +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 diff --git a/src/Pamac.pc b/src/Pamac.pc new file mode 100644 index 0000000..b94d350 --- /dev/null +++ b/src/Pamac.pc @@ -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 diff --git a/src/alpm_config.vala b/src/alpm_config.vala index 2c40be3..7310556 100644 --- a/src/alpm_config.vala +++ b/src/alpm_config.vala @@ -1,7 +1,7 @@ /* * alpm_config * - * Copyright (C) 2017 Chris Cromer + * Copyright (C) 2017-2019 Chris Cromer * Copyright (C) 2014-2017 Guillaume Benoit * * This program is free software; you can redistribute it and/or modify @@ -18,6 +18,8 @@ * along with this program. If not, see . */ +//using Alpm + [Compact] class AlpmRepo { public string name; @@ -43,7 +45,7 @@ class AlpmRepo { } -class AlpmConfig { +public class AlpmConfig { string conf_path; string? rootdir; string? dbpath; @@ -330,10 +332,10 @@ class AlpmConfig { } } } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } 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 (); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } 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); } } else { - GLib.stderr.printf("unrecognized siglevel: %s\n", conf_string); + stderr.printf("unrecognized siglevel: %s\n", conf_string); } } siglevel &= ~Alpm.Signature.Level.USE_DEFAULT; diff --git a/src/aur.vala b/src/aur.vala index ad44df9..a8c5997 100644 --- a/src/aur.vala +++ b/src/aur.vala @@ -18,7 +18,11 @@ * along with this program. If not, see . */ -namespace AUR { +//using Json +//using Soup +//using Alpm + +namespace Pamac { // AUR urls const string aur_url = "http://aur.archlinux.org"; const string rpc_url = aur_url + "/rpc/?v=5"; diff --git a/src/choose_ignorepkgs_dialog.vala b/src/choose_ignorepkgs_dialog.vala index 43973b3..95ad5fe 100644 --- a/src/choose_ignorepkgs_dialog.vala +++ b/src/choose_ignorepkgs_dialog.vala @@ -19,6 +19,7 @@ */ //using GIO +//using Gtk namespace Pamac { diff --git a/src/meson.build b/src/meson.build index fe820a1..84af0b5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,93 +1,99 @@ -cfg_pamac_classic = configuration_data() -cfg_pamac_classic.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_classic.set('GETTEXT_PACKAGE', 'pamac') -cfg_pamac_classic.set('RELEASE_NAME', 'pamac') -cfg_pamac_classic.set('PREFIX', get_option('prefix')) -cfg_pamac_classic.set('VERSION', '6.7.2') -cfg_pamac_classic.set('TESTSRCDIR', meson.source_root()) +cfg_pamac = configuration_data() +cfg_pamac.set('DATADIR', join_paths(get_option('prefix'),get_option('datadir'))) +cfg_pamac.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('datadir'),'pamac')) +cfg_pamac.set('GETTEXT_PACKAGE', 'pamac') +cfg_pamac.set('RELEASE_NAME', 'pamac') +cfg_pamac.set('PREFIX', get_option('prefix')) +cfg_pamac.set('VERSION', '7.0.0') +cfg_pamac.set('TESTSRCDIR', meson.source_root()) cfgfile_1 = configure_file( input: 'Config.vala.base', output: 'Config.vala', - configuration: cfg_pamac_classic) + configuration: cfg_pamac) -pamac_classic_deps = [gdk_3_0_dep] -pamac_classic_deps += [gtk_3_0_dep] -pamac_classic_deps += [json_glib_1_0_dep] -pamac_classic_deps += [libalpm_dep] -pamac_classic_deps += [libnotify_dep] -pamac_classic_deps += [libsoup_2_4_dep] -pamac_classic_deps += [vte_2_91_dep] -pamac_classic_deps += [gio_2_0_dep] -pamac_classic_deps += [glib_2_0_dep] -pamac_classic_deps += [gobject_2_0_dep] -pamac_classic_sources = [cfgfile_1] -if not DISABLE_AUR -pamac_classic_sources += ['aur.vala'] -endif -pamac_classic_sources += ['alpm_config.vala'] -pamac_classic_sources += ['choose_ignorepkgs_dialog.vala'] -pamac_classic_sources += ['choose_provider_dialog.vala'] -pamac_classic_sources += ['common.vala'] -pamac_classic_sources += ['mirrors_config.vala'] -pamac_classic_sources += ['package.vala'] -pamac_classic_sources += ['pamac_config.vala'] -pamac_classic_sources += ['preferences_dialog.vala'] -pamac_classic_sources += ['progress_box.vala'] -pamac_classic_sources += ['transaction.vala'] -pamac_classic_sources += ['transaction_sum_dialog.vala'] -pamac_classic_sources += [pamac_transaction_gresource_xml_file_c] -pamac_classic_vala_args = ['--pkg','posix'] -pamac_classic_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')] -pamac_classic_vala_args += ['--gresources='+join_paths(meson.source_root(),'data/pamac.transaction.gresource.xml')] -pamac_classic_c_args = [] +pamac_deps = [atk_dep] +pamac_deps += [cairo_dep] +pamac_deps += [gdk_3_0_dep] +pamac_deps += [gdk_pixbuf_2_0_dep] +pamac_deps += [gio_2_0_dep] +pamac_deps += [glib_2_0_dep] +pamac_deps += [gobject_2_0_dep] +pamac_deps += [gtk_3_0_dep] +pamac_deps += [json_glib_1_0_dep] +pamac_deps += [libalpm_dep] +pamac_deps += [libsoup_2_4_dep] +pamac_deps += [pango_dep] +pamac_deps += [vte_2_91_dep] +pamac_deps += [x11_dep] +pamac_sources = [cfgfile_1] +pamac_sources += ['alpm_config.vala'] +pamac_sources += ['aur.vala'] +pamac_sources += ['choose_ignorepkgs_dialog.vala'] +pamac_sources += ['choose_provider_dialog.vala'] +pamac_sources += ['common.vala'] +pamac_sources += ['mirrors_config.vala'] +pamac_sources += ['package.vala'] +pamac_sources += ['pamac_config.vala'] +pamac_sources += ['preferences_dialog.vala'] +pamac_sources += ['progress_box.vala'] +pamac_sources += ['transaction.vala'] +pamac_sources += ['transaction_sum_dialog.vala'] +pamac_sources += [pamac_transaction_gresource_xml_file_c] +pamac_vala_args = ['--pkg','posix'] +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 - pamac_classic_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] - pamac_classic_c_args += ['-DENABLE_UPDATE_ICON'] + pamac_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] + pamac_c_args += ['-DENABLE_UPDATE_ICON'] endif if ENABLE_HAMBURGER - pamac_classic_vala_args += ['-D', 'ENABLE_HAMBURGER'] - pamac_classic_c_args += ['-DENABLE_HAMBURGER'] + pamac_vala_args += ['-D', 'ENABLE_HAMBURGER'] + pamac_c_args += ['-DENABLE_HAMBURGER'] endif if KDE_TRAY - pamac_classic_vala_args += ['-D', 'KDE_TRAY'] - pamac_classic_c_args += ['-DKDE_TRAY'] + pamac_vala_args += ['-D', 'KDE_TRAY'] + pamac_c_args += ['-DKDE_TRAY'] endif if DISABLE_AUR - pamac_classic_vala_args += ['-D', 'DISABLE_AUR'] - pamac_classic_c_args += ['-DDISABLE_AUR'] + pamac_vala_args += ['-D', 'DISABLE_AUR'] + pamac_c_args += ['-DDISABLE_AUR'] endif -pamac_classic_deps += [meson.get_compiler('c').find_library('m', required : false)] -pamac_classic_link_args = ['-rdynamic'] +pamac_deps += [meson.get_compiler('c').find_library('m', required : false)] +pamac_link_args = ['-rdynamic'] -pamacclassic_library = shared_library('pamacclassic', pamac_classic_sources, - dependencies: pamac_classic_deps, - vala_args: pamac_classic_vala_args, - c_args: pamac_classic_c_args, - link_args: pamac_classic_link_args, - version: '6.7.2', - soversion: '6', +Pamac_library = shared_library('Pamac', pamac_sources, + dependencies: pamac_deps, + vala_args: pamac_vala_args, + c_args: pamac_c_args, + link_args: pamac_link_args, + version: '7.0.0', + soversion: '7', install: true, install_dir: [true, true, true]) -pamac_classic_requires = [] -pamac_classic_requires += ['gdk-3.0'] -pamac_classic_requires += ['gtk+-3.0'] -pamac_classic_requires += ['json-glib-1.0'] -pamac_classic_requires += ['libalpm'] -pamac_classic_requires += ['libnotify'] -pamac_classic_requires += ['libsoup-2.4'] -pamac_classic_requires += ['vte-2.91'] -pamac_classic_requires += ['gio-2.0'] -pamac_classic_requires += ['glib-2.0'] -pamac_classic_requires += ['gobject-2.0'] +pamac_requires = [] +pamac_requires += ['atk'] +pamac_requires += ['cairo'] +pamac_requires += ['gdk-3.0'] +pamac_requires += ['gdk-pixbuf-2.0'] +pamac_requires += ['gio-2.0'] +pamac_requires += ['glib-2.0'] +pamac_requires += ['gobject-2.0'] +pamac_requires += ['gtk+-3.0'] +pamac_requires += ['json-glib-1.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.generate(libraries : pamacclassic_library, - version : '6.7.2', - name : 'pamacclassic', - filebase : 'pamacclassic', - description : 'pamacclassic', - requires : pamac_classic_requires) +pkg_mod.generate(libraries : Pamac_library, + version : '7.0.0', + name : 'Pamac', + filebase : 'Pamac', + description : 'Pamac', + 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')) diff --git a/src/mirrors_config.vala b/src/mirrors_config.vala index b237e95..f928494 100644 --- a/src/mirrors_config.vala +++ b/src/mirrors_config.vala @@ -19,7 +19,7 @@ */ namespace Pamac { - class MirrorsConfig { + public class MirrorsConfig { string conf_path; public string choosen_generation_method { get; private set; } @@ -69,10 +69,10 @@ namespace Pamac { } } } catch (Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } 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); } } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } else { - GLib.stderr.printf ("File '%s' doesn't exist.\n", file.get_path ()); + stderr.printf ("File '%s' doesn't exist.\n", file.get_path ()); } } } diff --git a/src/pamac-clean-cache/meson.build b/src/pamac-clean-cache/meson.build index 1536e9a..e3b381a 100644 --- a/src/pamac-clean-cache/meson.build +++ b/src/pamac-clean-cache/meson.build @@ -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('RELEASE_NAME', 'pamac') 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()) cfgfile_4 = configure_file( @@ -15,13 +15,12 @@ cfgfile_4 = configure_file( pamac_clean_cache_deps = [gtk_3_0_dep] pamac_clean_cache_deps += [json_glib_1_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 += ['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 += ['--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 = [] if ENABLE_UPDATE_ICON pamac_clean_cache_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] diff --git a/src/pamac-clean-cache/pamac_config.vala b/src/pamac-clean-cache/pamac_config.vala deleted file mode 120000 index 95475bb..0000000 --- a/src/pamac-clean-cache/pamac_config.vala +++ /dev/null @@ -1 +0,0 @@ -../pamac_config.vala \ No newline at end of file diff --git a/src/pamac-install/installer.vala b/src/pamac-install/installer.vala index cb7e10d..9e72102 100644 --- a/src/pamac-install/installer.vala +++ b/src/pamac-install/installer.vala @@ -32,8 +32,10 @@ namespace Pamac { public override void startup () { // i18n - Intl.textdomain ("pamac"); + Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale")); Intl.setlocale (LocaleCategory.ALL, ""); + Intl.textdomain(Constants.GETTEXT_PACKAGE); + Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" ); base.startup (); diff --git a/src/pamac-install/meson.build b/src/pamac-install/meson.build index b32f314..0531490 100644 --- a/src/pamac-install/meson.build +++ b/src/pamac-install/meson.build @@ -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('RELEASE_NAME', 'pamac') 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()) cfgfile_5 = configure_file( @@ -21,9 +21,10 @@ pamac_install_sources = [cfgfile_5] pamac_install_sources += ['installer.vala'] pamac_install_sources += ['progress_dialog.vala'] 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 += ['--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 = [] if ENABLE_UPDATE_ICON pamac_install_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] diff --git a/src/pamac-manager/manager.vala b/src/pamac-manager/manager.vala index 39bcef7..77d1eb8 100644 --- a/src/pamac-manager/manager.vala +++ b/src/pamac-manager/manager.vala @@ -31,8 +31,10 @@ namespace Pamac { public override void startup () { // i18n - Intl.textdomain ("pamac"); + Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale")); Intl.setlocale (LocaleCategory.ALL, ""); + Intl.textdomain(Constants.GETTEXT_PACKAGE); + Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" ); base.startup (); diff --git a/src/pamac-manager/manager_window.vala b/src/pamac-manager/manager_window.vala index 8396704..d7cb410 100644 --- a/src/pamac-manager/manager_window.vala +++ b/src/pamac-manager/manager_window.vala @@ -100,8 +100,11 @@ namespace Pamac { Gtk.Label updated_label; [GtkChild] Gtk.Stack properties_stack; +#if DISABLE_AUR +#else [GtkChild] Gtk.StackSwitcher properties_stackswitcher; +#endif [GtkChild] Gtk.Grid deps_grid; [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; } } @@ -1606,7 +1609,7 @@ namespace Pamac { upgrade_item.sensitive = true; } } - right_click_menu.popup (null, null, null, event.button, event.time); + right_click_menu.popup_at_pointer (event); return true; } } @@ -1887,12 +1890,11 @@ namespace Pamac { refresh_packages_list (); } - - void on_menu_button_toggled () { #if ENABLE_HAMBURGER + void on_menu_button_toggled () { preferences_button.sensitive = !(transaction_running || sysupgrade_running); -#endif } +#endif [GtkCallback] void on_history_button_clicked () { @@ -1902,7 +1904,7 @@ namespace Pamac { } var file = GLib.File.new_for_path ("/var/log/pacman.log"); 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 { StringBuilder text = new StringBuilder (); try { @@ -1916,7 +1918,7 @@ namespace Pamac { text.prepend (line + "\n"); } } catch (GLib.Error e) { - GLib.stderr.printf ("%s\n", e.message); + stderr.printf ("%s\n", e.message); } var history_dialog = new HistoryDialog (this); history_dialog.textview.buffer.set_text (text.str, (int) text.len); diff --git a/src/pamac-manager/meson.build b/src/pamac-manager/meson.build index c625468..08eb876 100644 --- a/src/pamac-manager/meson.build +++ b/src/pamac-manager/meson.build @@ -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('RELEASE_NAME', 'pamac') 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()) cfgfile_6 = configure_file( @@ -22,9 +22,10 @@ pamac_manager_sources += ['history_dialog.vala'] pamac_manager_sources += ['manager.vala'] pamac_manager_sources += ['manager_window.vala'] 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 += ['--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 = [] if ENABLE_UPDATE_ICON pamac_manager_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] diff --git a/src/pamac-system-daemon/alpm_config.vala b/src/pamac-system-daemon/alpm_config.vala deleted file mode 120000 index 216718c..0000000 --- a/src/pamac-system-daemon/alpm_config.vala +++ /dev/null @@ -1 +0,0 @@ -../alpm_config.vala \ No newline at end of file diff --git a/src/pamac-system-daemon/meson.build b/src/pamac-system-daemon/meson.build index 72da8ae..d611cd4 100644 --- a/src/pamac-system-daemon/meson.build +++ b/src/pamac-system-daemon/meson.build @@ -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('RELEASE_NAME', 'pamac') 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()) 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 += [gobject_2_0_dep] 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_vala_args = ['--pkg','posix'] 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 = [] if ENABLE_UPDATE_ICON pamac_system_daemon_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] diff --git a/src/pamac-system-daemon/mirrors_config.vala b/src/pamac-system-daemon/mirrors_config.vala deleted file mode 120000 index 339c997..0000000 --- a/src/pamac-system-daemon/mirrors_config.vala +++ /dev/null @@ -1 +0,0 @@ -../mirrors_config.vala \ No newline at end of file diff --git a/src/pamac-system-daemon/pamac_config.vala b/src/pamac-system-daemon/pamac_config.vala deleted file mode 120000 index 95475bb..0000000 --- a/src/pamac-system-daemon/pamac_config.vala +++ /dev/null @@ -1 +0,0 @@ -../pamac_config.vala \ No newline at end of file diff --git a/src/pamac-system-daemon/system_daemon.vala b/src/pamac-system-daemon/system_daemon.vala index 8bc6f83..72fa466 100644 --- a/src/pamac-system-daemon/system_daemon.vala +++ b/src/pamac-system-daemon/system_daemon.vala @@ -1,7 +1,7 @@ /* * pamac-vala * - * Copyright (C) 2017 Chris Cromer + * Copyright (C) 2017-2019 Chris Cromer * Copyright (C) 2014-2017 Guillaume Benoit * * This program is free software; you can redistribute it and/or modify @@ -18,9 +18,6 @@ * along with this program. If not, see . */ -// i18n -const string GETTEXT_PACKAGE = "pamac"; - Pamac.SystemDaemon system_daemon; MainLoop loop; @@ -140,7 +137,7 @@ namespace Pamac { refreshed = false; } - public void set_environment_variables (HashTable variables) { + public void set_environment_variables (HashTable variables) throws DBusError, IOError { string[] keys = { "HTTP_USER_AGENT", "http_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; } @@ -277,7 +274,7 @@ namespace Pamac { return true; } - public string[] get_mirrors_countries () { + public string[] get_mirrors_countries () throws DBusError, IOError { string[] countries = {}; try { string countries_str; @@ -297,7 +294,7 @@ namespace Pamac { return countries; } - public bool get_lock (GLib.BusName sender) { + public bool get_lock (GLib.BusName sender) throws DBusError, IOError { if (lock_id == sender) { return true; } else if (lock_id == "") { @@ -307,7 +304,7 @@ namespace Pamac { return false; } - public bool unlock (GLib.BusName sender) { + public bool unlock (GLib.BusName sender) throws DBusError, IOError { if (lock_id == sender) { lock_id = new BusName (""); return true; @@ -354,14 +351,14 @@ namespace Pamac { 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) => { bool authorized = check_authorization.end (res); 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 (); pamac_config.reload (); #if DISABLE_AUR @@ -379,7 +376,7 @@ namespace Pamac { write_alpm_config_finished ((alpm_handle.checkspace == 1)); } - public void start_write_alpm_config (HashTable new_alpm_conf_, GLib.BusName sender) { + public void start_write_alpm_config (HashTable new_alpm_conf_, GLib.BusName sender) throws DBusError, IOError { check_authorization.begin (sender, (obj, res) => { bool authorized = check_authorization.end (res); if (authorized ) { @@ -413,7 +410,7 @@ namespace Pamac { 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) => { bool authorized = check_authorization.end (res); 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) => { bool authorized = check_authorization.end (res); if (authorized) { @@ -446,7 +443,7 @@ namespace Pamac { }); } - public void start_write_mirrors_config (HashTable new_mirrors_conf, GLib.BusName sender) { + public void start_write_mirrors_config (HashTable new_mirrors_conf, GLib.BusName sender) throws DBusError, IOError { check_authorization.begin (sender, (obj, res) => { var mirrors_config = new MirrorsConfig ("/etc/pacman-mirrors.conf"); 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) => { bool authorized = check_authorization.end (res); 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) { refresh_finished (false); return; @@ -644,7 +641,7 @@ namespace Pamac { private async void check_aur_dep_list (string[] pkgnames) { string[] dep_types = {"Depends", "MakeDepends", "CheckDepends"}; string[] dep_to_check = {}; - Json.Array results = yield AUR.multiinfo (pkgnames); + Json.Array results = yield multiinfo (pkgnames); results.foreach_element ((array, index, node) => { unowned Json.Object? pkg_info = node.get_object (); // create fake db desc file @@ -722,12 +719,12 @@ namespace Pamac { try { dos.put_string ("%s\n".printf (_node.get_string ())); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } }); dos.put_string ("\n"); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } // provides @@ -739,12 +736,12 @@ namespace Pamac { try { dos.put_string ("%s\n".printf (_node.get_string ())); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } }); dos.put_string ("\n"); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } // replaces @@ -756,17 +753,17 @@ namespace Pamac { try { dos.put_string ("%s\n".printf (_node.get_string ())); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } }); dos.put_string ("\n"); } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); + stderr.printf("%s\n", e.message); } } } } 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); } else { +#if DISABLE_AUR +#else string[] local_pkgs = {}; +#endif unowned Alpm.List pkgcache = alpm_handle.localdb.pkgcache; while (pkgcache != null) { unowned Alpm.Package installed_pkg = pkgcache.data; @@ -842,8 +842,8 @@ namespace Pamac { if (check_aur_updates) { // get aur updates if (!aur_updates_checked) { - AUR.multiinfo.begin (local_pkgs, (obj, res) => { - aur_updates_results = AUR.multiinfo.end (res); + multiinfo.begin (local_pkgs, (obj, res) => { + aur_updates_results = multiinfo.end (res); aur_updates_checked = true; var updates = Updates () { is_syncfirst = false, @@ -899,9 +899,9 @@ namespace Pamac { #endif #if DISABLE_AUR - public void start_get_updates () { + public void start_get_updates () throws DBusError, IOError { #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_; #endif try { @@ -938,7 +938,13 @@ namespace Pamac { if (errno != 0) { current_error.details = { Alpm.strerror (errno) }; } - trans_release (lock_id); + try { + 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; } else { success = trans_prepare_real (); @@ -947,7 +953,7 @@ namespace Pamac { 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) { trans_prepare_finished (false); return; @@ -1162,7 +1168,13 @@ namespace Pamac { break; } current_error.details = (owned) details; - trans_release (lock_id); + try { + 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; } else { // Search for holdpkg in target list @@ -1180,7 +1192,13 @@ namespace Pamac { if (found_locked_pkg) { current_error.message = _("Failed to prepare transaction"); current_error.details = (owned) details; - trans_release (lock_id); + try { + 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; } } @@ -1215,7 +1233,13 @@ namespace Pamac { if (success) { success = trans_prepare_real (); } else { - trans_release (lock_id); + try { + 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); @@ -1378,7 +1402,13 @@ namespace Pamac { } pkgs_to_remove.next (); } - trans_release (lock_id); + try { + 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 { Process.spawn_command_line_sync ("rm -f %ssync/aur.db".printf (alpm_handle.dbpath)); } catch (SpawnError e) { @@ -1391,7 +1421,13 @@ namespace Pamac { trans_prepare (); } } else { - trans_release (lock_id); + try { + 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) { @@ -1408,14 +1444,14 @@ namespace Pamac { string[] to_install_, string[] to_remove_, string[] to_load_, - GLib.BusName sender) { + GLib.BusName sender) throws DBusError, IOError { #else public void start_trans_prepare (Alpm.TransFlag flags_, string[] to_install_, string[] to_remove_, string[] to_load_, string[] to_build_, - GLib.BusName sender) { + GLib.BusName sender) throws DBusError, IOError { #endif if (lock_id != sender) { trans_prepare_finished (false); @@ -1451,14 +1487,14 @@ namespace Pamac { #endif } - public void choose_provider (int provider) { + public void choose_provider (int provider) throws DBusError, IOError { provider_mutex.lock (); choosen_provider = provider; provider_cond.signal (); provider_mutex.unlock (); } - public TransactionSummary get_transaction_summary () { + public TransactionSummary get_transaction_summary () throws DBusError, IOError { UpdateInfos[] to_install = {}; UpdateInfos[] to_upgrade = {}; UpdateInfos[] to_downgrade = {}; @@ -1502,9 +1538,9 @@ namespace Pamac { to_remove += (owned) infos; pkgs_to_remove.next (); } - UpdateInfos[] conflicts_to_remove = {}; #if DISABLE_AUR #else + UpdateInfos[] conflicts_to_remove = {}; foreach (unowned UpdateInfos infos in aur_conflicts_to_remove){ conflicts_to_remove += infos; } @@ -1540,7 +1576,13 @@ namespace Pamac { current_error.errno = (uint) errno; // cancel the download return an EXTERNAL_DOWNLOAD error if (errno == Alpm.Errno.EXTERNAL_DOWNLOAD && cancellable.is_cancelled ()) { - trans_release (lock_id); + try { + 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); return; } @@ -1595,7 +1637,13 @@ namespace Pamac { } success = false; } - trans_release (lock_id); + try { + 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) => { unowned Alpm.Package? pkg = alpm_handle.localdb.get_pkg (pkgname); if (pkg != null) { @@ -1607,7 +1655,7 @@ namespace Pamac { 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) => { bool authorized = check_authorization.end (res); if (authorized) { @@ -1617,13 +1665,19 @@ namespace Pamac { stderr.printf ("Thread Error %s\n", e.message); } } else { - trans_release (lock_id); + try { + 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); } }); } - public void trans_release (GLib.BusName sender) { + public void trans_release (GLib.BusName sender) throws DBusError, IOError { if (lock_id != sender) { return; } @@ -1631,7 +1685,7 @@ namespace Pamac { remove_ignorepkgs (); } - public void trans_cancel (GLib.BusName sender) { + public void trans_cancel (GLib.BusName sender) throws DBusError, IOError { if (lock_id != sender) { return; } @@ -1644,7 +1698,7 @@ namespace Pamac { } [DBus (no_reply = true)] - public void quit () { + public void quit () throws DBusError, IOError { // wait for all tasks to be processed ThreadPool.free ((owned) thread_pool, false, true); loop.quit (); @@ -2066,8 +2120,10 @@ void on_bus_acquired (DBusConnection conn) { void main () { // i18n + Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale")); 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, "org.pamac.system", diff --git a/src/pamac-tray/alpm_config.vala b/src/pamac-tray/alpm_config.vala deleted file mode 120000 index 216718c..0000000 --- a/src/pamac-tray/alpm_config.vala +++ /dev/null @@ -1 +0,0 @@ -../alpm_config.vala \ No newline at end of file diff --git a/src/pamac-tray/meson.build b/src/pamac-tray/meson.build index 3c0e576..4582b10 100644 --- a/src/pamac-tray/meson.build +++ b/src/pamac-tray/meson.build @@ -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('RELEASE_NAME', 'pamac') 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()) cfgfile_3 = configure_file( @@ -29,12 +29,10 @@ pamac_tray_sources += ['tray-appindicator.vala'] else pamac_tray_sources += ['tray-gtk.vala'] endif -pamac_tray_sources += ['alpm_config.vala'] -pamac_tray_sources += ['pamac_config.vala'] pamac_tray_sources += ['tray.vala'] pamac_tray_vala_args = ['--pkg','posix'] 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 = [] if ENABLE_UPDATE_ICON pamac_tray_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] diff --git a/src/pamac-tray/pamac_config.vala b/src/pamac-tray/pamac_config.vala deleted file mode 120000 index 95475bb..0000000 --- a/src/pamac-tray/pamac_config.vala +++ /dev/null @@ -1 +0,0 @@ -../pamac_config.vala \ No newline at end of file diff --git a/src/pamac-tray/tray-gtk.vala b/src/pamac-tray/tray-gtk.vala index 49f208f..98e1ddc 100644 --- a/src/pamac-tray/tray-gtk.vala +++ b/src/pamac-tray/tray-gtk.vala @@ -32,7 +32,7 @@ namespace Pamac { // Show popup menu on right button 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) { diff --git a/src/pamac-tray/tray.vala b/src/pamac-tray/tray.vala index 7c31514..b2ac305 100644 --- a/src/pamac-tray/tray.vala +++ b/src/pamac-tray/tray.vala @@ -18,9 +18,6 @@ * along with this program. If not, see . */ -// i18n -const string GETTEXT_PACKAGE = "pamac"; - const string update_icon_name = "pamac-tray-update"; const string noupdate_icon_name = "pamac-tray-no-update"; 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 { [DBus (name = "org.pamac.user")] interface UserDaemon : Object { - public abstract void refresh_handle () throws IOError; - public abstract string get_lockfile () throws IOError; + public abstract void refresh_handle () throws DBusError, IOError; + public abstract string get_lockfile () throws DBusError, IOError; #if DISABLE_AUR - public abstract void start_get_updates () throws IOError; + public abstract void start_get_updates () throws DBusError, IOError; #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 [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); } @@ -71,6 +68,8 @@ namespace Pamac { daemon.quit (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } } } @@ -132,6 +131,8 @@ namespace Pamac { #endif } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } } return true; @@ -233,6 +234,8 @@ namespace Pamac { daemon.refresh_handle (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } check_updates (); } @@ -274,8 +277,10 @@ namespace Pamac { public override void startup () { // i18n - Intl.textdomain ("pamac"); + Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale")); Intl.setlocale (LocaleCategory.ALL, ""); + Intl.textdomain(Constants.GETTEXT_PACKAGE); + Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" ); var pamac_config = new Pamac.Config (); // if refresh period is 0, just return so tray will exit @@ -303,6 +308,10 @@ namespace Pamac { stderr.printf ("IOError: %s\n", e.message); //try standard lock file 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); // wait 30 seconds before check updates diff --git a/src/pamac-user-daemon/alpm_config.vala b/src/pamac-user-daemon/alpm_config.vala deleted file mode 120000 index 216718c..0000000 --- a/src/pamac-user-daemon/alpm_config.vala +++ /dev/null @@ -1 +0,0 @@ -../alpm_config.vala \ No newline at end of file diff --git a/src/pamac-user-daemon/meson.build b/src/pamac-user-daemon/meson.build index 48e2201..7f01a53 100644 --- a/src/pamac-user-daemon/meson.build +++ b/src/pamac-user-daemon/meson.build @@ -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('RELEASE_NAME', 'pamac') 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()) 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 += [gobject_2_0_dep] 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_vala_args = ['--pkg','posix'] 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 = [] if ENABLE_UPDATE_ICON pamac_user_daemon_vala_args += ['-D', 'ENABLE_UPDATE_ICON'] diff --git a/src/pamac-user-daemon/pamac_config.vala b/src/pamac-user-daemon/pamac_config.vala deleted file mode 120000 index 95475bb..0000000 --- a/src/pamac-user-daemon/pamac_config.vala +++ /dev/null @@ -1 +0,0 @@ -../pamac_config.vala \ No newline at end of file diff --git a/src/pamac-user-daemon/user_daemon.vala b/src/pamac-user-daemon/user_daemon.vala index c91b01f..70cef58 100644 --- a/src/pamac-user-daemon/user_daemon.vala +++ b/src/pamac-user-daemon/user_daemon.vala @@ -34,10 +34,10 @@ namespace Pamac { #else private bool check_aur_updates; private bool aur_updates_checked; -#endif private Json.Array aur_updates_results; private HashTable aur_search_results; private HashTable aur_infos; +#endif public signal void get_updates_finished (Updates updates); @@ -49,10 +49,16 @@ namespace Pamac { aur_search_results = new HashTable (str_hash, str_equal); aur_infos = new HashTable (str_hash, str_equal); #endif - refresh_handle (); + try { + 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_handle = alpm_config.get_handle (); 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; } - public string get_lockfile () { + public string get_lockfile () throws DBusError, IOError { return alpm_handle.lockfile; } - public string[] get_ignorepkgs () { + public string[] get_ignorepkgs () throws DBusError, IOError { string[] result = {}; unowned Alpm.List ignorepkgs = alpm_handle.ignorepkgs; while (ignorepkgs != null) { @@ -86,14 +92,14 @@ namespace Pamac { 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) { return true; } 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); if (pkg != null) { return pkg.reason; @@ -101,7 +107,7 @@ namespace Pamac { 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); if (pkg != null) { 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 = {}; unowned Alpm.List pkgcache = alpm_handle.localdb.pkgcache; while (pkgcache != null) { @@ -164,7 +170,7 @@ namespace Pamac { return pkgs; } - public async AlpmPackage[] get_explicitly_installed_pkgs () { + public async AlpmPackage[] get_explicitly_installed_pkgs () throws DBusError, IOError { AlpmPackage[] pkgs = {}; unowned Alpm.List pkgcache = alpm_handle.localdb.pkgcache; while (pkgcache != null) { @@ -177,7 +183,7 @@ namespace Pamac { return pkgs; } - public async AlpmPackage[] get_foreign_pkgs () { + public async AlpmPackage[] get_foreign_pkgs () throws DBusError, IOError { AlpmPackage[] pkgs = {}; unowned Alpm.List pkgcache = alpm_handle.localdb.pkgcache; while (pkgcache != null) { @@ -201,7 +207,7 @@ namespace Pamac { return pkgs; } - public async AlpmPackage[] get_orphans () { + public async AlpmPackage[] get_orphans () throws DBusError, IOError { AlpmPackage[] pkgs = {}; unowned Alpm.List pkgcache = alpm_handle.localdb.pkgcache; while (pkgcache != null) { @@ -224,11 +230,11 @@ namespace Pamac { 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)); } - 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)); } @@ -246,7 +252,7 @@ namespace Pamac { 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)); } @@ -264,7 +270,7 @@ namespace Pamac { 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)); } @@ -293,7 +299,7 @@ namespace Pamac { return result; } - public async AlpmPackage[] search_pkgs (string search_string) { + public async AlpmPackage[] search_pkgs (string search_string) throws DBusError, IOError { AlpmPackage[] result = {}; Alpm.List alpm_pkgs = search_all_dbs (search_string); unowned Alpm.List 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)) { - Json.Array pkgs = yield AUR.search (search_string.split (" ")); + Json.Array pkgs = yield search (search_string.split (" ")); aur_search_results.insert (search_string, pkgs); } AURPackage[] result = {}; @@ -340,7 +346,7 @@ namespace Pamac { return result; } - public async AURPackageDetails get_aur_details (string pkgname) { + public async AURPackageDetails get_aur_details (string pkgname) throws DBusError, IOError { string name = ""; string version = ""; string desc = ""; @@ -362,7 +368,7 @@ namespace Pamac { string[] conflicts = {}; var details = AURPackageDetails (); if (!aur_infos.contains (pkgname)) { - Json.Array results = yield AUR.multiinfo ({pkgname}); + Json.Array results = yield multiinfo ({pkgname}); if (results.get_length () > 0) { aur_infos.insert (pkgname, results.get_object_element (0)); } @@ -483,7 +489,7 @@ namespace Pamac { } #endif - public string[] get_repos_names () { + public string[] get_repos_names () throws DBusError, IOError { string[] repos_names = {}; unowned Alpm.List syncdbs = alpm_handle.syncdbs; while (syncdbs != null) { @@ -494,7 +500,7 @@ namespace Pamac { return repos_names; } - public async AlpmPackage[] get_repo_pkgs (string repo) { + public async AlpmPackage[] get_repo_pkgs (string repo) throws DBusError, IOError { AlpmPackage[] pkgs = {}; unowned Alpm.List syncdbs = alpm_handle.syncdbs; while (syncdbs != null) { @@ -518,7 +524,7 @@ namespace Pamac { return pkgs; } - public string[] get_groups_names () { + public string[] get_groups_names () throws DBusError, IOError { string[] groups_names = {}; unowned Alpm.List groupcache = alpm_handle.localdb.groupcache; while (groupcache != null) { @@ -574,7 +580,7 @@ namespace Pamac { return result; } - public async AlpmPackage[] get_group_pkgs (string groupname) { + public async AlpmPackage[] get_group_pkgs (string groupname) throws DBusError, IOError { AlpmPackage[] pkgs = {}; Alpm.List alpm_pkgs = group_pkgs (groupname); unowned Alpm.List list = alpm_pkgs; @@ -586,7 +592,7 @@ namespace Pamac { return pkgs; } - public string[] get_pkg_uninstalled_optdeps (string pkgname) { + public string[] get_pkg_uninstalled_optdeps (string pkgname) throws DBusError, IOError { string[] optdeps = {}; unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (pkgname); if (alpm_pkg == null) { @@ -605,7 +611,7 @@ namespace Pamac { return optdeps; } - public AlpmPackageDetails get_pkg_details (string pkgname) { + public AlpmPackageDetails get_pkg_details (string pkgname) throws DBusError, IOError { string name = ""; string version = ""; string desc = ""; @@ -779,7 +785,7 @@ namespace Pamac { return details; } - public string[] get_pkg_files (string pkgname) { + public string[] get_pkg_files (string pkgname) throws DBusError, IOError { string[] files = {}; unowned Alpm.Package? alpm_pkg = alpm_handle.localdb.get_pkg (pkgname); if (alpm_pkg != null) { @@ -813,7 +819,10 @@ namespace Pamac { private int get_updates () { AlpmPackage[] updates_infos = {}; +#if DISABLE_AUR +#else unowned Alpm.Package? pkg = null; +#endif unowned Alpm.Package? candidate = null; // use a tmp handle var tmp_handle = alpm_config.get_handle (false, true); @@ -843,7 +852,10 @@ namespace Pamac { syncdbs.next (); } } +#if DISABLE_AUR +#else string[] local_pkgs = {}; +#endif unowned Alpm.List pkgcache = tmp_handle.localdb.pkgcache; while (pkgcache != null) { unowned Alpm.Package installed_pkg = pkgcache.data; @@ -882,8 +894,8 @@ namespace Pamac { if (check_aur_updates) { // get aur updates if (!aur_updates_checked) { - AUR.multiinfo.begin (local_pkgs, (obj, res) => { - aur_updates_results = AUR.multiinfo.end (res); + multiinfo.begin (local_pkgs, (obj, res) => { + aur_updates_results = multiinfo.end (res); aur_updates_checked = true; var updates = Updates () { repos_updates = (owned) updates_infos, @@ -936,16 +948,16 @@ namespace Pamac { #endif #if DISABLE_AUR - public void start_get_updates () { + public void start_get_updates () throws DBusError, IOError { #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_; #endif new Thread ("get updates thread", get_updates); } [DBus (no_reply = true)] - public void quit () { + public void quit () throws DBusError, IOError { loop.quit (); } // End of Daemon Object @@ -1020,8 +1032,10 @@ void on_bus_acquired (DBusConnection conn) { void main () { // i18n + Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale")); 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, "org.pamac.user", diff --git a/src/pamac_config.vala b/src/pamac_config.vala index ac8e682..28284d0 100644 --- a/src/pamac_config.vala +++ b/src/pamac_config.vala @@ -19,7 +19,7 @@ */ namespace Pamac { - class Config { + public class Config { HashTable _environment_variables; public bool recurse { get; private set; } diff --git a/src/pamacclassic.pc b/src/pamacclassic.pc deleted file mode 100644 index 3579a57..0000000 --- a/src/pamacclassic.pc +++ /dev/null @@ -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 diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index 87e6bb6..487df6d 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -1,7 +1,7 @@ /* * pamac-vala * - * Copyright (C) 2017 Chris Cromer + * Copyright (C) 2017-2019 Chris Cromer * Copyright (C) 2015-2017 Guillaume Benoit * * 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; // Set up terminal - terminal_background.set_use_alpha (false); - terminal_foreground.set_use_alpha (false); + terminal_background.use_alpha = false; + terminal_foreground.use_alpha = false; Gdk.RGBA rgba = Gdk.RGBA (); bool tmp = rgba.parse (transaction.terminal_background); terminal_background.rgba = rgba; @@ -274,10 +274,10 @@ namespace Pamac { void on_select_font () { 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(); 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 diff --git a/src/transaction.vala b/src/transaction.vala index 6783e8e..a0ee8da 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -1,7 +1,7 @@ /* * pamac-vala * - * Copyright (C) 2017 Chris Cromer + * Copyright (C) 2017-2019 Chris Cromer * Copyright (C) 2014-2017 Guillaume Benoit * * This program is free software; you can redistribute it and/or modify @@ -19,82 +19,85 @@ */ //using Math +//using Vte +//using Posix namespace Pamac { + [DBus (name = "org.pamac.user")] interface UserDaemon : Object { - public abstract void refresh_handle () throws IOError; - public abstract AlpmPackage get_installed_pkg (string pkgname) throws IOError; - public abstract bool get_checkspace () throws IOError; - public abstract string[] get_ignorepkgs () throws IOError; - public abstract bool should_hold (string pkgname) throws IOError; - public abstract uint get_pkg_reason (string pkgname) throws IOError; - public abstract uint get_pkg_origin (string pkgname) throws IOError; - public abstract async AlpmPackage[] get_installed_pkgs () throws IOError; - public abstract async AlpmPackage[] get_explicitly_installed_pkgs () throws IOError; - public abstract async AlpmPackage[] get_foreign_pkgs () throws IOError; - public abstract async AlpmPackage[] get_orphans () throws IOError; - public abstract AlpmPackage find_installed_satisfier (string depstring) throws IOError; - public abstract AlpmPackage get_sync_pkg (string pkgname) throws IOError; - public abstract AlpmPackage find_sync_satisfier (string depstring) throws IOError; - public abstract async AlpmPackage[] search_pkgs (string search_string) throws IOError; + public abstract void refresh_handle () throws DBusError, IOError; + public abstract AlpmPackage get_installed_pkg (string pkgname) throws DBusError, IOError; + public abstract bool get_checkspace () throws DBusError, IOError; + public abstract string[] get_ignorepkgs () throws DBusError, IOError; + public abstract bool should_hold (string pkgname) throws DBusError, IOError; + public abstract uint get_pkg_reason (string pkgname) throws DBusError, IOError; + public abstract uint get_pkg_origin (string pkgname) throws DBusError, IOError; + public abstract async AlpmPackage[] get_installed_pkgs () throws DBusError, IOError; + public abstract async AlpmPackage[] get_explicitly_installed_pkgs () throws DBusError, IOError; + public abstract async AlpmPackage[] get_foreign_pkgs () throws DBusError, IOError; + public abstract async AlpmPackage[] get_orphans () throws DBusError, IOError; + public abstract AlpmPackage find_installed_satisfier (string depstring) throws DBusError, IOError; + public abstract AlpmPackage get_sync_pkg (string pkgname) throws DBusError, IOError; + public abstract AlpmPackage find_sync_satisfier (string depstring) throws DBusError, IOError; + public abstract async AlpmPackage[] search_pkgs (string search_string) throws DBusError, IOError; #if DISABLE_AUR #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 - public abstract string[] get_repos_names () throws IOError; - public abstract async AlpmPackage[] get_repo_pkgs (string repo) throws IOError; - public abstract string[] get_groups_names () throws IOError; - public abstract async AlpmPackage[] get_group_pkgs (string groupname) throws IOError; - public abstract AlpmPackageDetails get_pkg_details (string pkgname) throws IOError; - public abstract string[] get_pkg_files (string pkgname) throws IOError; + public abstract string[] get_repos_names () throws DBusError, IOError; + public abstract async AlpmPackage[] get_repo_pkgs (string repo) throws DBusError, IOError; + public abstract string[] get_groups_names () throws DBusError, IOError; + public abstract async AlpmPackage[] get_group_pkgs (string groupname) throws DBusError, IOError; + public abstract AlpmPackageDetails get_pkg_details (string pkgname) throws DBusError, IOError; + public abstract string[] get_pkg_files (string pkgname) throws DBusError, IOError; #if DISABLE_AUR #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 - 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 - public abstract void start_get_updates () throws IOError; + public abstract void start_get_updates () throws DBusError, IOError; #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 [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); } [DBus (name = "org.pamac.system")] interface SystemDaemon : Object { - public abstract void set_environment_variables (HashTable variables) throws IOError; - public abstract string[] get_mirrors_countries () throws IOError; - public abstract ErrorInfos get_current_error () throws IOError; - public abstract bool get_lock () throws IOError; - public abstract bool unlock () throws IOError; - public abstract void start_get_authorization () throws IOError; - public abstract void start_save_pamac_config () throws IOError; - public abstract void start_write_alpm_config (HashTable new_alpm_conf) throws IOError; - public abstract void start_write_mirrors_config (HashTable new_mirrors_conf) throws IOError; - public abstract void start_generate_mirrors_list () throws IOError; - public abstract void clean_cache (uint64 keep_nb, bool only_uninstalled) throws IOError; - public abstract void start_set_pkgreason (string pkgname, uint reason) throws IOError; - public abstract void start_refresh (bool force) throws IOError; - public abstract void start_sysupgrade_prepare (bool enable_downgrade, string[] temporary_ignorepkgs) throws IOError; + public abstract void set_environment_variables (HashTable variables) throws DBusError, IOError; + public abstract string[] get_mirrors_countries () throws DBusError, IOError; + public abstract ErrorInfos get_current_error () throws DBusError, IOError; + public abstract bool get_lock () throws DBusError, IOError; + public abstract bool unlock () throws DBusError, IOError; + public abstract void start_get_authorization () throws DBusError, IOError; + public abstract void start_save_pamac_config () throws DBusError, IOError; + public abstract void start_write_alpm_config (HashTable new_alpm_conf) throws DBusError, IOError; + public abstract void start_write_mirrors_config (HashTable new_mirrors_conf) throws DBusError, IOError; + public abstract void start_generate_mirrors_list () throws DBusError, 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 DBusError, IOError; + public abstract void start_refresh (bool force) throws DBusError, IOError; + public abstract void start_sysupgrade_prepare (bool enable_downgrade, string[] temporary_ignorepkgs) throws DBusError, IOError; #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 - 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 - public abstract void choose_provider (int provider) throws IOError; - public abstract TransactionSummary get_transaction_summary () throws IOError; - public abstract void start_trans_commit () throws IOError; - public abstract void trans_release () throws IOError; - public abstract void trans_cancel () throws IOError; + public abstract void choose_provider (int provider) throws DBusError, IOError; + public abstract TransactionSummary get_transaction_summary () throws DBusError, IOError; + public abstract void start_trans_commit () throws DBusError, IOError; + public abstract void trans_release () throws DBusError, IOError; + public abstract void trans_cancel () throws DBusError, IOError; #if DISABLE_AUR - public abstract void start_get_updates () throws IOError; + public abstract void start_get_updates () throws DBusError, IOError; #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 [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 emit_event (uint primary_event, uint secondary_event, string[] details); public signal void emit_providers (string depend, string[] providers); @@ -344,6 +347,9 @@ namespace Pamac { } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); 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 (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return countries; } @@ -365,6 +373,8 @@ namespace Pamac { locked = system_daemon.get_lock (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return locked; } @@ -375,6 +385,8 @@ namespace Pamac { unlocked = system_daemon.unlock (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return unlocked; } @@ -390,6 +402,8 @@ namespace Pamac { system_daemon.start_get_authorization (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } yield; system_daemon.disconnect (handler_id); @@ -403,6 +417,9 @@ namespace Pamac { } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); 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) { stderr.printf ("IOError: %s\n", e.message); 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) { stderr.printf ("IOError: %s\n", e.message); 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 ();}); right_click_menu.append (copy_item); 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; } } @@ -480,8 +503,8 @@ namespace Pamac { } } catch (Error e) { // cancelled - process.send_signal (Posix.SIGINT); - process.send_signal (Posix.SIGKILL); + process.send_signal (Posix.Signal.INT); + process.send_signal (Posix.Signal.KILL); } Idle.add ((owned) callback); }); @@ -529,6 +552,11 @@ namespace Pamac { 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); + } 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); } catch (IOError e) { 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) { stderr.printf ("IOError: %s\n", e.message); 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); success = false; 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 { success = false; @@ -579,6 +617,8 @@ namespace Pamac { user_daemon.refresh_handle (); } catch (IOError e) { 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 (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return checkspace; } @@ -598,6 +640,8 @@ namespace Pamac { ignorepkgs = user_daemon.get_ignorepkgs (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return ignorepkgs; } @@ -613,6 +657,14 @@ namespace Pamac { desc = "", repo = "" }; + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); + return AlpmPackage () { + name = "", + version = "", + desc = "", + repo = "" + }; } } @@ -627,6 +679,14 @@ namespace Pamac { desc = "", 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); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return should_hold; } @@ -646,6 +708,8 @@ namespace Pamac { reason = user_daemon.get_pkg_reason (pkgname); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return reason; } @@ -656,6 +720,8 @@ namespace Pamac { origin = user_daemon.get_pkg_origin (pkgname); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return origin; } @@ -666,6 +732,8 @@ namespace Pamac { pkgs = yield user_daemon.get_installed_pkgs (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -676,6 +744,8 @@ namespace Pamac { pkgs = yield user_daemon.get_explicitly_installed_pkgs (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -686,6 +756,8 @@ namespace Pamac { pkgs = yield user_daemon.get_foreign_pkgs (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -696,6 +768,8 @@ namespace Pamac { pkgs = yield user_daemon.get_orphans (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -711,6 +785,14 @@ namespace Pamac { desc = "", repo = "" }; + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); + return AlpmPackage () { + name = "", + version = "", + desc = "", + repo = "" + }; } } @@ -725,6 +807,14 @@ namespace Pamac { desc = "", 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); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -746,6 +838,8 @@ namespace Pamac { pkgs = yield user_daemon.search_in_aur (search_string); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -757,6 +851,8 @@ namespace Pamac { repos_names = user_daemon.get_repos_names (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return repos_names; } @@ -767,6 +863,8 @@ namespace Pamac { pkgs = yield user_daemon.get_repo_pkgs (repo); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -777,6 +875,8 @@ namespace Pamac { groups_names = user_daemon.get_groups_names (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return groups_names; } @@ -787,6 +887,8 @@ namespace Pamac { pkgs = yield user_daemon.get_group_pkgs (group_name); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkgs; } @@ -797,6 +899,8 @@ namespace Pamac { optdeps = user_daemon.get_pkg_uninstalled_optdeps (pkgname); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return optdeps; } @@ -820,6 +924,22 @@ namespace Pamac { downloadsize = "", 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) { stderr.printf ("IOError: %s\n", e.message); 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); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } return pkg; } @@ -864,6 +989,10 @@ namespace Pamac { stderr.printf ("IOError: %s\n", e.message); success = false; 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); success = false; 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); success = false; 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 (); success = false; 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); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } } index++; @@ -1077,6 +1221,8 @@ namespace Pamac { summary = system_daemon.get_transaction_summary (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } var iter = Gtk.TreeIter (); if (summary.to_remove.length > 0) { @@ -1206,6 +1352,10 @@ namespace Pamac { stderr.printf ("IOError: %s\n", e.message); success = false; 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 (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } #if DISABLE_AUR #else @@ -1312,6 +1464,8 @@ namespace Pamac { system_daemon.trans_release (); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } warning_textbuffer = new StringBuilder (); } @@ -1324,6 +1478,8 @@ namespace Pamac { } } catch (IOError e) { 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); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); } } diff --git a/src/vapis/libalpm.vapi b/src/vapis/libalpm.vapi index a272fa9..422c2b5 100644 --- a/src/vapis/libalpm.vapi +++ b/src/vapis/libalpm.vapi @@ -38,9 +38,9 @@ namespace Alpm { } public int capabilities(); - public unowned Package? find_satisfier(Alpm.List pkgs, string depstring); + public unowned Package? find_satisfier(Alpm.List pkgs, string depstring); - public unowned Package? pkg_find(Alpm.List haystack, string needle); + public unowned Package? pkg_find(Alpm.List haystack, string needle); 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. * IgnorePkg is also handled. */ - public Alpm.List find_group_pkgs(Alpm.List dbs, string name); + public Alpm.List find_group_pkgs(Alpm.List dbs, string name); /** Returns the string corresponding to an error number. */ public unowned string strerror(Errno err); @@ -193,7 +193,7 @@ namespace Alpm { public unowned DB localdb { [CCode (cname = "alpm_get_localdb")] get; } - public unowned Alpm.List syncdbs { + public unowned Alpm.List syncdbs { [CCode (cname = "alpm_get_syncdbs")] get; } @@ -252,7 +252,7 @@ namespace Alpm { public string? fetch_pkgurl(string url); [CCode (cname = "alpm_find_dbs_satisfier")] - public unowned Package? find_dbs_satisfier(Alpm.List dbs, string depstring); + public unowned Package? find_dbs_satisfier(Alpm.List dbs, string depstring); /** Returns the current error code from the handle. */ [CCode (cname = "alpm_errno")] @@ -380,7 +380,7 @@ namespace Alpm { public unowned Package? get_pkg(string name); public unowned Group? get_group(string name); - public Alpm.List search(Alpm.List needles); + public Alpm.List search(Alpm.List needles); public int check_pgp_signature(out SigList siglist); } @@ -550,7 +550,7 @@ namespace Alpm { public Alpm.List compute_optionalfor(); [CCode (cname = "alpm_sync_newversion")] - public unowned Package? sync_newversion(Alpm.List dbs); + public unowned Package? sync_newversion(Alpm.List dbs); public int check_pgp_signature(out SigList siglist); }