Sync with sourcezap
Some checks are pending
portzap / shellcheck (push) Waiting to run

This commit is contained in:
0x1eef 2024-09-10 03:38:14 -03:00
parent 5328bd72e0
commit 2d6c138d34
16 changed files with 46 additions and 28 deletions

View file

@ -5,7 +5,7 @@ set -e
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
git="${libexec}"/scripts/git
repodir=$1
branch=$2
@ -21,7 +21,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1
fi
if ! "${libexec}"/utils/isportzap-member; then
if ! "${libexec}"/scripts/is-portzap-member; then
printerr "$(id -un) is not a member of _portzap"
exit 1
fi

View file

@ -5,7 +5,7 @@ set -e
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
git="${libexec}"/scripts/git
repourl=$1
repodir=$2
branch=$3
@ -22,7 +22,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1
fi
if ! "${libexec}"/utils/isportzap-member; then
if ! "${libexec}"/scripts/is-portzap-member; then
printerr "$(id -un) is not a member of _portzap"
exit 1
fi

View file

@ -5,8 +5,8 @@ set -e
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
mask=$("${libexec}"/utils/get-umask)
git="${libexec}"/scripts/git
mask=$("${libexec}"/scripts/get-default-umask)
repodir=$1
installdir=$2
commitfile=$3
@ -28,14 +28,14 @@ if [ -e "${commitfile}" ]; then
##
# install update
commit=$(cat "${commitfile}")
"${libexec}"/utils/install/run -d "${installdir}"
"${libexec}"/utils/install/update-deleted-files "${repodir}" "${installdir}" "${commit}"
"${libexec}"/utils/install/update-changed-files "${repodir}" "${installdir}" "${commit}"
"${libexec}"/scripts/install -d "${installdir}"
"${libexec}"/scripts/install/update-deleted-files "${repodir}" "${installdir}" "${commit}"
"${libexec}"/scripts/install/update-changed-files "${repodir}" "${installdir}" "${commit}"
else
##
# install from scratch
umask "${mask}"
"${libexec}"/utils/install/run -d "${installdir}"
"${libexec}"/scripts/install -d "${installdir}"
find -s . \
-maxdepth 1 \
! -name "." \

View file

@ -5,7 +5,7 @@ set -e
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
git="${libexec}"/scripts/git
repodir=$1
##
@ -20,7 +20,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1
fi
if ! "${libexec}"/utils/isportzap-member; then
if ! "${libexec}"/scripts/is-portzap-member; then
printerr "$(id -un) is not a member of _portzap"
exit 1
fi

View file

@ -20,7 +20,7 @@ if [ "$(id -u)" = "0" ]; then
exit 1
fi
if ! "${libexec}"/utils/isportzap-member; then
if ! "${libexec}"/scripts/is-portzap-member; then
printerr "$(id -un) is not a member of _portzap"
exit 1
fi

View file

@ -3,10 +3,10 @@ set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git=$(which git)
mask=$("${libexec}"/utils/get-umask)
mask=$("${libexec}"/scripts/get-default-umask)
##
# main

View file

@ -3,9 +3,9 @@ set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
git="${libexec}"/scripts/git
repodir=$1
commit=$2

View file

@ -3,9 +3,9 @@ set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
git="${libexec}"/scripts/git
repodir=$1
commit=$2

View file

@ -3,9 +3,9 @@ set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
mask=$("${libexec}"/utils/get-umask)
mask=$("${libexec}"/scripts/get-default-umask)
##
# main

View file

@ -16,7 +16,9 @@ sharedir="${localbase}"/share/portzap
# main
src="${sharedir}"/doas.conf
dest="${localbase}"/etc/doas.conf
while read -r line < "${src}"; do
# shellcheck disable=SC2002
cat "${src}" |
while read -r line; do
if grep -q "${line}" "${dest}"; then
continue
fi

View file

@ -3,7 +3,7 @@ set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
repodir=$1
installdir=$2
@ -12,7 +12,7 @@ commit=$3
##
# main
cd "${repodir}"
files=$("${libexec}"/utils/git/get-changed-files "${repodir}" "${commit}")
files=$("${libexec}"/scripts/git-get-changed-files "${repodir}" "${commit}")
for file in ${files}; do
target="${installdir}/${file}"
parent=$(dirname "${target}")
@ -22,7 +22,7 @@ for file in ${files}; do
parent=$(dirname "${parent}")
done
for dir in ${parents}; do
"${libexec}"/utils/install/run -d "${dir}"
"${libexec}"/scripts/install -d "${dir}"
done
"${libexec}"/utils/install/run "${file}" "${target}"
"${libexec}"/scripts/install "${file}" "${target}"
done

View file

@ -3,7 +3,7 @@ set -e
##
# variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)}
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap
repodir=$1
installdir=$2
@ -12,7 +12,7 @@ commit=$3
##
# main
cd "${repodir}"
files=$("${libexec}"/utils/git/get-removed-files "${repodir}" "${commit}")
files=$("${libexec}"/scripts/git-get-removed-files "${repodir}" "${commit}")
for file in ${files}; do
target="${installdir}"/"${file}"
parent=$(dirname "${target}")

View file

@ -1,5 +1,21 @@
# -*- mode: org -*-
* vNEXT
**** Address ~libexec/portzap/scripts/setup-doas~ bug
This change addresses a bug in ~setup-doas~ that could hang
the ~portzap setup~ command
**** Collapse ~libexec/portzap/scripts~
This change does not try to organize script directories that
go beyond ~libexec/portzap/scripts~
**** Add ~libexec/portzap/scripts/setup~
This new directory replaces what was formerly known as ~libexec/portzap/setup~
**** Add ~libexec/portzap/scripts~
This new directory replaces what was formerly known as ~libexec/portzap/utils~
* v1.1.0
**** Add ~libexec/portzap/utils/get-umask~