Replace multiple commands with /usr/bin/install

This commit is contained in:
0x1eef 2024-04-14 20:32:48 -03:00
parent 71000adb5c
commit ec01b20506

View file

@ -6,8 +6,9 @@ gitdir=$1
installdir=$2 installdir=$2
revfile=$3 revfile=$3
artifacts=".git .gitignore .hooks .arcconfig" artifacts=".git .gitignore .hooks .arcconfig"
libexec=/usr/local/libexec/portzap libexec="/usr/local/libexec/portzap"
mode="u=rwX,g=rwX,o=" mode="u=rwX,g=rwX,o="
flags="-o root -g _portzap -m ${mode} -v"
## ##
# functions # functions
@ -28,21 +29,14 @@ perform_update()
target="${installdir}/${file}" target="${installdir}/${file}"
parent=$(dirname "${target}") parent=$(dirname "${target}")
if [ ! -e "${parent}" ]; then if [ ! -e "${parent}" ]; then
mkdir -p "${parent}" install -d ${flags} "${parent}"
chown root:_portzap "${parent}"
chmod ${mode} "${parent}"
fi fi
cp -v "${file}" "${target}" install ${flags} "${file}" "${target}"
chown root:_portzap "${target}"
chmod ${mode} "${target}"
done done
} }
perform_install() perform_install()
{ {
mkdir -p "${installdir}"
chown root:_portzap "${installdir}"
chmod ${mode} "${installdir}"
find -s . \ find -s . \
-maxdepth 1 \ -maxdepth 1 \
-exec cp -Rfv {} "${installdir}" \; \ -exec cp -Rfv {} "${installdir}" \; \
@ -56,6 +50,7 @@ perform_install()
## ##
# main # main
cd "${gitdir}" cd "${gitdir}"
install -d ${flags} "${installdir}"
if [ -e "${revfile}" ]; then if [ -e "${revfile}" ]; then
perform_update perform_update
else else