aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-05 17:07:11 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-05 17:07:11 +0000
commit840d05eedfbfa2265bb81935cbde0daaf28e050d (patch)
treed3ab167203914342e5e1dcbd40be9ec96e39d8ea /kiss
parent1e7d9bd4d7d613b1540fa64ae20c75cea3ef2741 (diff)
downloadcpt-840d05eedfbfa2265bb81935cbde0daaf28e050d.tar.gz
pkg_install: Simplify find commands.
FossilOrigin-Name: b18b8033fd3c798e47a599559db637eea8025cb804b68ce745ff9751d1e0a21e
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss17
1 files changed, 4 insertions, 13 deletions
diff --git a/kiss b/kiss
index cb1a111..248c74a 100755
--- a/kiss
+++ b/kiss
@@ -690,21 +690,12 @@ pkg_install() {
# Create all of the package's directories.
# Optimization: Only find the deepest directories.
- "$cac_dir/find" . -type d -links -3 -prune | while read -r dir; do
- "$cac_dir/mkdir" -p "$KISS_ROOT/${dir#./}"
- done
+ "$cac_dir/find" . -type d -links -3 -prune \
+ -exec "$cac_dir/mkdir" -p "$KISS_ROOT/"{} \;
# Move all package files to '$KISS_ROOT'.
- "$cac_dir/find" ./ -mindepth 1 -not -type d | while read -r file; do
- rpath=${file#.}
-
- # Don't overwrite existing '/etc' files.
- [ -z "${rpath##/etc/*}" ] &&
- [ -f "$KISS_ROOT/${rpath%/*}/${file##*/}" ] &&
- return
-
- "$cac_dir/mv" "$file" "$KISS_ROOT/${rpath%/*}" ||:
- done
+ "$cac_dir/find" . -mindepth 1 -not -type d \
+ -exec "$cac_dir/mv" -n {} "$KISS_ROOT/"{} \;
# Reset 'trap' to its original value. Installation is done so
# we no longer need to block 'Ctrl+C'.