diff --git a/README.md b/README.md index 61149e9..96478b5 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ update. ## Usage +**Commands** + * __portzap clone__
Clones the ports tree into `/home/_portzap/ports/`. @@ -19,6 +21,12 @@ update. * __portzap install__
Installs `/home/_portzap/ports/` into `/usr/ports/`.
+**Environment variables** + +* __$PORTZAP_PORTS_URL__ + The URL of a git repository.
+ Defaults to https://git.hardenedbsd.org/hardenedbsd/ports.git. + ## Install portzap can be installed through git, or via a port.
diff --git a/bin/portzap b/bin/portzap index a6d6d30..439ad4f 100755 --- a/bin/portzap +++ b/bin/portzap @@ -1,8 +1,9 @@ #!/bin/sh + # Variables 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/" portzap_file="$ports_dir/.portzap" portzap_dir="/home/_portzap/ports" diff --git a/man/man1/portzap.1 b/man/man1/portzap.1 index 0e6ffae..164c5c5 100644 --- a/man/man1/portzap.1 +++ b/man/man1/portzap.1 @@ -1,47 +1,54 @@ -.TH PORTZAP 1 "May 2023" "portzap 0.5.8" "User Commands" - -.SH NAME -portzap - stay up to date with the HardenedBSD ports tree - -.SH SYNOPSIS -.B portzap clone -.br -.B portzap pull -.br -.B portzap install - -.SH DESCRIPTION -portzap is a utility designed to allow unprivileged users +.Dd May 2023 +.Dt PORTZAP 1 +.Os +.Sh NAME +.Nm portzap +.Nd manage the HardenedBSD ports tree +.Sh SYNOPSIS +.Nm portzap clone +.Nm portzap pull +.Nm portzap install +.Sh DESCRIPTION +The +.Nm portzap +utility is designed to allow unprivileged users who are members of the .B _portzap group to create and update a transient copy of the ports tree, which can then be installed into the -.B /usr/ports/ +.Pa /usr/ports directory by root. - -.SH EXAMPLES - -.TP -.B portzap clone +.Sh EXAMPLES +The following examples demonstrate the usage of +.Nm portzap +utility: +.Pp +.Nm portzap clone +.br Clones the ports tree into -.B /home/_portzap/ports/. - -.TP -.B portzap pull +.Pa /home/_portzap/ports . +.Pp +.Nm portzap pull +.br Pulls updates into -.B /home/_portzap/ports/. - -.TP -.B portzap install +.Pa /home/_portzap/ports . +.Pp +.Nm portzap install +.br Installs -.B /home/_portzap/ports/ +.Pa /home/_portzap/ports into -.B /usr/ports/. - -.SH AUTHORS - +.Pa /usr/ports . +.Sh ENVIRONMENT VARIABLES +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 -.B portzap +.Nm portzap utility and this manual page were written by -0x1eef <0x1eef@protonmail.com> +0x1eef <0x1eef@protonmail.com> .