add build dir

This commit is contained in:
2017-10-04 20:52:47 -03:00
parent 4379723efe
commit 8a1f88d8f9
7 changed files with 103 additions and 10 deletions

View File

@@ -27,6 +27,7 @@ namespace Pamac {
public bool no_update_hide_icon { get; private set; }
public bool enable_aur { get; private set; }
public bool search_aur { get; private set; }
public string aur_build_dir { get; private set; }
public bool check_aur_updates { get; private set; }
public unowned HashTable<string,string> environment_variables {
get {
@@ -71,6 +72,7 @@ namespace Pamac {
no_update_hide_icon = false;
enable_aur = false;
search_aur = false;
aur_build_dir = "/tmp";
check_aur_updates = false;
parse_file (conf_path);
}
@@ -109,6 +111,10 @@ namespace Pamac {
enable_aur = true;
} else if (key == "SearchInAURByDefault") {
search_aur = true;
} else if (key == "BuildDirectory") {
if (splitted.length == 2) {
aur_build_dir = splitted[1]._strip ();
}
} else if (key == "CheckAURUpdates") {
check_aur_updates = true;
}
@@ -188,6 +194,13 @@ namespace Pamac {
} else {
data.append (line + "\n");
}
} else if (line.contains ("BuildDirectory")) {
if (new_conf.lookup_extended ("BuildDirectory", null, out variant)) {
data.append ("BuildDirectory = %s\n".printf (variant.get_string ()));
new_conf.remove ("BuildDirectory");
} else {
data.append (line + "\n");
}
} else if (line.contains ("CheckAURUpdates")) {
if (new_conf.lookup_extended ("CheckAURUpdates", null, out variant)) {
if (variant.get_boolean ()) {
@@ -244,6 +257,8 @@ namespace Pamac {
} else {
data.append ("#SearchInAURByDefault\n");
}
} else if (key == "BuildDirectory") {
data.append ("BuildDirectory = %s\n".printf (val.get_string ()));
} else if (key == "CheckAURUpdates") {
if (val.get_boolean ()) {
data.append ("CheckAURUpdates\n");