aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-05 09:22:59 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-05 09:22:59 +0000
commitb36a8775e5e0ccbc51269bacf22a51c8c54c01f8 (patch)
tree130bdfe8669b1d2ea9dedd11031684c26a954756
parent95a7d4c583a5d0839dc4972396f87b59755c42b7 (diff)
downloadcpt-b36a8775e5e0ccbc51269bacf22a51c8c54c01f8.tar.gz
kiss: Added KISS_ROOT to etcsums
FossilOrigin-Name: 45f939057dd9bcb84c6c56ea38fd34abc99c51467831c0758911a1897c511a09
-rwxr-xr-xkiss22
1 files changed, 10 insertions, 12 deletions
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.