Update git-* utils

Default to a localbase path that is relative to the current
file, and call git via utils/gitexec
This commit is contained in:
0x1eef 2024-06-07 13:07:11 -03:00
parent 1218164c9a
commit a9f8daac78
3 changed files with 9 additions and 14 deletions

View file

@ -3,18 +3,16 @@ set -e
##
# variables
localbase=${LOCALBASE:-/usr/local}
git="${localbase}"/bin/git
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/sourcezap
gitdir=$1
commit=$2
mode=u=rwX,g=rX,o=
##
# functions
gitexec()
{
doas -n -u _sourcezap \
/bin/sh -c "umask ${mode}; ${git} ${1}"
"${libexec}"/utils/gitexec "${1}"
}
##

View file

@ -3,18 +3,16 @@ set -e
##
# variables
localbase=${LOCALBASE:-/usr/local}
git="${localbase}"/bin/git
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/sourcezap
gitdir=$1
commit=$2
mode=u=rwX,g=rX,o=
##
# functions
gitexec()
{
doas -n -u _sourcezap \
/bin/sh -c "umask ${mode}; ${git} ${1}"
"${libexec}"/utils/gitexec "${1}"
}
##

View file

@ -3,16 +3,15 @@ set -e
##
# variables
git=/usr/local/bin/git
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/sourcezap
gitdir=$1
mode=u=rwX,g=rX,o=
##
# functions
gitexec()
{
doas -n -u _sourcezap \
/bin/sh -c "umask ${mode}; ${git} ${1}"
"${libexec}"/utils/gitexec "${1}"
}
##