From cc3f43c0fc7122248a22d8c581d95f94e52116af Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Mon, 1 Apr 2024 11:02:16 -0300 Subject: [PATCH] Rename environment variables --- bin/portzap | 24 ++++++++++++------------ man/man8/portzap.8 | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/portzap b/bin/portzap index ee117f8..ed2360e 100755 --- a/bin/portzap +++ b/bin/portzap @@ -2,28 +2,28 @@ set -e # Variables -base_dir=$(dirname "$0") -ports_url="${PORTZAP_PORTS_URL:-https://git.hardenedbsd.org/hardenedbsd/ports.git}" -ports_dir="${PORTZAP_PORTS_DIR:-/usr/ports/}" -portzap_file="$ports_dir/.portzap" -portzap_dir="/home/_portzap/ports" -libexec_dir=$(realpath "$base_dir/../libexec/portzap/") +rootdir=$(dirname "$0") +giturl="${PORTZAP_GITURL:-https://git.hardenedbsd.org/hardenedbsd/ports.git}" +gitdir="/home/_portzap/ports" +installdir="${PORTZAP_INSTALLDIR:-/usr/ports/}" +revision="${installdir}/.portzap" +libexec=$(realpath "${rootdir}/../libexec/portzap/") # Masks clone_mask=007 pull_mask=007 # Functions -. "$libexec_dir/functions/portzap-install" -. "$libexec_dir/functions/portzap-pull" -. "$libexec_dir/functions/portzap-clone" -. "$libexec_dir/functions/requirements" +. "$libexec/functions/portzap-install" +. "$libexec/functions/portzap-pull" +. "$libexec/functions/portzap-clone" +. "$libexec/functions/requirements" case $1 in "clone") require_deps git require_group _portzap - portzap_clone "$portzap_dir" "$ports_url" "$clone_mask" + portzap_clone "$portzap_dir" "$giturl" "$clone_mask" ;; "pull") require_deps git @@ -33,7 +33,7 @@ case $1 in "install") require_root require_deps git - portzap_install "$ports_dir" "$portzap_dir" "$libexec_dir" "$portzap_file" + portzap_install "$installdir" "$portzap_dir" "$libexec" "$portzap_file" ;; *) echo "Usage: portzap clone|pull|install" diff --git a/man/man8/portzap.8 b/man/man8/portzap.8 index daea98b..976cdab 100644 --- a/man/man8/portzap.8 +++ b/man/man8/portzap.8 @@ -29,11 +29,11 @@ Pull updates into /home/_portzap/ports/. Install /home/_portzap/ports/ into /usr/ports/. .Sh ENVIRONMENT VARIABLES .Pp -.Bl -tag -width $PORTZAP_PORTS_URL -.It Ev PORTZAP_PORTS_URL +.Bl -tag -width $PORTZAP_GITURL +.It Ev PORTZAP_GITURL The URL to a git repository. Default: https://git.hardenedbsd.org/hardenedbsd/ports.git -.It Ev PORTZAP_PORTS_DIR +.It Ev PORTZAP_INSTALLDIR The directory where the ports collection will be installed. Default: /usr/ports/. .Sh AUTHORS The