From ace1ebb46385a3f12418ff39ee58bd10fc9491e1 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sun, 22 Jan 2023 19:34:07 -0300 Subject: [PATCH] Exclude dirs: ".git", ".hooks" Exclude files: ".gitignore", ".arcconfig" This change is a follow up to the previous commit that didn't work as intended. --- bin/portzap | 2 +- libexec/portzap/install-directory | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/portzap b/bin/portzap index 961d2fb..4e5ccbf 100755 --- a/bin/portzap +++ b/bin/portzap @@ -104,7 +104,7 @@ install() { exit 1 fi cd $portzap_dir - find -E -s . -regex .+[^\.git] -regex .+[^\.hooks] -maxdepth 1 -type d \ + find -s . -maxdepth 1 -type d \ -exec $libexec_dir/install-directory $ports_dir $libexec_dir {} + } diff --git a/libexec/portzap/install-directory b/libexec/portzap/install-directory index 0b468ce..7c88312 100755 --- a/libexec/portzap/install-directory +++ b/libexec/portzap/install-directory @@ -7,6 +7,16 @@ for i in $(seq 3 $#); do dir=$(eval echo -n \${$i}) install -d -g $group -m $mode $src $dest/$dir echo Install $(realpath $dest/$dir) - find $dir -maxdepth 1 -type f -exec $libexec_dir/install-file $dest/$dir {} + - find -s $dir -depth 1 -type d -exec $libexec_dir/install-directory $dest $libexec_dir {} \; + + # Install files + find $dir -maxdepth 1 -type f \ + \( -not -name ".gitignore" \) \ + \( -not -name ".arcconfig" \) \ + -exec $libexec_dir/install-file $dest/$dir {} + + + # Install subdirs (recursive) + find -s $dir -depth 1 -type d \ + \( -not -name ".git" \) \ + \( -not -name ".hooks" \) \ + -exec $libexec_dir/install-directory $dest $libexec_dir {} \; done