Add libexec/portzap/install-directory
This commit is contained in:
parent
20f379d11e
commit
0f08f82e6a
3 changed files with 14 additions and 6 deletions
|
@ -8,6 +8,7 @@ source_url="https://git.hardenedbsd.org/hardenedbsd/ports.git"
|
||||||
transient_dir="/home/_portzap/ports"
|
transient_dir="/home/_portzap/ports"
|
||||||
rest_dir="/usr/ports/"
|
rest_dir="/usr/ports/"
|
||||||
libexec_dir=$(realpath $(dirname $0)/../libexec/portzap/)
|
libexec_dir=$(realpath $(dirname $0)/../libexec/portzap/)
|
||||||
|
group="_portzap"
|
||||||
|
|
||||||
##
|
##
|
||||||
# Default masks
|
# Default masks
|
||||||
|
@ -17,7 +18,7 @@ pull_mask=007
|
||||||
|
|
||||||
##
|
##
|
||||||
# Default modes
|
# Default modes
|
||||||
install_mode="u=rwX,g=rX,o=rX"
|
install_mode="u=rwX,g=rX,o="
|
||||||
|
|
||||||
##
|
##
|
||||||
# Utils
|
# Utils
|
||||||
|
@ -108,9 +109,9 @@ install() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cd $transient_dir
|
cd $transient_dir
|
||||||
find . -maxdepth 1 -type f -exec install -m $install_mode {} $rest_dir \;
|
find . -maxdepth 1 -type f -exec install -g $group -m $install_mode {} $rest_dir \;
|
||||||
find . -maxdepth 1 -type d -exec mkdir -p -m $install_mode $rest_dir/{} \;
|
find . -maxdepth 1 -type d -exec $libexec_dir/install-directory {} $rest_dir/{} \;
|
||||||
find . -depth 2 -type d -exec $libexec_dir/install-port {} $rest_dir $install_mode \;
|
find . -depth 2 -type d -exec $libexec_dir/install-port {} $rest_dir $install_mode $libexec_dir \;
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
6
libexec/portzap/install-directory
Executable file
6
libexec/portzap/install-directory
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
src=$1
|
||||||
|
dest=$2
|
||||||
|
group=_portzap
|
||||||
|
mode=u=rwx,g=rx,o=
|
||||||
|
install -d -g $group -m $mode $src $dest
|
|
@ -2,14 +2,15 @@
|
||||||
src=$1
|
src=$1
|
||||||
dest=$2/${src}
|
dest=$2/${src}
|
||||||
mode=$3
|
mode=$3
|
||||||
|
libexec_dir=$4
|
||||||
group=_portzap
|
group=_portzap
|
||||||
install_args="-m $mode"
|
install_args="-m $mode"
|
||||||
|
|
||||||
mkdir -m $mode -p $dest
|
$libexec_dir/install-directory $src $dest
|
||||||
find $src -maxdepth 1 -type f -execdir install $install_args {} $dest/{} \;
|
find $src -maxdepth 1 -type f -execdir install $install_args {} $dest/{} \;
|
||||||
if [ -d "$src/files" ];
|
if [ -d "$src/files" ];
|
||||||
then
|
then
|
||||||
mkdir -m $mode -p $dest/files
|
$libexec_dir/install-directory $src/files $dest/files
|
||||||
find $src/files -maxdepth 1 -type f -execdir install $install_args {} $dest/files \;
|
find $src/files -maxdepth 1 -type f -execdir install $install_args {} $dest/files \;
|
||||||
fi
|
fi
|
||||||
echo Install $(realpath $dest)
|
echo Install $(realpath $dest)
|
||||||
|
|
Loading…
Reference in a new issue