Compare commits

...

3 commits

Author SHA1 Message Date
b3720019b2 Call issourcezap-member before ${gitdir} check
Some checks are pending
sourcezap / shellcheck (push) Waiting to run
2024-08-09 22:51:35 -03:00
ef1295fb35 Silence issourcezap-member noise in sourcezap-sh 2024-08-09 22:48:27 -03:00
230ae9b1e8 Update README 2024-08-07 19:56:45 -03:00
6 changed files with 12 additions and 11 deletions

View file

@ -1,10 +1,10 @@
## About ## About
sourcezap manages a local copy of the sourcezap is a utility that manages a local copy of the
[HardenedBSD source tree](https://git.HardenedBSD.org/HardenedBSD/HardenedBSD). [HardenedBSD source tree](https://git.HardenedBSD.org/HardenedBSD/HardenedBSD).
The copy of the source tree is maintained by members of The copy of the source tree is maintained by members of
the `_sourcezap` group, and a copy of the source tree the `_sourcezap` group, and the copy of the source tree
can be installed into `/usr/src/` by root. can be installed into `/usr/ports/` by root.
## CLI ## CLI

View file

@ -21,7 +21,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then if ! "${libexec}"/utils/issourcezap-member; then
printerr "$(id -un) is not a member of _sourcezap" printerr "$(id -un) is not a member of _sourcezap"
exit 1 exit 1
fi fi

View file

@ -22,7 +22,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then if ! "${libexec}"/utils/issourcezap-member; then
printerr "$(id -un) is not a member of _sourcezap" printerr "$(id -un) is not a member of _sourcezap"
exit 1 exit 1
fi fi

View file

@ -20,7 +20,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/utils/issourcezap-member > /dev/null 2>&1; then if ! "${libexec}"/utils/issourcezap-member; then
printerr "$(id -un) is not a member of _sourcezap" printerr "$(id -un) is not a member of _sourcezap"
exit 1 exit 1
fi fi

View file

@ -20,15 +20,16 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/utils/issourcezap-member; then
printerr "$(id -un) is not a member of _sourcezap"
exit 1
fi
if [ ! -e "${gitdir}" ]; then if [ ! -e "${gitdir}" ]; then
printerr "try 'sourcezap clone' instead" printerr "try 'sourcezap clone' instead"
exit 1 exit 1
fi fi
if ! "${libexec}"/utils/issourcezap-member; then
printerr "$(id -un) is not a member of _sourcezap"
fi
cd "${gitdir}" cd "${gitdir}"
doas -n \ doas -n \
-u "${user}" \ -u "${user}" \

View file

@ -5,5 +5,5 @@ set -e
# main # main
group="_sourcezap" group="_sourcezap"
mygroups=$(id -Gn | tr ' ' '\n') mygroups=$(id -Gn | tr ' ' '\n')
echo "${mygroups}" | grep -e "^${group}$" echo "${mygroups}" | grep -e "^${group}$" > /dev/null 2>&1
exit "${?}" exit "${?}"