Add libexec/portzap/utils/get-umask
Some checks are pending
portzap / shellcheck (push) Waiting to run
Some checks are pending
portzap / shellcheck (push) Waiting to run
This commit is contained in:
parent
7c4bff14a2
commit
a38962782f
5 changed files with 20 additions and 5 deletions
|
@ -6,6 +6,7 @@ set -e
|
|||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||
libexec="${localbase}"/libexec/portzap
|
||||
git="${libexec}"/utils/git/run
|
||||
mask=$("${libexec}"/utils/get-umask)
|
||||
gitdir=$1
|
||||
installdir=$2
|
||||
revfile=$3
|
||||
|
@ -33,7 +34,7 @@ if [ -e "${revfile}" ]; then
|
|||
else
|
||||
##
|
||||
# install from scratch
|
||||
umask u=rwX,g=rX,o=
|
||||
umask "${mask}"
|
||||
"${libexec}"/utils/install/run -d "${installdir}"
|
||||
find -s . \
|
||||
-maxdepth 1 \
|
||||
|
|
6
libexec/portzap/utils/get-umask
Normal file
6
libexec/portzap/utils/get-umask
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
##
|
||||
# main
|
||||
echo "u=rwX,g=rX,o="
|
|
@ -3,11 +3,13 @@ set -e
|
|||
|
||||
##
|
||||
# variables
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
|
||||
libexec="${localbase}"/libexec/portzap
|
||||
git=$(which git)
|
||||
mode=u=rwX,g=rX,o=
|
||||
mask=$("${libexec}"/utils/get-umask)
|
||||
|
||||
##
|
||||
# main
|
||||
doas -n \
|
||||
-u _portzap \
|
||||
/bin/sh -c "umask ${mode}; ${git} ${*}"
|
||||
/bin/sh -c "umask ${mask}; ${git} ${*}"
|
||||
|
|
|
@ -3,12 +3,14 @@ set -e
|
|||
|
||||
##
|
||||
# variables
|
||||
mode=u=rwX,g=rX,o=
|
||||
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
|
||||
libexec="${localbase}"/libexec/portzap
|
||||
mask=$("${libexec}"/utils/get-umask)
|
||||
|
||||
##
|
||||
# main
|
||||
install -o root \
|
||||
-g _portzap \
|
||||
-m "${mode}" \
|
||||
-m "${mask}" \
|
||||
-v \
|
||||
"${@}"
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
* vNEXT
|
||||
|
||||
** Add 'libexec/portzap/utils/get-umask'
|
||||
Add a single source of truth for the mask given to umask
|
||||
by git and portzap-install
|
||||
|
||||
** Break up 'portzap-install' into multiple files
|
||||
'libexec/portzap/utils/install/' contains files that cover both
|
||||
a fresh install and applying an update
|
||||
|
|
Loading…
Reference in a new issue