Commit f7daca32 authored by guinux's avatar guinux

Merge branch 'development'

parents 5291ba16 f4f2f3f3
......@@ -1160,8 +1160,11 @@ namespace Pamac {
max_length = prop.length;
}
}
foreach (string pkgname in pkgnames) {
var details = yield database.get_aur_pkg_details (pkgname);
var aur_pkgs = yield database.get_aur_pkgs_details (pkgnames);
var iter = HashTableIter<string, AURPackageDetails> (aur_pkgs);
unowned string pkgname;
unowned AURPackageDetails details;
while (iter.next (out pkgname, out details)) {
if (details.name == "") {
print_error (dgettext (null, "target not found: %s").printf (pkgname) + "\n");
return;
......@@ -1748,11 +1751,15 @@ namespace Pamac {
}
async void clone_build_files_real (string[] pkgnames, bool overwrite, bool recurse) {
foreach (unowned string pkgname in pkgnames) {
var aur_pkg_details = yield database.get_aur_pkg_details (pkgname);
string[] dep_to_check = {};
var aur_pkgs = yield database.get_aur_pkgs_details (pkgnames);
var iter = HashTableIter<string, AURPackageDetails> (aur_pkgs);
unowned string pkgname;
unowned AURPackageDetails aur_pkg_details;
while (iter.next (out pkgname, out aur_pkg_details)) {
if (aur_pkg_details.name == "") {
print_error (dgettext (null, "target not found: %s").printf (pkgname) + "\n");
return;
continue;
} else {
// clone build files
stdout.printf (dgettext (null, "Cloning %s build files".printf (pkgname)) + "...\n");
......@@ -1762,7 +1769,6 @@ namespace Pamac {
// error
return;
} else if (recurse) {
string[] dep_to_check = {};
var depends = new List<string> ();
foreach (unowned string depend in aur_pkg_details.depends) {
depends.append (depend);
......@@ -1783,34 +1789,30 @@ namespace Pamac {
string dep_name = database.get_alpm_dep_name (dep_string);
if (!(dep_name in already_checked_aur_dep)) {
already_checked_aur_dep.add (dep_name);
var aur_pkg = yield database.get_aur_pkg (dep_name);
if (aur_pkg.name != "") {
dep_to_check += (owned) dep_name;
}
dep_to_check += (owned) dep_name;
}
}
}
if (dep_to_check.length > 0) {
yield clone_build_files_real (dep_to_check, overwrite, recurse);
}
}
}
}
if (dep_to_check.length > 0) {
yield clone_build_files_real (dep_to_check, overwrite, recurse);
}
}
async bool check_build_pkgs () {
bool success = true;
foreach (unowned string pkgname in to_build) {
var aur_pkg = yield database.get_aur_pkg (pkgname);
var aur_pkgs = yield database.get_aur_pkgs (to_build);
var iter = HashTableIter<string, AURPackage> (aur_pkgs);
unowned string pkgname;
unowned AURPackage aur_pkg;
while (iter.next (out pkgname, out aur_pkg)) {
if (aur_pkg.name == "") {
print_error (dgettext (null, "target not found: %s").printf (pkgname) + "\n");
success = false;
}
if (!success) {
break;
return false;
}
}
return success;
return true;
}
void build_pkgs (string[] to_build) {
......
This diff is collapsed.
......@@ -1964,8 +1964,12 @@ namespace Pamac {
async void populate_pendings_aur_pkgs () {
var aur_pkgs = new List<AURPackage> ();
foreach (unowned string pkgname in to_build) {
var aur_pkg = yield database.get_aur_pkg (pkgname);
string[] to_build_array = {};
foreach (unowned string name in to_build) {
to_build_array += name;
}
var table = yield database.get_aur_pkgs (to_build_array);
foreach (unowned AURPackage aur_pkg in table.get_values ()) {
if (aur_pkg.name != "") {
aur_pkgs.append (aur_pkg);
}
......
......@@ -136,9 +136,15 @@ namespace Pamac {
}
int width = get_term_width () - action.char_count () - 1;
string current_status = "[%s]".printf (status);
current_line = "%s %*s".printf (action, width, current_status);
stdout.printf (current_line);
stdout.printf ("\r");
if (width > current_status.length) {
current_line = "%s %*s".printf (action, width, current_status);
stdout.printf (current_line);
stdout.printf ("\r");
} else {
current_line = "%s %s".printf (action, current_status);
stdout.printf (current_line);
stdout.printf ("\n");
}
}
stdout.flush ();
}
......
......@@ -267,7 +267,6 @@ namespace Pamac {
&& summary.to_upgrade.length () > 0) {
return true;
}
summary_shown = true;
int response = show_summary (summary);
if (response == Gtk.ResponseType.OK) {
// Commit
......@@ -690,7 +689,6 @@ namespace Pamac {
} else {
warning_textbuffer = new StringBuilder ();
}
summary_shown = false;
transaction_summary.remove_all ();
reset_progress_box ();
show_in_term ("");
......
......@@ -371,13 +371,17 @@ namespace Pamac {
async bool check_aur_dep_list (string[] pkgnames) {
string[] dep_to_check = {};
var aur_pkgs = new HashTable<string, AURPackage> (str_hash, str_equal);
if (clone_build_files) {
aur_pkgs = yield database.get_aur_pkgs (pkgnames);
}
foreach (unowned string pkgname in pkgnames) {
if (build_cancellable.is_cancelled ()) {
return false;
}
File? clone_dir;
if (clone_build_files) {
var aur_pkg = yield database.get_aur_pkg (pkgname);
unowned AURPackage aur_pkg = aur_pkgs.lookup (pkgname);
if (aur_pkg.name == "") {
emit_error (dgettext (null, "target not found: %s").printf (pkgname), {});
return false;
......@@ -398,6 +402,9 @@ namespace Pamac {
}
yield regenerate_srcinfo (pkgname);
}
if (build_cancellable.is_cancelled ()) {
return false;
}
emit_action (dgettext (null, "Checking %s dependencies".printf (pkgname)) + "...");
var srcinfo = clone_dir.get_child (".SRCINFO");
try {
......@@ -555,10 +562,7 @@ namespace Pamac {
string dep_name = database.get_alpm_dep_name (dep_string);
if (!(dep_name in already_checked_aur_dep)) {
already_checked_aur_dep.add (dep_name);
var aur_pkg = yield database.get_aur_pkg (dep_name);
if (aur_pkg.name != "") {
dep_to_check += (owned) dep_name;
}
dep_to_check += (owned) dep_name;
}
}
}
......@@ -1209,6 +1213,8 @@ namespace Pamac {
finish_transaction (true);
//handle_error (err);
}
} else if (build_cancellable.is_cancelled ()) {
finish_transaction (false);
} else if (to_build.length > 0) {
check_aur_unresolvables_and_edit_build_files.begin ();
} else {
......@@ -1278,7 +1284,6 @@ namespace Pamac {
void on_trans_commit_finished (bool success) {
if (success) {
if (to_build_queue.get_length () != 0) {
emit_script_output ("");
get_authorization_finished.connect (launch_build_next_aur_package);
start_get_authorization ();
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment