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

kiss: simplify pkg_install_files

Permissions are already preserved.
This commit is contained in:
Dylan Araps 2021-07-13 22:52:42 +03:00
parent a5be67afa7
commit 7481a9dca0
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

12
kiss
View File

@ -1060,11 +1060,13 @@ pkg_install_files() {
case $rwx in
[rwx]*): "$((o+=${c#?}))" ;;
[st]*): "$((o+=1))" "$((b+=4 / (${c%?}/3)))" ;;
[ST]*): "$((b+=1))" ;;
[st]*): "$((o+=1))" ;;
[ST]*) ;;
esac
[ "$((${c%?} % 3))" = 0 ] && oct=$oct$o o=0
case "$((${c%?} % 3))" in 0)
oct=$oct$o o=0
esac
done
_file=$KISS_ROOT/${file#/}
@ -1098,10 +1100,6 @@ pkg_install_files() {
# destination. The running processes will either get
# the old file or the new one.
mv -f "$__tmp" "$_file"
# Skip changing permissions of symlinks. This prevents
# errors when the symlink exists prior to the target.
[ -h "$_file" ] || chmod "$b$oct" "$_file"
}
esac
done