kiss: Clean up install

This commit is contained in:
Dylan Araps 2020-04-22 19:35:17 +03:00
parent 8a4c642d4b
commit 40d57d4948
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 8 additions and 8 deletions

16
kiss
View File

@ -819,7 +819,7 @@ pkg_install_files() {
# directories are created going down the tree. # directories are created going down the tree.
sort "$2/$pkg_db/${2##*/}/manifest" | sort "$2/$pkg_db/${2##*/}/manifest" |
while read -r line; do i=$((i+1)) while read -r line; do
# Grab the octal permissions so that directory creation # Grab the octal permissions so that directory creation
# preserves permissions. # preserves permissions.
perms=$(stat -c %a "$2/$line") perms=$(stat -c %a "$2/$line")
@ -833,14 +833,14 @@ pkg_install_files() {
*/) [ -d "$line" ] || */) [ -d "$line" ] ||
install -o root -g root -m "$perms" -d "$line" ;; install -o root -g root -m "$perms" -d "$line" ;;
*) test "$1" "$line" || *) test "$1" "$line" ||
if [ -L "$2/$line" ]; then if [ -L "$2/$line" ]; then
cp -fPp "$2/$line" "${line%/*}" cp -fPp "$2/$line" "${line%/*}"
chown -h root:root "$line" chown -h root:root "$line"
else else
install -o root -g root -m "$perms" "$2/$line" "$line" install -o root -g root -m "$perms" "$2/$line" "$line"
fi fi
esac esac
done done
} }