Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
changeset 693:3633a41b862b
fpkg: Use modern documentation: "#:" instead of ': ...'.
While there: fix some documented behaviour: some command run in all
running jails (not only in compatible jails).
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 01 Oct 2024 16:16:28 +0200 |
| parents | d1cb22ba641d |
| children | 1ea88da082e2 |
| files | docs/man/man8/fpkg.rst sbin/fpkg |
| diffstat | 2 files changed, 75 insertions(+), 73 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/man/man8/fpkg.rst Tue Oct 01 16:01:44 2024 +0200 +++ b/docs/man/man8/fpkg.rst Tue Oct 01 16:16:28 2024 +0200 @@ -76,12 +76,12 @@ :manpage:`fpkg-uversion(8)` Call :command:`freebsd-version -u` on the local host and all - running visible and compatible jails. + running visible jails. :manpage:`fpkg-vv(8)` Call :command:`pkg -vv` on the local host and all running visible - and compatible jails. + jails. Environment
--- a/sbin/fpkg Tue Oct 01 16:01:44 2024 +0200 +++ b/sbin/fpkg Tue Oct 01 16:16:28 2024 +0200 @@ -1,18 +1,19 @@ #!/bin/sh # -*- indent-tabs-mode: nil; -*- -: 'A pkg frontend for common operations that also operates in all -running jails. +#: +#: A pkg frontend for common operations that also operates in all +#: running jails. +#: +#: :Author: Franz Glasner +#: :Copyright: (c) 2019-2024 Franz Glasner. +#: All rights reserved. +#: :License: BSD 3-Clause "New" or "Revised" License. +#: See LICENSE for details. +#: If you cannot find LICENSE see +#: <https://opensource.org/licenses/BSD-3-Clause> +#: :ID: @(#)@@SIMPLEVERSIONTAG@@ +#: -:Author: Franz Glasner -:Copyright: (c) 2019-2024 Franz Glasner. - All rights reserved. -:License: BSD 3-Clause "New" or "Revised" License. - See LICENSE for details. - If you cannot find LICENSE see - <https://opensource.org/licenses/BSD-3-Clause> -:ID: @(#)@@SIMPLEVERSIONTAG@@ - -' # shellcheck disable=SC2034 # VERSION appears unused VERSION='@@VERSION@@' @@ -63,12 +64,12 @@ config <name> Retrieve the value of a given configuration option on the local host - and all running visible and compatible jails + and all running visible jails uversion Call `freebsd-version -u` on the local host and all running visible - and compatible jails + jails vv @@ -102,9 +103,9 @@ as the host'"'"'s. ' -# -# Configuration directory -# +#: +#: Configuration directory +#: : ${CONFIGDIR:="@@ETCDIR@@"} # shellcheck disable=SC1091 # not following... @@ -116,30 +117,29 @@ : ${FPKG_SIGN:='===> '} : ${FPKG_SKIPSIGN:='----> '} -# -# The official FreeBSD binary repository -# +#: +#: The official FreeBSD binary repository +#: : ${FREEBSD_REPO:=FreeBSD} -# -# Local repository with ports with default OPTIONS (i.e. unchanged) -# but newer than the packages in the "FreeBSD" repository. -# Some sort of a fast-track repository. -# +#: +#: Local repository with ports with default OPTIONS (i.e. unchanged) +#: but newer than the packages in the "FreeBSD" repository. +#: Some sort of a fast-track repository. +#: : ${LOCALBSDPORTS_REPO:=LocalBSDPorts} +#: Check whether the jail `_jail` has the same FreeBSD userland version +#: as the host the the current process runs. +#: +#: Args: +#: $1 (str): the running jail (name or jail id) to check for +#: +#: Returns: +#: int: 0 (truthy) if the userland versions match, 1 (falsy) otherwise +#: has_same_userland_version() { - : 'Check whether the jail `_jail` has the same FreeBSD userland version - as the host the the current process runs. - - Args: - _jail: the running jail (name or jail id) to check for - - Returns: - 0 if the userland versions match, 1 otherwise - - ' local _jail _host_version _jail_version _jail="$1" @@ -153,10 +153,10 @@ } +#: +#: Do a local `freebsd-version -u` and also for all running jails +#: command_uversion() { - : ' Do a local `freebsd-version -u` and also for all running jails - - ' local _jail _OLDIFS printf 'LOCALHOST: %s\n' "$(/bin/freebsd-version -u)" @@ -169,10 +169,10 @@ } +#: +#: Do a local `pkg audit -Fr` and also for all running jails +#: command_audit() { - : 'Do a local `pkg audit -Fr` and also for all running jails - - ' local _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}" @@ -191,10 +191,10 @@ } +#: +#: Do a local `pkg update` and also for all running jails +#: command_update() { - : 'Do a local `pkg update` and also for all running jails - - ' local _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}" @@ -213,10 +213,10 @@ } +#: +#: Do a local `pkg upgrade` and also for all running jails +#: command_upgrade() { - : 'Do a local `pkg upgrade` and also for all running jails - - ' local _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}" @@ -235,10 +235,10 @@ } +#: +#: Do a local `pkg upgrade -n` and also for all running jails +#: command_check_upgrade() { - : 'Do a local `pkg upgrade -n` and also for all running jails - - ' local _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}" @@ -257,15 +257,15 @@ } +#: +#: Check the fast-track repository versions against the canonical +#: FreeBSD repository versions. +#: +#: Input (Globals): +#: FREEBSD_REPO: the (canonical) FreeBSD repository name +#: LOCALBSDPORTS_REPO: the fast-track repository name +#: command_check_fasttrack() { - : 'Check the fast-track repository versions against the canonical - FreeBSD repository versions. - - Input (Globals): - FREEBSD_REPO: the (canonical) FreeBSD repository name - LOCALBSDPORTS_REPO: the fast-track repository name - - ' local _name _repo _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}" @@ -298,13 +298,16 @@ } +#: +#: The `pkg config name` command on the host and all running jails +#: +#: Args: +#: $1 (str): the configuration option to retrieve to +#: +#: Output (stdout): +#: The value of the configuration option +#: command_config() { - : 'The `pkg config name` command on the host and all running jails - - Args: - _name: the configuration option to retrieve to - - ' local _name _j _OLDIFS _name="$1" @@ -328,10 +331,10 @@ } +#: +#: The `pkg -vv` command on the host and all running compatible jails +#: command_vv() { - : 'The `pkg -vv` command on the host and all running compatible jails - - ' local _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}" @@ -349,11 +352,10 @@ IFS="$_OLDIFS" } - +#: +#: Call `etcupdate status` on the host and all running jails +#: command_etcupdate_status() { - : 'Call `etcupdate status` on the host and all running jails - - ' local _j _OLDIFS printf '%sLOCALHOST\n' "${FPKG_SIGN}"
