From 7e2a79a7fa3e28dcde9442f614966641c0537780 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 14 Jul 2021 11:33:41 +0300 Subject: [PATCH] kiss: ensure move only occurs when copy fails --- kiss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kiss b/kiss index 326b07d..8863b6d 100755 --- a/kiss +++ b/kiss @@ -1117,14 +1117,14 @@ pkg_install_files() { # Copy the file to the destination directory with the # temporary name created above. - cp -fP "$2$file" "$__tmp" + cp -fP "$2$file" "$__tmp" && # Atomically move the temporary file to its final # destination. The running processes will either get # the old file or the new one. mv -f "$__tmp" "$_file" fi - esac + esac || return 1 done }