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

@@ -87,7 +87,7 @@ namespace Pamac {
public signal void trans_commit_finished (bool success);
public signal void get_authorization_finished (bool authorized);
public signal void write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon,
bool enable_aur, bool search_aur, bool check_aur_updates);
bool enable_aur, bool search_aur, string aur_build_dir, bool check_aur_updates);
public signal void write_alpm_config_finished (bool checkspace);
public signal void write_mirrors_config_finished (string choosen_country, string choosen_generation_method);
public signal void generate_mirrors_list_data (string line);
@@ -119,6 +119,7 @@ namespace Pamac {
public bool recurse { get { return pamac_config.recurse; } }
public uint64 refresh_period { get { return pamac_config.refresh_period; } }
public bool search_aur { get { return pamac_config.search_aur; } }
public string aur_build_dir { get { return pamac_config.aur_build_dir; } }
//Alpm.TransFlag
int flags;
@@ -171,7 +172,7 @@ namespace Pamac {
public signal void finished (bool success);
public signal void set_pkgreason_finished ();
public signal void write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon,
bool enable_aur, bool search_aur, bool check_aur_updates);
bool enable_aur, bool search_aur, string aur_build_dir, bool check_aur_updates);
public signal void write_alpm_config_finished (bool checkspace);
public signal void write_mirrors_config_finished (string choosen_country, string choosen_generation_method);
public signal void generate_mirrors_list ();
@@ -749,7 +750,7 @@ namespace Pamac {
try {
pkg = yield user_daemon.get_aur_details (pkgname);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
stderr.printf ("IOError: %s\n", e.message);
}
return pkg;
}
@@ -1079,7 +1080,12 @@ namespace Pamac {
to_build.remove_all ();
string [] built_pkgs = {};
int status = 1;
string builddir = "/tmp/pamac-build-%s".printf (Environment.get_user_name ());
string builddir;
if (aur_build_dir == "/tmp") {
builddir = "/tmp/pamac-build-%s".printf (Environment.get_user_name ());
} else {
builddir = aur_build_dir;
}
status = yield spawn_in_term ({"mkdir", "-p", builddir});
if (status == 0) {
status = yield spawn_in_term ({"rm", "-rf", pkgname}, builddir);
@@ -1472,7 +1478,7 @@ namespace Pamac {
previous_percent = 0;
previous_textbar = "";
total_download = total;
// this is emitted at the end of the total download
// this is emitted at the end of the total download
// with the value 0 so stop our timer
if (total == 0) {
timer.stop ();
@@ -1748,7 +1754,7 @@ namespace Pamac {
}
void on_write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon,
bool enable_aur, bool search_aur, bool check_aur_updates) {
bool enable_aur, bool search_aur, string aur_build_dir, bool check_aur_updates) {
system_daemon.write_pamac_config_finished.disconnect (on_write_pamac_config_finished);
pamac_config.reload ();
flags = (1 << 4); //Alpm.TransFlag.CASCADE
@@ -1756,7 +1762,7 @@ namespace Pamac {
flags |= (1 << 5); //Alpm.TransFlag.RECURSE
}
write_pamac_config_finished (recurse, refresh_period, no_update_hide_icon,
enable_aur, search_aur, check_aur_updates);
enable_aur, search_aur, aur_build_dir, check_aur_updates);
}
void on_write_alpm_config_finished (bool checkspace) {