Skip to content
Snippets Groups Projects
Unverified Commit 4c68ccb8 authored by Dustin Falgout's avatar Dustin Falgout
Browse files

Don't try to create temporary database directory if it already exists as doing...

Don't try to create temporary database directory if it already exists as doing so triggers exception before the handle is set which causes update check to fail.
parent 2370068f
No related branches found
No related tags found
1 merge request!424Fix User Daemon Updates Check
......@@ -140,10 +140,12 @@ public class AlpmConfig {
if (tmp_db) {
string tmp_dbpath = "/tmp/pamac-checkdbs";
try {
Process.spawn_command_line_sync ("mkdir -p %s/sync".printf (tmp_dbpath));
Process.spawn_command_line_sync ("ln -sf %slocal %s".printf (dbpath, tmp_dbpath));
Process.spawn_command_line_sync ("chmod -R 777 %s/sync".printf (tmp_dbpath));
Process.spawn_command_line_sync ("bash -c 'cp -p %ssync/*.{db,files} %s/sync'".printf (dbpath, tmp_dbpath));
if (! GLib.FileUtils.test(tmp_dbpath, GLib.FileTest.IS_DIR)) {
Process.spawn_command_line_sync ("mkdir -p %s/sync".printf (tmp_dbpath));
Process.spawn_command_line_sync ("ln -sf %slocal %s".printf (dbpath, tmp_dbpath));
Process.spawn_command_line_sync ("chmod -R 777 %s/sync".printf (tmp_dbpath));
Process.spawn_command_line_sync ("bash -c 'cp -p %ssync/*.{db,files} %s/sync'".printf (dbpath, tmp_dbpath));
}
handle = new Alpm.Handle (rootdir, tmp_dbpath, out error);
} catch (SpawnError e) {
stderr.printf ("SpawnError: %s\n", e.message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment