diff --git a/src/alpm_config.vala b/src/alpm_config.vala
index 96e11db..368fa6e 100644
--- a/src/alpm_config.vala
+++ b/src/alpm_config.vala
@@ -138,11 +138,12 @@ class AlpmConfig {
Alpm.Errno error = 0;
Alpm.Handle? handle = null;
if (tmp_db) {
- string tmp_dbpath = "/tmp/pamac-checkdbs-%s".printf (Environment.get_user_name ());
+ string tmp_dbpath = "/tmp/pamac-checkdbs";
try {
Process.spawn_command_line_sync ("mkdir -p %s".printf (tmp_dbpath));
Process.spawn_command_line_sync ("ln -sf %s/local %s".printf (dbpath, tmp_dbpath));
Process.spawn_command_line_sync ("cp -au %s/sync %s".printf (dbpath, tmp_dbpath));
+ Process.spawn_command_line_sync ("chmod -R 777 %s/sync".printf (tmp_dbpath));
handle = new Alpm.Handle (rootdir, tmp_dbpath, out error);
} catch (SpawnError e) {
stderr.printf ("SpawnError: %s\n", e.message);
diff --git a/src/manager_window.vala b/src/manager_window.vala
index c4f9db7..a126b3e 100644
--- a/src/manager_window.vala
+++ b/src/manager_window.vala
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-const string VERSION = "5.0.0";
+const string VERSION = "5.1.0";
namespace Pamac {
diff --git a/src/system_daemon.vala b/src/system_daemon.vala
index 7d199f9..5beb2f0 100644
--- a/src/system_daemon.vala
+++ b/src/system_daemon.vala
@@ -141,8 +141,8 @@ namespace Pamac {
(alpm_action) => {
alpm_action.run ();
},
- // two threads at a time
- 2,
+ // only one thread created so alpm action will run one after one
+ 1,
// no exclusive thread
false
);
@@ -168,7 +168,12 @@ namespace Pamac {
alpm_handle.logcb = (Alpm.LogCallBack) cb_log;
lockfile = GLib.File.new_for_path (alpm_handle.lockfile);
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.totaldlcb = (Alpm.TotalDownloadCallBack) cb_totaldownload;
+ files_handle.logcb = (Alpm.LogCallBack) cb_log;
}
}
@@ -471,21 +476,30 @@ namespace Pamac {
write_log_file ("synchronizing package lists");
cancellable.reset ();
int force = (force_refresh) ? 1 : 0;
+ // try to copy refresh dbs in tmp
+ string tmp_dbpath = "/tmp/pamac-checkdbs";
+ try {
+ Process.spawn_command_line_sync ("cp -au %s/sync %s".printf (tmp_dbpath, alpm_handle.dbpath));
+ } catch (SpawnError e) {
+ stderr.printf ("SpawnError: %s\n", e.message);
+ }
// update ".db"
bool success = update_dbs (alpm_handle, force);
if (cancellable.is_cancelled ()) {
refresh_finished (false);
return;
}
- if (success) {
+ // update ".files", do not need to know if we succeeded
+ update_dbs (files_handle, force);
+ if (cancellable.is_cancelled ()) {
+ refresh_finished (false);
+ } else if (success) {
refreshed = true;
refresh_finished (true);
} else {
current_error.message = _("Failed to synchronize any databases");
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) {
diff --git a/src/transaction.vala b/src/transaction.vala
index ac8431a..fd3099c 100644
--- a/src/transaction.vala
+++ b/src/transaction.vala
@@ -472,6 +472,9 @@ namespace Pamac {
success = false;
finish_transaction ();
}
+ } else {
+ success = false;
+ finish_transaction ();
}
});
}
@@ -1396,8 +1399,8 @@ namespace Pamac {
rates_nb = 0;
fraction = 0;
timer.start ();
- if (filename.has_suffix (".db")) {
- string action = dgettext (null, "Refreshing %s").printf (filename.replace (".db", "")) + "...";
+ if (filename.has_suffix (".db") || filename.has_suffix (".files")) {
+ string action = dgettext (null, "Refreshing %s").printf (filename) + "...";
reset_progress_box (action);
}
} else if (xfered == total) {
diff --git a/src/tray.vala b/src/tray.vala
index e8c6cb0..eff0531 100644
--- a/src/tray.vala
+++ b/src/tray.vala
@@ -220,7 +220,9 @@ namespace Pamac {
}
} else {
if (lockfile.query_exists ()) {
- extern_lock = true;
+ if (!check_pamac_running ()) {
+ extern_lock = true;
+ }
}
}
return true;
diff --git a/src/user_daemon.vala b/src/user_daemon.vala
index 557e1b9..09d8dc9 100644
--- a/src/user_daemon.vala
+++ b/src/user_daemon.vala
@@ -847,6 +847,14 @@ namespace Pamac {
db.update (0);
syncdbs.next ();
}
+ // refresh file dbs
+ var tmp_files_handle = alpm_config.get_handle (true, true);
+ syncdbs = tmp_files_handle.syncdbs;
+ while (syncdbs != null) {
+ unowned Alpm.DB db = syncdbs.data;
+ db.update (0);
+ syncdbs.next ();
+ }
string[] local_pkgs = {};
unowned Alpm.List pkgcache = tmp_handle.localdb.pkgcache;
while (pkgcache != null) {