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 # variables
localbase=${LOCALBASE:-/usr/local} localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
git="${localbase}"/bin/git libexec="${localbase}"/libexec/sourcezap
gitdir=$1 gitdir=$1
commit=$2 commit=$2
mode=u=rwX,g=rX,o=
## ##
# functions # functions
gitexec() gitexec()
{ {
doas -n -u _sourcezap \ "${libexec}"/utils/gitexec "${1}"
/bin/sh -c "umask ${mode}; ${git} ${1}"
} }
## ##

View file

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

View file

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