From 7a9a241181928f82b337bf810fb5aa02ef7957d9 Mon Sep 17 00:00:00 2001 From: matthiakl Date: Sat, 10 Jul 2021 20:35:09 +0200 Subject: [PATCH] Use GLib.File instead of cp --- src/transaction.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/transaction.vala b/src/transaction.vala index 4eb7bcb..c3d25c9 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -1404,7 +1404,9 @@ namespace Pamac { if (path != "" && !(path in built_pkgs)) { built_pkgs += path; if(aur_keep_pkgs) { - yield spawn_in_term ({"cp", path, aur_move_dir}); + File pkg_file = GLib.File.new_for_path (path); + File target_file = GLib.File.new_build_filename (aur_move_dir, pkg_file.get_basename()); + pkg_file.copy (target_file, OVERWRITE); } } } @@ -1412,6 +1414,9 @@ namespace Pamac { } catch (SpawnError e) { stderr.printf ("SpawnError: %s\n", e.message); status = 1; + } catch (GLib.Error e) { + stderr.printf ("GLib Error: %s\n", e.message); + status = 1; } } }