1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 16:40:07 -07:00

kiss: Added KISS_ROOT to etcsums

This commit is contained in:
Dylan Araps 2020-02-05 11:23:00 +02:00
parent 0df093f729
commit 98d5aaab79
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

22
kiss
View File

@ -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.