1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-11-04 14:05:41 -07:00

pkg_install: Simplify find commands.

This commit is contained in:
Dylan Araps 2019-07-05 20:07:11 +03:00
parent ca9e19edeb
commit d217c065cd

17
kiss
View File

@ -690,21 +690,12 @@ pkg_install() {
# Create all of the package's directories. # Create all of the package's directories.
# Optimization: Only find the deepest directories. # Optimization: Only find the deepest directories.
"$cac_dir/find" . -type d -links -3 -prune | while read -r dir; do "$cac_dir/find" . -type d -links -3 -prune \
"$cac_dir/mkdir" -p "$KISS_ROOT/${dir#./}" -exec "$cac_dir/mkdir" -p "$KISS_ROOT/"{} \;
done
# Move all package files to '$KISS_ROOT'. # Move all package files to '$KISS_ROOT'.
"$cac_dir/find" ./ -mindepth 1 -not -type d | while read -r file; do "$cac_dir/find" . -mindepth 1 -not -type d \
rpath=${file#.} -exec "$cac_dir/mv" -n {} "$KISS_ROOT/"{} \;
# Don't overwrite existing '/etc' files.
[ -z "${rpath##/etc/*}" ] &&
[ -f "$KISS_ROOT/${rpath%/*}/${file##*/}" ] &&
return
"$cac_dir/mv" "$file" "$KISS_ROOT/${rpath%/*}" ||:
done
# Reset 'trap' to its original value. Installation is done so # Reset 'trap' to its original value. Installation is done so
# we no longer need to block 'Ctrl+C'. # we no longer need to block 'Ctrl+C'.