Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison sbin/fpkg @ 146:0e140f349924
- Provide a "vv" command on the host and in all running compatible jails: pkg -vv
- Provide a "config <name>" command on the host and in all running compatible jails: pkg -vv
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 31 Oct 2019 09:02:30 +0100 |
| parents | 6be3742d21f7 |
| children | c85245833476 |
comparison
equal
deleted
inserted
replaced
| 145:c4e9099a3d3e | 146:0e140f349924 |
|---|---|
| 47 check-fast-track | 47 check-fast-track |
| 48 Check packages installed from the LocalBSDPorts repository against | 48 Check packages installed from the LocalBSDPorts repository against |
| 49 the repositories `FreeBSD` and `LocalBSDPorts` on the local host | 49 the repositories `FreeBSD` and `LocalBSDPorts` on the local host |
| 50 and all visible jails | 50 and all visible jails |
| 51 | 51 |
| 52 config <name> | |
| 53 | |
| 54 Retrieve the valud of a given configuration opeion on the local host | |
| 55 and all running visible jails | |
| 56 | |
| 57 vv | |
| 58 | |
| 59 `pkg -vv` on the local host and all running visible jails | |
| 60 | |
| 52 ENVIRONMENT: | 61 ENVIRONMENT: |
| 53 | 62 |
| 54 FPKG_AUDIT_FLAGS | 63 FPKG_AUDIT_FLAGS |
| 55 Additional flags given to `pkg audit` | 64 Additional flags given to `pkg audit` |
| 56 (Default: -Fr) | 65 (Default: -Fr) |
| 226 echo " ${_name}" | 235 echo " ${_name}" |
| 227 printf " %s-15s : %s\n" "${LOCALBSDPORTS_REPO}" "$(pkg -j ${_j} version -U -r ${LOCALBSDPORTS_REPO} -n ${_name} -v)" | 236 printf " %s-15s : %s\n" "${LOCALBSDPORTS_REPO}" "$(pkg -j ${_j} version -U -r ${LOCALBSDPORTS_REPO} -n ${_name} -v)" |
| 228 printf " %-15s : %s\n" "${FREEBSD_REPO}" "$(pkg -j ${_j} version -U -r ${FREEBSD_REPO} -n ${_name} -v)" | 237 printf " %-15s : %s\n" "${FREEBSD_REPO}" "$(pkg -j ${_j} version -U -r ${FREEBSD_REPO} -n ${_name} -v)" |
| 229 fi | 238 fi |
| 230 done | 239 done |
| 240 else | |
| 241 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland" | |
| 242 fi | |
| 243 done | |
| 244 } | |
| 245 | |
| 246 | |
| 247 command_config() { | |
| 248 : 'The `pkg config name` command on the host and all running | |
| 249 compatible jails | |
| 250 | |
| 251 Args: | |
| 252 _name: the configuration option to retrieve to | |
| 253 | |
| 254 ' | |
| 255 local _name | |
| 256 | |
| 257 _name="$1" | |
| 258 | |
| 259 if [ -z "${_name}" ]; then | |
| 260 echo "Usage: fpkg config <name>" >&2 | |
| 261 return 1 | |
| 262 fi | |
| 263 echo "${FPKG_SIGN}LOCALHOST" | |
| 264 pkg config "${_name}" | |
| 265 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do | |
| 266 echo "" | |
| 267 echo "${FPKG_SIGN}JAIL: ${_j}" | |
| 268 if has_same_userland_version "${_j}"; then | |
| 269 # This prints the value on the *host* also | |
| 270 #pkg -j "${_j}" config "${_name}" | |
| 271 jexec "${_j}" pkg config "${_name}" | |
| 272 else | |
| 273 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland" | |
| 274 fi | |
| 275 done | |
| 276 } | |
| 277 | |
| 278 | |
| 279 command_vv() { | |
| 280 : 'The `pkv -vv` command on the host and all running compatible jails | |
| 281 | |
| 282 ' | |
| 283 echo "${FPKG_SIGN}LOCALHOST" | |
| 284 pkg -vv | |
| 285 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do | |
| 286 echo "" | |
| 287 echo "${FPKG_SIGN}JAIL: ${_j}" | |
| 288 if has_same_userland_version "${_j}"; then | |
| 289 pkg -j "${_j}" -vv | |
| 231 else | 290 else |
| 232 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland" | 291 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland" |
| 233 fi | 292 fi |
| 234 done | 293 done |
| 235 } | 294 } |
| 284 command_check_upgrade "$@" | 343 command_check_upgrade "$@" |
| 285 ;; | 344 ;; |
| 286 check-fast-track|check-fasttrack|check_fast_track|check_fasttrack) | 345 check-fast-track|check-fasttrack|check_fast_track|check_fasttrack) |
| 287 command_check_fasttrack "$@" | 346 command_check_fasttrack "$@" |
| 288 ;; | 347 ;; |
| 348 config) | |
| 349 command_config "$@" | |
| 350 ;; | |
| 351 vv) | |
| 352 command_vv "$@" | |
| 353 ;; | |
| 289 *) | 354 *) |
| 290 echo "ERROR: unknown command \`${command}'" >&2 | 355 echo "ERROR: unknown command \`${command}'" >&2 |
| 291 exit 2; | 356 exit 2; |
| 292 ;; | 357 ;; |
| 293 esac | 358 esac |
