# HG changeset patch # User Franz Glasner # Date 1572508950 -3600 # Node ID 0e140f349924504ebf9cf12145913cade51cbca3 # Parent c4e9099a3d3ea958d3d56aea9d90af975f7ef5d2 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv - Provide a "config " command on the host and in all running compatible jails: pkg -vv diff -r c4e9099a3d3e -r 0e140f349924 sbin/fpkg --- a/sbin/fpkg Wed Oct 30 21:13:00 2019 +0100 +++ b/sbin/fpkg Thu Oct 31 09:02:30 2019 +0100 @@ -49,6 +49,15 @@ the repositories `FreeBSD` and `LocalBSDPorts` on the local host and all visible jails + config + + Retrieve the valud of a given configuration opeion on the local host + and all running visible jails + + vv + + `pkg -vv` on the local host and all running visible jails + ENVIRONMENT: FPKG_AUDIT_FLAGS @@ -235,6 +244,56 @@ } +command_config() { + : 'The `pkg config name` command on the host and all running + compatible jails + + Args: + _name: the configuration option to retrieve to + + ' + local _name + + _name="$1" + + if [ -z "${_name}" ]; then + echo "Usage: fpkg config " >&2 + return 1 + fi + echo "${FPKG_SIGN}LOCALHOST" + pkg config "${_name}" + for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do + echo "" + echo "${FPKG_SIGN}JAIL: ${_j}" + if has_same_userland_version "${_j}"; then + # This prints the value on the *host* also + #pkg -j "${_j}" config "${_name}" + jexec "${_j}" pkg config "${_name}" + else + echo "${FPKG_SKIPSIGN}SKIPPED because of different userland" + fi + done +} + + +command_vv() { + : 'The `pkv -vv` command on the host and all running compatible jails + + ' + echo "${FPKG_SIGN}LOCALHOST" + pkg -vv + for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do + echo "" + echo "${FPKG_SIGN}JAIL: ${_j}" + if has_same_userland_version "${_j}"; then + pkg -j "${_j}" -vv + else + echo "${FPKG_SKIPSIGN}SKIPPED because of different userland" + fi + done +} + + # # Global option handling # @@ -286,6 +345,12 @@ check-fast-track|check-fasttrack|check_fast_track|check_fasttrack) command_check_fasttrack "$@" ;; + config) + command_config "$@" + ;; + vv) + command_vv "$@" + ;; *) echo "ERROR: unknown command \`${command}'" >&2 exit 2;