Adopt remaining major portzap updates

This commit is contained in:
0x1eef 2024-06-01 01:02:12 -03:00
parent 8b63c53aa9
commit e3d82b207d
9 changed files with 20 additions and 12 deletions

View file

@ -5,10 +5,11 @@ LIBEXECDIR = $(PREFIX)/libexec/sourcezap
SHAREDIR = $(PREFIX)/share/sourcezap SHAREDIR = $(PREFIX)/share/sourcezap
install: install:
install -d $(BINDIR) $(LIBEXECDIR) $(SHAREDIR) $(MANDIR) install -d $(BINDIR) $(LIBEXECDIR) $(LIBEXECDIR)/commands $(LIBEXECDIR)/utils $(SHAREDIR) $(MANDIR)
install -m 0755 bin/sourcezap $(BINDIR) install -m 0755 bin/sourcezap $(BINDIR)
install -m 0755 bin/setup-sourcezap $(BINDIR) install -m 0755 bin/setup-sourcezap $(BINDIR)
install -m 0755 libexec/sourcezap/* $(LIBEXECDIR) install -m 0755 libexec/sourcezap/commands/* $(LIBEXECDIR)/commands
install -m 0755 libexec/sourcezap/utils/* $(LIBEXECDIR)/utils
install -m 0644 share/sourcezap/* $(SHAREDIR) install -m 0644 share/sourcezap/* $(SHAREDIR)
install -m 0644 man/man8/sourcezap.8 $(MANDIR) install -m 0644 man/man8/sourcezap.8 $(MANDIR)
@ -20,5 +21,6 @@ deinstall:
rm -rf $(SHAREDIR) rm -rf $(SHAREDIR)
shellcheck: shellcheck:
shellcheck bin/sourcezap shellcheck bin/*
shellcheck libexec/sourcezap/* shellcheck libexec/sourcezap/utils/*
shellcheck libexec/sourcezap/commands/*

View file

@ -32,7 +32,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/issourcezap-member; 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

@ -18,7 +18,7 @@ gitexec()
printok() printok()
{ {
"${libexec}"/utils/printerr "${1}" "${libexec}"/utils/printok "${1}"
} }
printerr() printerr()
@ -33,7 +33,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/issourcezap-member; 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

@ -15,8 +15,8 @@ revfile=$3
perform_update() perform_update()
{ {
rev=$(cat "${revfile}") rev=$(cat "${revfile}")
add=$("${libexec}"/git-changed-files "${gitdir}" "${rev}") add=$("${libexec}"/utils/git-changed-files "${gitdir}" "${rev}")
del=$("${libexec}"/git-removed-files "${gitdir}" "${rev}") del=$("${libexec}"/utils/git-removed-files "${gitdir}" "${rev}")
for file in ${del}; do for file in ${del}; do
target="${installdir}/${file}" target="${installdir}/${file}"
parent=$(dirname "${target}") parent=$(dirname "${target}")
@ -64,6 +64,11 @@ run_install()
install -o root -g _sourcezap -m "${mode}" -v "$@" install -o root -g _sourcezap -m "${mode}" -v "$@"
} }
printok()
{
"${libexec}"/utils/printok "${1}"
}
printerr() printerr()
{ {
"${libexec}"/utils/printerr "${1}" "${libexec}"/utils/printerr "${1}"
@ -79,7 +84,6 @@ fi
set -x set -x
umask ${mode} umask ${mode}
cd "${gitdir}" cd "${gitdir}"
set +x
run_install "-d" "${installdir}" run_install "-d" "${installdir}"
chmod ${mode} "${installdir}" chmod ${mode} "${installdir}"
if [ -e "${revfile}" ]; then if [ -e "${revfile}" ]; then
@ -87,4 +91,6 @@ if [ -e "${revfile}" ]; then
else else
perform_install perform_install
fi fi
"${libexec}"/git-rev "${gitdir}" > "${revfile}" "${libexec}"/utils/git-rev "${gitdir}" > "${revfile}"
set +x
printok "install complete"

View file

@ -31,7 +31,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1 exit 1
fi fi
if ! "${libexec}"/issourcezap-member; 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