Rename variables in bin/portzap

This commit is contained in:
0x1eef 2023-01-20 23:39:47 -03:00
parent 987208af22
commit f76410856c

View file

@ -5,8 +5,8 @@
## ##
# Configuration # Configuration
source_url="https://git.hardenedbsd.org/hardenedbsd/ports.git" source_url="https://git.hardenedbsd.org/hardenedbsd/ports.git"
transient_dir="/home/_portzap/ports" portzap_dir="/home/_portzap/ports"
rest_dir="/usr/ports/" ports_dir="/usr/ports/"
libexec_dir=$(realpath $(dirname $0)/../libexec/portzap/) libexec_dir=$(realpath $(dirname $0)/../libexec/portzap/)
## ##
@ -66,14 +66,14 @@ init() {
clone() { clone() {
if has_portzap_access; if has_portzap_access;
then then
if [ -e "$transient_dir/.git" ]; if [ -e "$portzap_dir/.git" ];
then then
echo "$transient_dir has already been cloned." echo "$portzap_dir has already been cloned."
echo "Run 'portzap pull' instead." echo "Run 'portzap pull' instead."
exit 1 exit 1
fi fi
umask $clone_mask umask $clone_mask
git clone --depth 1 $source_url $transient_dir git clone --depth 1 $source_url $portzap_dir
else else
echo "Permission denied." echo "Permission denied."
fi fi
@ -82,10 +82,10 @@ clone() {
pull() { pull() {
if has_portzap_access; if has_portzap_access;
then then
if [ -e "$transient_dir/.git" ]; if [ -e "$portzap_dir/.git" ];
then then
umask $pull_mask umask $pull_mask
cd $transient_dir cd $portzap_dir
git pull --rebase origin hardenedbsd/main git pull --rebase origin hardenedbsd/main
else else
echo "Run 'portzap clone' first." echo "Run 'portzap clone' first."
@ -103,8 +103,8 @@ install() {
echo "The install command should be run as root." echo "The install command should be run as root."
exit 1 exit 1
fi fi
cd $transient_dir cd $portzap_dir
find . -maxdepth 1 -type d -exec $libexec_dir/install-directory {} $rest_dir $libexec_dir \; find . -maxdepth 1 -type d -exec $libexec_dir/install-directory {} $ports_dir $libexec_dir \;
} }
case $1 in case $1 in