diff --git a/bin/portzap b/bin/portzap index b620444..49a82c8 100755 --- a/bin/portzap +++ b/bin/portzap @@ -104,7 +104,7 @@ install() { exit 1 fi cd $portzap_dir - find . -maxdepth 1 -type d -exec $libexec_dir/install-directory {} $ports_dir $libexec_dir \; + find . -maxdepth 1 -type d -exec $libexec_dir/install-directory $ports_dir $libexec_dir {} + } case $1 in diff --git a/libexec/portzap/install-directory b/libexec/portzap/install-directory index 023ea8f..dc09fc7 100755 --- a/libexec/portzap/install-directory +++ b/libexec/portzap/install-directory @@ -1,11 +1,12 @@ #!/bin/sh -src=$1 -dest=$2 -libexec_dir=$3 +dest=$1 +libexec_dir=$2 group=_portzap mode=u=rwx,g=rx,o= - -install -d -g $group -m $mode $src $dest/$src -echo Install $(realpath $dest/$src) -find $src -maxdepth 1 -type f -exec $libexec_dir/install-file {} $dest/$src $libexec_dir \; -find $src -depth 1 -type d -exec $libexec_dir/install-directory {} $dest $libexec_dir \; +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 $dir -depth 1 -type d -exec $libexec_dir/install-directory $dest $libexec_dir {} \; +done diff --git a/libexec/portzap/install-file b/libexec/portzap/install-file index aebbfd2..0b4d29b 100755 --- a/libexec/portzap/install-file +++ b/libexec/portzap/install-file @@ -1,6 +1,9 @@ #!/bin/sh -src=$1 -dest=$2 +dest=$1 group=_portzap mode=u=rw,g=rw,o= -install -g $group -m $mode $src $dest +files="" +for i in $(seq 2 $#); do + files="${files} $(eval echo -n \${$i})" +done +install -g $group -m $mode $files $dest