From 203907672054a062b08e4da48048c12d0c563af0 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Tue, 20 Aug 2024 02:17:05 -0300 Subject: [PATCH] s|rev|commit|g, s|revfile|commitfile|g --- bin/portzap | 4 ++-- libexec/portzap/commands/portzap-install | 12 ++++++------ libexec/portzap/utils/install/update-changed-files | 4 ++-- libexec/portzap/utils/install/update-deleted-files | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/portzap b/bin/portzap index 8c447fa..d93c919 100755 --- a/bin/portzap +++ b/bin/portzap @@ -9,7 +9,7 @@ gitdir="/home/_portzap/ports" giturl="${PORTZAP_CLONEURL:-https://git.hardenedbsd.org/hardenedbsd/ports.git}" installdir="${PORTZAP_INSTALLDIR:-/usr/ports}" defaultbranch="hardenedbsd/main" -revfile="${installdir}"/.portzap +commitfile="${installdir}"/.portzap ## # functions @@ -71,7 +71,7 @@ case $1 in ;; "install") require_dependency git doas - "${libexec}"/commands/portzap-install "${gitdir}" "${installdir}" "${revfile}" + "${libexec}"/commands/portzap-install "${gitdir}" "${installdir}" "${commitfile}" ;; *) printf "Usage: portzap COMMAND [OPTIONS]\n" diff --git a/libexec/portzap/commands/portzap-install b/libexec/portzap/commands/portzap-install index 2b31a5e..a6a0aa1 100755 --- a/libexec/portzap/commands/portzap-install +++ b/libexec/portzap/commands/portzap-install @@ -9,7 +9,7 @@ git="${libexec}"/utils/git/run mask=$("${libexec}"/utils/get-umask) repodir=$1 installdir=$2 -revfile=$3 +commitfile=$3 ## # functions @@ -24,13 +24,13 @@ if [ "$(id -u)" != "0" ]; then fi cd "${repodir}" -if [ -e "${revfile}" ]; then +if [ -e "${commitfile}" ]; then ## # install update - rev=$(cat "${revfile}") + commit=$(cat "${commitfile}") "${libexec}"/utils/install/run -d "${installdir}" - "${libexec}"/utils/install/update-deleted-files "${repodir}" "${installdir}" "${rev}" - "${libexec}"/utils/install/update-changed-files "${repodir}" "${installdir}" "${rev}" + "${libexec}"/utils/install/update-deleted-files "${repodir}" "${installdir}" "${commit}" + "${libexec}"/utils/install/update-changed-files "${repodir}" "${installdir}" "${commit}" else ## # install from scratch @@ -52,5 +52,5 @@ else -exec cp -Rpv {} "${installdir}" \; chown -Rv root "${installdir}" fi -"${git}" rev-parse HEAD > "${revfile}" +"${git}" rev-parse HEAD > "${commitfile}" printok "install complete" diff --git a/libexec/portzap/utils/install/update-changed-files b/libexec/portzap/utils/install/update-changed-files index e31cfe2..af8554b 100755 --- a/libexec/portzap/utils/install/update-changed-files +++ b/libexec/portzap/utils/install/update-changed-files @@ -7,12 +7,12 @@ localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)} libexec="${localbase}"/libexec/portzap repodir=$1 installdir=$2 -rev=$3 +commit=$3 ## # main cd "${repodir}" -files=$("${libexec}"/utils/git/get-changed-files "${repodir}" "${rev}") +files=$("${libexec}"/utils/git/get-changed-files "${repodir}" "${commit}") for file in ${files}; do target="${installdir}/${file}" parent=$(dirname "${target}") diff --git a/libexec/portzap/utils/install/update-deleted-files b/libexec/portzap/utils/install/update-deleted-files index b5e60a9..2afecef 100755 --- a/libexec/portzap/utils/install/update-deleted-files +++ b/libexec/portzap/utils/install/update-deleted-files @@ -7,12 +7,12 @@ localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)} libexec="${localbase}"/libexec/portzap repodir=$1 installdir=$2 -rev=$3 +commit=$3 ## # main cd "${repodir}" -files=$("${libexec}"/utils/git/get-removed-files "${repodir}" "${rev}") +files=$("${libexec}"/utils/git/get-removed-files "${repodir}" "${commit}") for file in ${files}; do target="${installdir}"/"${file}" parent=$(dirname "${target}")