From a4e5b2f9be3063f69410f99d9cfe5592600aef74 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Mon, 23 Jan 2023 11:12:57 -0300 Subject: [PATCH] Add clarity to variable names in "install-directory" --- libexec/portzap/install-directory | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libexec/portzap/install-directory b/libexec/portzap/install-directory index 6e3427d..0cd8645 100755 --- a/libexec/portzap/install-directory +++ b/libexec/portzap/install-directory @@ -1,22 +1,25 @@ #!/bin/sh -dest=$1 +ports_dir=$1 libexec_dir=$2 group=_portzap mode=u=rwx,g=rx,o= 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) + relative_portzap_dir=$(eval echo -n \${$i}) + # Install directory + install -d -g $group -m $mode \ + $relative_portzap_dir \ + $ports_dir/$relative_portzap_dir + echo $(realpath $ports_dir/$relative_portzap_dir) # Install files - find $dir -maxdepth 1 -type f \ + find $relative_portzap_dir -maxdepth 1 -type f \ \( -not -name ".gitignore" \) \ \( -not -name ".arcconfig" \) \ - -exec $libexec_dir/install-file $dest/$dir {} + + -exec $libexec_dir/install-file $ports_dir/$relative_portzap_dir {} + # Install subdirs (recursive) - find -s $dir -depth 1 -type d \ + find -s $relative_portzap_dir -depth 1 -type d \ \( -not -name ".git" \) \ \( -not -name ".hooks" \) \ - -exec $libexec_dir/install-directory $dest $libexec_dir {} \; + -exec $libexec_dir/install-directory $ports_dir $libexec_dir {} \; done