kiss: installation performance improvements when many files

This commit is contained in:
Dylan Araps 2020-09-25 18:25:46 +03:00
parent 946adbd6f6
commit a1de34d781
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 8 additions and 10 deletions

18
kiss
View File

@ -926,7 +926,7 @@ pkg_install_files() {
sort "$2/$pkg_db/${2##*/}/manifest" | sort "$2/$pkg_db/${2##*/}/manifest" |
while read -r line; do while read -r line; do
[ -d "$KISS_ROOT/$line" ] && [ -d "$KISS_ROOT/$line" ] || test "$1" "$KISS_ROOT/$line" &&
continue continue
rwx=$(ls -ld "$2/$line") oct='' b='' o=0 rwx=$(ls -ld "$2/$line") oct='' b='' o=0
@ -950,8 +950,7 @@ pkg_install_files() {
# Copy files and create directories (preserving permissions). # Copy files and create directories (preserving permissions).
case $line in case $line in
/etc/?*[!/]) /etc/?*[!/])
test "$1" "$KISS_ROOT/$line" || pkg_etc_file "$2" "${line#/}"
pkg_etc_file "$2" "${line#/}"
;; ;;
*/) */)
@ -959,14 +958,13 @@ pkg_install_files() {
;; ;;
*) *)
test "$1" "$KISS_ROOT/$line" || { cp -fP "$2/$line" "$KISS_ROOT/$line"
cp -fP "$2/$line" "$KISS_ROOT/$line"
# This prepends $b which represents sticky bit, # This prepends $b which represents sticky bit,
# setuid, setfgid, etc. # setuid, setfgid, etc.
[ -h "$KISS_ROOT/$line" ] || [ -h "$KISS_ROOT/$line" ] ||
chmod "$b$oct" "$KISS_ROOT/$line" chmod "$b$oct" "$KISS_ROOT/$line"
} ;;
esac esac
done ||: done ||: