From b36a8775e5e0ccbc51269bacf22a51c8c54c01f8 Mon Sep 17 00:00:00 2001 From: "dylan.araps@gmail.com" Date: Wed, 5 Feb 2020 09:22:59 +0000 Subject: kiss: Added KISS_ROOT to etcsums FossilOrigin-Name: 45f939057dd9bcb84c6c56ea38fd34abc99c51467831c0758911a1897c511a09 --- kiss | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'kiss') diff --git a/kiss b/kiss index 1b2e249..e490341 100755 --- a/kiss +++ b/kiss @@ -944,7 +944,7 @@ pkg_install() { find etc -type f | while read -r file; do { sum_new=$(sha256sum "$file") - sum_sys=$(cd /; sha256sum "$file") + sum_sys=$(cd "$KISS_ROOT/"; sha256sum "$file") sum_old=$("$grep" "$file$" "$sys_db/$pkg_name/etcsums") } 2>/dev/null ||: @@ -956,20 +956,18 @@ pkg_install() { # old = X, sys = X, new = Y ${sum_old}${sum_old}${sum_old}|\ ${sum_old:-null}${sum_sys}${sum_sys}|\ - ${sum_sys}${sum_old}*) - cp -af "$file" "/$file" - chown root:root "/$file" - ;; + ${sum_sys}${sum_old}*) ;; # All other cases. - *) - log "$pkg_name" "WARN: saving $file as $file.new" + *) log "$pkg_name" "WARN: saving $file as $file.new" + new=.new + esac - cp -af "$file" "/$file.new" - chown root:root "/$file.new" - ;; - esac ||: - done + cp -af "$file" "$KISS_ROOT/${file}${new}" + chown root:root "$KISS_ROOT/${file}${new}" + + new= + done ||: ) # Remove any leftover files if this is an upgrade. -- cgit v1.2.3