From 0dc000f8f4b4858720f7772de7fa28a0fd852f42 Mon Sep 17 00:00:00 2001 From: guinux Date: Sat, 3 Jan 2015 17:26:47 +0100 Subject: [PATCH] fix #15 --- src/alpm_config.vala | 16 ++++++++-------- src/transaction.vala | 1 + util/alpm-util.c | 7 +++++++ util/alpm-util.h | 1 + vapi/libalpm.vapi | 3 +++ 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/alpm_config.vala b/src/alpm_config.vala index fca9632..4808823 100644 --- a/src/alpm_config.vala +++ b/src/alpm_config.vala @@ -43,7 +43,7 @@ namespace Alpm { int usesyslog; public int checkspace; Alpm.List cachedirs; - Alpm.List ignoregrps; + Alpm.List ignoregroups; public string ignorepkg; Alpm.List ignorepkgs; Alpm.List noextracts; @@ -75,7 +75,7 @@ namespace Alpm { syncfirst = ""; cachedirs = new Alpm.List (); cachedirs.add ("/var/cache/pacman/pkg/"); - ignoregrps = new Alpm.List (); + ignoregroups = new Alpm.List (); ignorepkgs = new Alpm.List (); ignorepkg = ""; noextracts = new Alpm.List (); @@ -114,7 +114,7 @@ namespace Alpm { handle.localfilesiglevel = localfilesiglevel; handle.remotefilesiglevel = remotefilesiglevel; handle.cachedirs = cachedirs; - handle.ignoregroups = ignoregrps; + handle.ignoregroups = ignoregroups; handle.ignorepkgs = ignorepkgs; handle.noextracts = noextracts; handle.noupgrades = noupgrades; @@ -194,20 +194,20 @@ namespace Alpm { syncfirsts.append (name); } else if (_key == "CacheDir") { foreach (string dir in _value.split (" ")) - cachedirs.add (dir); + cachedirs.add_str (dir); } else if (_key == "IgnoreGroup") { foreach (string name in _value.split (" ")) - ignoregrps.add (name); + ignoregroups.add_str (name); } else if (_key == "IgnorePkg") { ignorepkg = _value; foreach (string name in _value.split (" ")) - ignorepkgs.add (name); + ignorepkgs.add_str (name); } else if (_key == "Noextract") { foreach (string name in _value.split (" ")) - noextracts.add (name); + noextracts.add_str (name); } else if (_key == "NoUpgrade") { foreach (string name in _value.split (" ")) - noupgrades.add (name); + noupgrades.add_str (name); } } else { foreach (var repo in repo_order) { diff --git a/src/transaction.vala b/src/transaction.vala index aa48874..0080400 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -673,6 +673,7 @@ namespace Pamac { if (pamac_changes) { write_pamac_config (new_pamac_conf); pamac_config.reload (); + check_aur = pamac_config.enable_aur; } bool alpm_changes = (new_alpm_conf.size () != 0); if (alpm_changes) { diff --git a/util/alpm-util.c b/util/alpm-util.c index 0e00b69..69dc726 100644 --- a/util/alpm-util.c +++ b/util/alpm-util.c @@ -1,3 +1,4 @@ +#include #include "alpm-util.h" alpm_pkg_t* alpm_pkg_load_file (alpm_handle_t *handle, const char *filename, int full, alpm_siglevel_t level) { @@ -29,6 +30,12 @@ void* alpm_list_nth_data (alpm_list_t *list, size_t n) { return alpm_list_nth (list, n)->data; } +alpm_list_t* alpm_list_add_str (alpm_list_t *list, const char *str) { + char *dup = strdup (str); + list = alpm_list_add (list, dup); + return list; +} + alpm_list_t* alpm_list_remove_data (alpm_list_t *list, const void *needle, alpm_list_fn_cmp fn) { void *data = NULL; list = alpm_list_remove (list, needle, fn, data); diff --git a/util/alpm-util.h b/util/alpm-util.h index 4bc3cff..b61169e 100644 --- a/util/alpm-util.h +++ b/util/alpm-util.h @@ -9,6 +9,7 @@ typedef struct __alpm_list_iterator_t { void* alpm_list_get_data (alpm_list_t *list); void* alpm_list_nth_data (alpm_list_t *list, size_t n); +alpm_list_t* alpm_list_add_str (alpm_list_t *list, const char *str); alpm_list_t *alpm_list_remove_data (alpm_list_t *list, const void *needle, alpm_list_fn_cmp fn); alpm_list_t *alpm_list_sort_data (alpm_list_t *list, alpm_list_fn_cmp fn); alpm_list_t *alpm_list_new (); diff --git a/vapi/libalpm.vapi b/vapi/libalpm.vapi index 02dbaf7..dd8ca41 100644 --- a/vapi/libalpm.vapi +++ b/vapi/libalpm.vapi @@ -1319,6 +1319,9 @@ namespace Alpm { [ReturnsModifiedPointer ()] public unowned void add(G data); + [ReturnsModifiedPointer ()] + public unowned void add_str(string str); + [ReturnsModifiedPointer ()] public unowned void join(List list);