Add $PORTZAP_PORTS_URL

This change introduces an environment variable that can point to
an alternative git repository (eg GitHub) if the default is offline.
This commit is contained in:
0x1eef 2023-06-09 20:47:34 -03:00
parent fd7f51297c
commit bc5ddd2141
3 changed files with 52 additions and 36 deletions

View file

@ -10,6 +10,8 @@ update.
## Usage ## Usage
**Commands**
* __portzap clone__ <br> * __portzap clone__ <br>
Clones the ports tree into `/home/_portzap/ports/`. Clones the ports tree into `/home/_portzap/ports/`.
@ -19,6 +21,12 @@ update.
* __portzap install__ <br> * __portzap install__ <br>
Installs `/home/_portzap/ports/` into `/usr/ports/`. <br> Installs `/home/_portzap/ports/` into `/usr/ports/`. <br>
**Environment variables**
* __$PORTZAP_PORTS_URL__
The URL of a git repository. <br>
Defaults to https://git.hardenedbsd.org/hardenedbsd/ports.git.
## Install ## Install
portzap can be installed through git, or via a port. <br> portzap can be installed through git, or via a port. <br>

View file

@ -1,8 +1,9 @@
#!/bin/sh #!/bin/sh
# Variables # Variables
base_dir=$(dirname "$0") base_dir=$(dirname "$0")
ports_url="https://git.hardenedbsd.org/hardenedbsd/ports.git" ports_url="${PORTZAP_PORTS_URL:-https://git.hardenedbsd.org/hardenedbsd/ports.git}"
ports_dir="/usr/ports/" ports_dir="/usr/ports/"
portzap_file="$ports_dir/.portzap" portzap_file="$ports_dir/.portzap"
portzap_dir="/home/_portzap/ports" portzap_dir="/home/_portzap/ports"

View file

@ -1,47 +1,54 @@
.TH PORTZAP 1 "May 2023" "portzap 0.5.8" "User Commands" .Dd May 2023
.Dt PORTZAP 1
.SH NAME .Os
portzap - stay up to date with the HardenedBSD ports tree .Sh NAME
.Nm portzap
.SH SYNOPSIS .Nd manage the HardenedBSD ports tree
.B portzap clone .Sh SYNOPSIS
.br .Nm portzap clone
.B portzap pull .Nm portzap pull
.br .Nm portzap install
.B portzap install .Sh DESCRIPTION
The
.SH DESCRIPTION .Nm portzap
portzap is a utility designed to allow unprivileged users utility is designed to allow unprivileged users
who are members of the who are members of the
.B _portzap .B _portzap
group to create and update a group to create and update a
transient copy of the ports tree, which can then be installed transient copy of the ports tree, which can then be installed
into the into the
.B /usr/ports/ .Pa /usr/ports
directory by root. directory by root.
.Sh EXAMPLES
.SH EXAMPLES The following examples demonstrate the usage of
.Nm portzap
.TP utility:
.B portzap clone .Pp
.Nm portzap clone
.br
Clones the ports tree into Clones the ports tree into
.B /home/_portzap/ports/. .Pa /home/_portzap/ports .
.Pp
.TP .Nm portzap pull
.B portzap pull .br
Pulls updates into Pulls updates into
.B /home/_portzap/ports/. .Pa /home/_portzap/ports .
.Pp
.TP .Nm portzap install
.B portzap install .br
Installs Installs
.B /home/_portzap/ports/ .Pa /home/_portzap/ports
into into
.B /usr/ports/. .Pa /usr/ports .
.Sh ENVIRONMENT VARIABLES
.SH AUTHORS The following variables can be used:
.Pp
.Bl -tag -width $PORTZAP_PORTS_URL
.It Ev PORTZAP_PORTS_URL
The URL to a git repository.
Defaults to https://git.hardenedbsd.org/hardenedbsd/ports.git.
.Sh AUTHORS
The The
.B portzap .Nm portzap
utility and this manual page were written by utility and this manual page were written by
0x1eef <0x1eef@protonmail.com> 0x1eef <0x1eef@protonmail.com> .