commit b905b07c470dc0ed650d6ff8c85ab43edfbd9220 parent 90c916ee8d5a670114776024384fc181c9ddb292 Author: Dylan Araps <dylan.araps@gmail.com> Date: Sat, 25 Apr 2020 14:03:34 +0300 kiss: Add support for KISS_ROOT to install Diffstat:
M | kiss | | | 14 | ++++++++------ |
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/kiss b/kiss @@ -859,7 +859,7 @@ pkg_install_files() { sort "$2/$pkg_db/${2##*/}/manifest" | while read -r line; do i=$((i+1)) # Grab the permissions so that we can preserve them. - perms=$(stat -c %a "$tar_dir/$pkg_name/$line") + rwx=$(stat -c %a "$tar_dir/$pkg_name/$line") # Copy files and create directories (preserving permissions), # skipping anything located in /etc/. @@ -868,15 +868,17 @@ pkg_install_files() { # for overwrite. case $line in /etc/*) ;; */) [ -d "$line" ] || - install -o root -g root -m "$perms" -d "$line" ;; - *) test "$1" "$line" || + install -o root -g root -m "$rwx" \ + -d "$KISS_ROOT/$line" ;; + *) test "$1" "$KISS_ROOT/$line" || if [ -L "$2/$line" ]; then - [ -d "$line" ] && continue + [ -d "$KISS_ROOT/$line" ] && continue cp -fPp "$2/$line" "${line%/*}" - chown -h root:root "$line" + chown -h root:root "$KISS_ROOT/$line" else - install -o root -g root -m "$perms" "$2/$line" "$line" + install -o root -g root -m "$rwx" \ + "$2/$line" "$KISS_ROOT/$line" fi esac