forked from cromer/pamac-classic
update .files db in background
This commit is contained in:
parent
4773afb494
commit
960e1b0259
@ -168,12 +168,7 @@ namespace Pamac {
|
|||||||
alpm_handle.logcb = (Alpm.LogCallBack) cb_log;
|
alpm_handle.logcb = (Alpm.LogCallBack) cb_log;
|
||||||
lockfile = GLib.File.new_for_path (alpm_handle.lockfile);
|
lockfile = GLib.File.new_for_path (alpm_handle.lockfile);
|
||||||
files_handle = alpm_config.get_handle (true);
|
files_handle = alpm_config.get_handle (true);
|
||||||
files_handle.eventcb = (Alpm.EventCallBack) cb_event;
|
|
||||||
files_handle.progresscb = (Alpm.ProgressCallBack) cb_progress;
|
|
||||||
files_handle.questioncb = (Alpm.QuestionCallBack) cb_question;
|
|
||||||
files_handle.fetchcb = (Alpm.FetchCallBack) cb_fetch;
|
files_handle.fetchcb = (Alpm.FetchCallBack) cb_fetch;
|
||||||
files_handle.totaldlcb = (Alpm.TotalDownloadCallBack) cb_totaldownload;
|
|
||||||
files_handle.logcb = (Alpm.LogCallBack) cb_log;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,6 +448,8 @@ namespace Pamac {
|
|||||||
}
|
}
|
||||||
unowned Alpm.DB db = syncdbs.data;
|
unowned Alpm.DB db = syncdbs.data;
|
||||||
if (db.update (force) >= 0) {
|
if (db.update (force) >= 0) {
|
||||||
|
// We should always succeed if at least one DB was upgraded - we may possibly
|
||||||
|
// fail later with unresolved deps, but that should be rare, and would be expected
|
||||||
success = true;
|
success = true;
|
||||||
} else {
|
} else {
|
||||||
Alpm.Errno errno = handle.errno ();
|
Alpm.Errno errno = handle.errno ();
|
||||||
@ -480,19 +477,15 @@ namespace Pamac {
|
|||||||
refresh_finished (false);
|
refresh_finished (false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update ".files", do not need to know if we succeeded
|
if (success) {
|
||||||
update_dbs (files_handle, force);
|
|
||||||
if (cancellable.is_cancelled ()) {
|
|
||||||
refresh_finished (false);
|
|
||||||
} else if (success) {
|
|
||||||
// We should always succeed if at least one DB was upgraded - we may possibly
|
|
||||||
// fail later with unresolved deps, but that should be rare, and would be expected
|
|
||||||
refreshed = true;
|
refreshed = true;
|
||||||
refresh_finished (true);
|
refresh_finished (true);
|
||||||
} else {
|
} else {
|
||||||
current_error.message = _("Failed to synchronize any databases");
|
current_error.message = _("Failed to synchronize any databases");
|
||||||
refresh_finished (false);
|
refresh_finished (false);
|
||||||
}
|
}
|
||||||
|
// update ".files", do it in background, do not need to know if we succeeded
|
||||||
|
update_dbs (files_handle, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start_refresh (bool force, GLib.BusName sender) {
|
public void start_refresh (bool force, GLib.BusName sender) {
|
||||||
|
@ -1391,8 +1391,8 @@ namespace Pamac {
|
|||||||
rates_nb = 0;
|
rates_nb = 0;
|
||||||
fraction = 0;
|
fraction = 0;
|
||||||
timer.start ();
|
timer.start ();
|
||||||
if (filename.has_suffix (".db") || filename.has_suffix (".files")) {
|
if (filename.has_suffix (".db")) {
|
||||||
string action = dgettext (null, "Refreshing %s").printf (filename) + "...";
|
string action = dgettext (null, "Refreshing %s").printf (filename.replace (".db", "")) + "...";
|
||||||
reset_progress_box (action);
|
reset_progress_box (action);
|
||||||
}
|
}
|
||||||
} else if (xfered == total) {
|
} else if (xfered == total) {
|
||||||
|
Loading…
Reference in New Issue
Block a user