Commit de1aaa3f authored by guinux's avatar guinux

another fix for auto download updates

parent 6204d96c
......@@ -134,7 +134,7 @@ public class AlpmConfig {
}
}
public Alpm.Handle? get_handle (bool files_db = false, bool tmp_db = false) {
public Alpm.Handle? get_handle (bool files_db = false, bool tmp_db = false, bool copy_dbs = true) {
Alpm.Errno error = 0;
Alpm.Handle? handle = null;
if (tmp_db) {
......@@ -144,7 +144,9 @@ public class AlpmConfig {
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 (copy_dbs) {
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) {
......
......@@ -841,7 +841,7 @@ namespace Pamac {
private int download_updates () {
downloading_updates = true;
// use tmp handle
var handle = alpm_config.get_handle (false, true);
var handle = alpm_config.get_handle (false, true, false);
handle.fetchcb = (Alpm.FetchCallBack) cb_fetch;
cancellable.reset ();
int success = handle.trans_init (Alpm.TransFlag.DOWNLOADONLY);
......
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