This commit is contained in:
guinux 2014-11-24 21:34:23 +01:00
parent da70da90da
commit 6024012729
4 changed files with 35 additions and 30 deletions

View File

@ -187,7 +187,7 @@ static void walk_reverse_deps(Package pkg, int depth) {
if((max_depth >= 0) && (depth > max_depth)) return;
walked.add(pkg.name);
unowned Alpm.List<string?> required_by = pkg.compute_requiredby ();
Alpm.List<string?> required_by = pkg.compute_requiredby ();
foreach(string? i in required_by) {
string pkgname = i;

View File

@ -121,8 +121,7 @@ namespace Pamac {
ErrorInfos err = ErrorInfos ();
string[] details = {};
int success = 0;
int ret = handle.trans_init (0);
if (ret == 0) {
int ret;
foreach (var db in handle.syncdbs) {
ret = db.update (force_refresh);
if (ret >= 0) {
@ -136,12 +135,6 @@ namespace Pamac {
details += Alpm.strerror (handle.errno ());
err.details = details;
}
trans_release ();
} else {
err.str = _("Failed to synchronize any databases");
details += Alpm.strerror (handle.errno ());
err.details = details;
}
if (emit_refreshed_signal)
emit_refreshed (err);
return success;

View File

@ -250,22 +250,17 @@ namespace Pamac {
public void set_infos_list (Pamac.Package pkg) {
name_label.set_markup ("<big><b>%s %s</b></big>".printf (pkg.name, pkg.version));
// fix &,-,>,< in desc
string desc;
if (pkg.alpm_pkg != null)
desc = pkg.alpm_pkg.desc;
desc = Markup.escape_text (pkg.alpm_pkg.desc);
else
desc = pkg.aur_json.get_string_member ("Description");
desc = desc.replace ("&", "&amp;");
desc = desc.replace ("<->", "/");
desc = Markup.escape_text (pkg.aur_json.get_string_member ("Description"));
desc_label.set_markup (desc);
// fix & in url
string url;
if (pkg.alpm_pkg != null)
url = pkg.alpm_pkg.url;
url = Markup.escape_text (pkg.alpm_pkg.url);
else
url = pkg.aur_json.get_string_member ("URL");
url = url.replace ("&", "&amp;");
url = Markup.escape_text (pkg.aur_json.get_string_member ("URL"));
link_label.set_markup ("<a href=\"%s\">%s</a>".printf (url, url));
StringBuilder licenses = new StringBuilder ();
licenses.append (dgettext (null, "Licenses"));
@ -509,6 +504,8 @@ namespace Pamac {
TreeSelection selection = search_treeview.get_selection ();
if (selection.get_selected (out model, out iter)) {
on_search_treeview_selection_changed ();
} else {
show_all_pkgs ();
}
} else if (current_page == 1) {
on_groups_treeview_selection_changed ();

View File

@ -249,8 +249,8 @@ namespace Pamac {
// run as a standard transaction
run ();
} else {
UpdatesInfos[] updates = get_repos_updates (handle, ignorepkg);
uint repos_updates_len = updates.length;
UpdatesInfos[] repos_updates = get_repos_updates (handle, ignorepkg);
int repos_updates_len = repos_updates.length;
if (check_aur) {
if (aur_checked == false) {
aur_updates = get_aur_updates (handle, ignorepkg);
@ -554,12 +554,18 @@ namespace Pamac {
}
}
public void spawn_in_term (string[] args, out int pid = null) {
public void spawn_in_term (string[] args, out Pid child_pid = null) {
Pid intern_pid;
try {
Process.spawn_async (null, args, null, SpawnFlags.DO_NOT_REAP_CHILD, pty.child_setup, out pid);
Process.spawn_async (null, args, null, SpawnFlags.DO_NOT_REAP_CHILD, pty.child_setup, out intern_pid);
ChildWatch.add (intern_pid, (pid, status) => {
// triggered when the child indicated by intern_pid exits
Process.close_pid (pid);
});
} catch (SpawnError e) {
stderr.printf ("SpawnError: %s\n", e.message);
}
child_pid = intern_pid;
term.set_pty (pty);
}
@ -906,6 +912,10 @@ namespace Pamac {
transaction_sum_dialog.hide ();
while (Gtk.events_pending ())
Gtk.main_iteration ();
if (aur_updates.length != 0)
to_build.steal_all ();
sysupgrade_after_trans = false;
sysupgrade_after_build = false;
finished (true);
}
} else if (sysupgrade_after_build) {
@ -923,6 +933,10 @@ namespace Pamac {
while (Gtk.events_pending ())
Gtk.main_iteration ();
release ();
if (aur_updates.length != 0)
to_build.steal_all ();
sysupgrade_after_trans = false;
sysupgrade_after_build = false;
finished (true);
}
} else if (mode == Mode.UPDATER) {
@ -987,6 +1001,7 @@ namespace Pamac {
already_downloaded = 0;
build_status = 0;
previous_filename = "";
aur_checked = false;
}
void on_term_child_exited (int status) {