annotate sbin/fpkg @ 690:b9194bec5504

fpkg: FIX: quoting in "has_same_userland_version()"
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 01 Oct 2024 15:10:14 +0200
parents 3e96fc952c45
children d1cb22ba641d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
1 #!/bin/sh
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
2 # -*- indent-tabs-mode: nil; -*-
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
3 : 'A pkg frontend for common operations that also operates in all
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
4 running jails.
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
5
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
6 :Author: Franz Glasner
438
9c3b1966ba91 Extend copyright to 2024
Franz Glasner <fzglas.hg@dom66.de>
parents: 386
diff changeset
7 :Copyright: (c) 2019-2024 Franz Glasner.
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
8 All rights reserved.
99
7a064049405f Use the "Full name" in the license section
Franz Glasner <fzglas.hg@dom66.de>
parents: 98
diff changeset
9 :License: BSD 3-Clause "New" or "Revised" License.
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
10 See LICENSE for details.
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
11 If you cannot find LICENSE see
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
12 <https://opensource.org/licenses/BSD-3-Clause>
386
84d2735fe7f6 Simplified version tagging a lot: it is also faster now.
Franz Glasner <fzglas.hg@dom66.de>
parents: 320
diff changeset
13 :ID: @(#)@@SIMPLEVERSIONTAG@@
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
14
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
15 '
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
16
643
4f2257ea7d0a shellcheck: disable SC2034: VERSION appears unused...
Franz Glasner <fzglas.hg@dom66.de>
parents: 550
diff changeset
17 # shellcheck disable=SC2034 # VERSION appears unused
550
847ae246f3cc Make the port really DATADIR and EXAMPLESDIR safe because the user may redefine DATADIR and EXAMPLESDIR.
Franz Glasner <fzglas.hg@dom66.de>
parents: 452
diff changeset
18 VERSION='@@VERSION@@'
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
19
685
918932936c68 fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents: 684
diff changeset
20 # shellcheck disable=SC2016 # no expansion
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
21 USAGE='
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
22 USAGE: fpkg [ OPTIONS] COMMAND [ COMMAND-OPTIONS ]
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
23
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
24 OPTIONS:
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
25
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
26 -V Print the program name and version number to stdout and exit
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
27
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
28 -h Print this help message to stdout and exit
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
29
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
30 COMMANDS:
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
31
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
32 audit
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
33
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
34 `pkg audit` on the local host and all running visible and
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
35 compatible jails
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
36
686
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
37 etcupdate-status
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
38
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
39 Call `etcupdate status` on the local host and in all running visible
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
40 jails
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
41
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
42 update
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
43
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
44 `pkg update` on the local host and all running visible and
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
45 compatible jails
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
46
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
47 upgrade
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
48
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
49 `pkg upgrade` on the local host and all running visible and
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
50 compatible jails
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
51
129
4aeff9d5275d The command upgrade-check ist now check-upgrade and aliased to the old spelling also
Franz Glasner <fzglas.hg@dom66.de>
parents: 128
diff changeset
52 check-upgrade
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
53 upgrade-check
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
54
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
55 `pkg upgrade -n` on the local host and all running visible and
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
56 compatible jails
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
57
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
58 check-fast-track
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
59 Check packages installed from the LocalBSDPorts repository against
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
60 the repositories `FreeBSD` and `LocalBSDPorts` on the local host
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
61 and all visible and compatible jails
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
62
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
63 config <name>
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
64
320
8675e1b7950c Typo in comment
Franz Glasner <fzglas.hg@dom66.de>
parents: 319
diff changeset
65 Retrieve the value of a given configuration option on the local host
8675e1b7950c Typo in comment
Franz Glasner <fzglas.hg@dom66.de>
parents: 319
diff changeset
66 and all running visible and compatible jails
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
67
169
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
68 uversion
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
69
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
70 Call `freebsd-version -u` on the local host and all running visible
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
71 and compatible jails
169
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
72
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
73 vv
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
74
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
75 `pkg -vv` on the local host and all running visible jails
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
76
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
77 ENVIRONMENT:
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
78
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
79 FPKG_AUDIT_FLAGS
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
80 Additional flags given to `pkg audit`
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
81 (Default: -Fr)
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
82
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
83 FPKG_UPDATE_FLAGS
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
84 Additional flags given to `pkg update`
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
85 (Default: empty)
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
86
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
87 FPKG_UPGRADE_FLAGS
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
88 Additional flags given to `pkg upgrade` and `pkg upgrade -n`
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
89 (Default: empty)
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
90
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
91 FPKG_SIGN
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
92 Marker for the begin of an output group (local host or jail)
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
93 (Default: "===> ")
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
94
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
95 FPKG_SKIPSIGN
98
0dd831416b0e Document `SKIPSIGN'
Franz Glasner <fzglas.hg@dom66.de>
parents: 97
diff changeset
96 Marker for the begin of a skipped output group
0dd831416b0e Document `SKIPSIGN'
Franz Glasner <fzglas.hg@dom66.de>
parents: 97
diff changeset
97 (Default: "----> ")
0dd831416b0e Document `SKIPSIGN'
Franz Glasner <fzglas.hg@dom66.de>
parents: 97
diff changeset
98
91
fffee187f1f7 Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents: 90
diff changeset
99 All other environment variables that affect `pkg` are effective also.
319
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
100
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
101 A "compatible jail" is a jail that'"'"'s "freebsd-version -u" is the same
2ba574bd8ded fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents: 318
diff changeset
102 as the host'"'"'s.
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
103 '
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
104
109
0bd594fb56f8 Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
105 #
0bd594fb56f8 Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
106 # Configuration directory
0bd594fb56f8 Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
107 #
685
918932936c68 fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents: 684
diff changeset
108 : ${CONFIGDIR:="@@ETCDIR@@"}
109
0bd594fb56f8 Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
109
685
918932936c68 fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents: 684
diff changeset
110 # shellcheck disable=SC1091 # not following...
918932936c68 fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents: 684
diff changeset
111 [ -r "${CONFIGDIR}/pkgtools.conf" ] && . "${CONFIGDIR}/pkgtools.conf"
109
0bd594fb56f8 Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
112
680
a63e689d0529 fpkg: For default variable values: use "=" instead of ":="
Franz Glasner <fzglas.hg@dom66.de>
parents: 643
diff changeset
113 : ${FPKG_AUDIT_FLAGS="-Fr"}
a63e689d0529 fpkg: For default variable values: use "=" instead of ":="
Franz Glasner <fzglas.hg@dom66.de>
parents: 643
diff changeset
114 : ${FPKG_UPDATE_FLAGS=}
a63e689d0529 fpkg: For default variable values: use "=" instead of ":="
Franz Glasner <fzglas.hg@dom66.de>
parents: 643
diff changeset
115 : ${FPKG_UPGRADE_FLAGS=}
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
116 : ${FPKG_SIGN:='===> '}
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
117 : ${FPKG_SKIPSIGN:='----> '}
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
118
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
119 #
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
120 # The official FreeBSD binary repository
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
121 #
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
122 : ${FREEBSD_REPO:=FreeBSD}
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
123
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
124 #
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
125 # Local repository with ports with default OPTIONS (i.e. unchanged)
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
126 # but newer than the packages in the "FreeBSD" repository.
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
127 # Some sort of a fast-track repository.
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
128 #
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
129 : ${LOCALBSDPORTS_REPO:=LocalBSDPorts}
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
130
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
131
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
132 has_same_userland_version() {
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
133 : 'Check whether the jail `_jail` has the same FreeBSD userland version
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
134 as the host the the current process runs.
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
135
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
136 Args:
451
Franz Glasner <fzglas.hg@dom66.de>
parents: 438
diff changeset
137 _jail: the running jail (name or jail id) to check for
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
138
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
139 Returns:
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
140 0 if the userland versions match, 1 otherwise
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
141
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
142 '
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
143 local _jail _host_version _jail_version
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
144
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
145 _jail="$1"
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
146
690
b9194bec5504 fpkg: FIX: quoting in "has_same_userland_version()"
Franz Glasner <fzglas.hg@dom66.de>
parents: 688
diff changeset
147 _host_version="$(/bin/freebsd-version -u)" || exit 1
b9194bec5504 fpkg: FIX: quoting in "has_same_userland_version()"
Franz Glasner <fzglas.hg@dom66.de>
parents: 688
diff changeset
148 _jail_version="$(jexec -l -- "${_jail}" /bin/freebsd-version -u)" || exit 1
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
149 if [ "${_host_version%%-*}" = "${_jail_version%%-*}" ]; then
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
150 return 0
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
151 fi
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
152 return 1
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
153 }
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
154
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
155
169
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
156 command_uversion() {
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
157 : ' Do a local `freebsd-version -u` and also for all running jails
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
158
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
159 '
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
160 echo "LOCALHOST: $(/bin/freebsd-version -u)"
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
161 for _jail in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
452
d5591ebc303d Use "--" for jexec and chroot to accept more unconvenient jail names and/or directories
Franz Glasner <fzglas.hg@dom66.de>
parents: 451
diff changeset
162 echo "${_jail}: $(jexec -l -- "${_jail}" /bin/freebsd-version -u)"
169
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
163 done
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
164 }
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
165
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
166
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
167 command_audit() {
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
168 : 'Do a local `pkg audit -Fr` and also for all running jails
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
169
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
170 '
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
171 echo "${FPKG_SIGN}LOCALHOST"
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
172 pkg audit ${FPKG_AUDIT_FLAGS}
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
173 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
174 echo ""
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
175 echo "${FPKG_SIGN}JAIL: ${_j}"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
176 if has_same_userland_version "${_j}"; then
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
177 pkg -j "${_j}" audit ${FPKG_AUDIT_FLAGS}
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
178 else
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
179 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
180 fi
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
181 done
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
182 }
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
183
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
184
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
185 command_update() {
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
186 : 'Do a local `pkg update` and also for all running jails
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
187
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
188 '
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
189 echo "${FPKG_SIGN}LOCALHOST"
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
190 pkg update ${FPKG_UPDATE_FLAGS}
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
191 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
192 echo ""
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
193 echo "${FPKG_SIGN}JAIL: ${_j}"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
194 if has_same_userland_version "${_j}"; then
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
195 pkg -j "${_j}" update ${FPKG_UPDATE_FLAGS}
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
196 else
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
197 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
198 fi
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
199 done
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
200 }
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
201
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
202
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
203 command_upgrade() {
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
204 : 'Do a local `pkg upgrade` and also for all running jails
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
205
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
206 '
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
207 echo "${FPKG_SIGN}LOCALHOST"
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
208 pkg upgrade ${FPKG_UPGRADE_FLAGS}
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
209 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
210 echo ""
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
211 echo "${FPKG_SIGN}JAIL: ${_j}"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
212 if has_same_userland_version "${_j}"; then
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
213 pkg -j "${_j}" upgrade ${FPKG_UPGRADE_FLAGS}
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
214 else
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
215 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
216 fi
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
217 done
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
218 }
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
219
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
220
129
4aeff9d5275d The command upgrade-check ist now check-upgrade and aliased to the old spelling also
Franz Glasner <fzglas.hg@dom66.de>
parents: 128
diff changeset
221 command_check_upgrade() {
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
222 : 'Do a local `pkg upgrade -n` and also for all running jails
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
223
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
224 '
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
225 echo "${FPKG_SIGN}LOCALHOST"
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
226 pkg upgrade -n ${FPKG_UPGRADE_FLAGS}
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
227 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
228 echo ""
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
229 echo "${FPKG_SIGN}JAIL: ${_j}"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
230 if has_same_userland_version "${_j}"; then
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
231 pkg -j "${_j}" upgrade -n ${FPKG_UPGRADE_FLAGS}
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
232 else
107
f8642efe05a1 Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents: 99
diff changeset
233 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
95
e8c422379abb Do package checks only for jails with compatible (i.e. "equal") userland versions with the host
Franz Glasner <fzglas.hg@dom66.de>
parents: 93
diff changeset
234 fi
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
235 done
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
236 }
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
237
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
238
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
239 command_check_fasttrack() {
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
240 : 'Check the fast-track repository versions against the canonical
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
241 FreeBSD repository versions.
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
242
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
243 Input (Globals):
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
244 FREEBSD_REPO: the (canonical) FreeBSD repository name
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
245 LOCALBSDPORTS_REPO: the fast-track repository name
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
246
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
247 '
681
7655c501d4f3 fpkg: FIX: invalid "local" declaration
Franz Glasner <fzglas.hg@dom66.de>
parents: 680
diff changeset
248 local _name _repo _j
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
249
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
250 echo "${FPKG_SIGN}LOCALHOST"
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
251 pkg query '%n %R' |
683
cb9f2d675cf8 fpkg: FIX: Use "read -r" instead of a plain "read"
Franz Glasner <fzglas.hg@dom66.de>
parents: 682
diff changeset
252 while read -r _name _repo; do
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
253 if [ "${_repo}" = "${LOCALBSDPORTS_REPO}" ]; then
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
254 echo " ${_name}"
684
205f88bcedc1 fpkg: FIX: Quoting in $(...) constructs
Franz Glasner <fzglas.hg@dom66.de>
parents: 683
diff changeset
255 printf ' %-15s : %s\n' "${LOCALBSDPORTS_REPO}" "$(pkg version -U -r "${LOCALBSDPORTS_REPO}" -n "${_name}" -v)"
205f88bcedc1 fpkg: FIX: Quoting in $(...) constructs
Franz Glasner <fzglas.hg@dom66.de>
parents: 683
diff changeset
256 printf ' %-15s : %s\n' "${FREEBSD_REPO}" "$(pkg version -U -r "${FREEBSD_REPO}" -n "${_name}" -v)"
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
257 fi
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
258 done
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
259 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
260 echo ""
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
261 echo "${FPKG_SIGN}JAIL: ${_j}"
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
262 if has_same_userland_version "${_j}"; then
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
263 pkg -j "${_j}" query '%n %R' |
683
cb9f2d675cf8 fpkg: FIX: Use "read -r" instead of a plain "read"
Franz Glasner <fzglas.hg@dom66.de>
parents: 682
diff changeset
264 while read -r _name _repo; do
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
265 if [ "${_repo}" = "${LOCALBSDPORTS_REPO}" ]; then
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
266 echo " ${_name}"
684
205f88bcedc1 fpkg: FIX: Quoting in $(...) constructs
Franz Glasner <fzglas.hg@dom66.de>
parents: 683
diff changeset
267 printf ' %s-15s : %s\n' "${LOCALBSDPORTS_REPO}" "$(pkg -j "${_j}" version -U -r "${LOCALBSDPORTS_REPO}" -n "${_name}" -v)"
205f88bcedc1 fpkg: FIX: Quoting in $(...) constructs
Franz Glasner <fzglas.hg@dom66.de>
parents: 683
diff changeset
268 printf ' %-15s : %s\n' "${FREEBSD_REPO}" "$(pkg -j "${_j}" version -U -r "${FREEBSD_REPO}" -n "${_name}" -v)"
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
269 fi
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
270 done
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
271 else
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
272 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
273 fi
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
274 done
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
275 }
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
276
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
277
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
278 command_config() {
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
279 : 'The `pkg config name` command on the host and all running
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
280 compatible jails
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
281
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
282 Args:
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
283 _name: the configuration option to retrieve to
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
284
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
285 '
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
286 local _name
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
287
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
288 _name="$1"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
289
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
290 if [ -z "${_name}" ]; then
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
291 echo "Usage: fpkg config <name>" >&2
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
292 return 1
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
293 fi
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
294 echo "${FPKG_SIGN}LOCALHOST"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
295 pkg config "${_name}"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
296 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
297 echo ""
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
298 echo "${FPKG_SIGN}JAIL: ${_j}"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
299 if has_same_userland_version "${_j}"; then
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
300 # This prints the value on the *host* also
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
301 #pkg -j "${_j}" config "${_name}"
452
d5591ebc303d Use "--" for jexec and chroot to accept more unconvenient jail names and/or directories
Franz Glasner <fzglas.hg@dom66.de>
parents: 451
diff changeset
302 jexec -- "${_j}" pkg config "${_name}"
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
303 else
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
304 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
305 fi
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
306 done
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
307 }
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
308
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
309
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
310 command_vv() {
318
58ad548487c4 Typo in comment: "pkv" -> "pkg"
Franz Glasner <fzglas.hg@dom66.de>
parents: 169
diff changeset
311 : 'The `pkg -vv` command on the host and all running compatible jails
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
312
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
313 '
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
314 echo "${FPKG_SIGN}LOCALHOST"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
315 pkg -vv
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
316 for _j in $(jls -N | awk '{if(NR>1)print $1}' | sort); do
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
317 echo ""
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
318 echo "${FPKG_SIGN}JAIL: ${_j}"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
319 if has_same_userland_version "${_j}"; then
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
320 pkg -j "${_j}" -vv
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
321 else
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
322 echo "${FPKG_SKIPSIGN}SKIPPED because of different userland"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
323 fi
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
324 done
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
325 }
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
326
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
327
686
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
328 command_etcupdate_status() {
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
329 : 'Call `etcupdate status` on the host and all running jails
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
330
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
331 '
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
332 local _j _OLDIFS
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
333
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
334 printf '%sLOCALHOST\n' "${FPKG_SIGN}"
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
335 /usr/sbin/etcupdate status
688
3e96fc952c45 fpkg: Allow spaces in jail names for "fpkg etcupdate-status"
Franz Glasner <fzglas.hg@dom66.de>
parents: 686
diff changeset
336 _OLDIFS="$IFS"
686
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
337 IFS=$'\n'
688
3e96fc952c45 fpkg: Allow spaces in jail names for "fpkg etcupdate-status"
Franz Glasner <fzglas.hg@dom66.de>
parents: 686
diff changeset
338 for _j in $(/usr/sbin/jls name | LC_ALL=C.UTF-8 /usr/bin/sort); do
686
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
339 printf '\n%sJAIL: %s\n' "${FPKG_SIGN}" "${_j}"
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
340 LC_ALL=C.UTF-8 /usr/sbin/jexec -- "${_j}" /usr/sbin/etcupdate status
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
341 done
688
3e96fc952c45 fpkg: Allow spaces in jail names for "fpkg etcupdate-status"
Franz Glasner <fzglas.hg@dom66.de>
parents: 686
diff changeset
342 IFS="$_OLDIFS"
686
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
343 }
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
344
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
345
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
346 #
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
347 # Global option handling
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
348 #
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
349 while getopts "Vh" _opt ; do
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
350 case ${_opt} in
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
351 V)
386
84d2735fe7f6 Simplified version tagging a lot: it is also faster now.
Franz Glasner <fzglas.hg@dom66.de>
parents: 320
diff changeset
352 printf 'fpkg %s\n' '@@SIMPLEVERSIONSTR@@'
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
353 exit 0
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
354 ;;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
355 h)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
356 echo "${USAGE}"
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
357 exit 0
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
358 ;;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
359 \?)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
360 exit 2;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
361 ;;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
362 *)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
363 echo "ERROR: option handling failed" >&2
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
364 exit 2
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
365 ;;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
366 esac
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
367 done
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
368
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
369 #
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
370 # Reset the Shell's option handling system to prepare for handling
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
371 # command-local options.
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
372 #
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
373 shift $((OPTIND-1))
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
374 OPTIND=1
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
375
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
376 command="$1"
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
377 shift
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
378
90
aefad9391470 Extra error message if not command is given
Franz Glasner <fzglas.hg@dom66.de>
parents: 88
diff changeset
379 test -n "$command" || { echo "ERROR: no command given" >&2; exit 2; }
aefad9391470 Extra error message if not command is given
Franz Glasner <fzglas.hg@dom66.de>
parents: 88
diff changeset
380
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
381 case "${command}" in
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
382 audit)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
383 command_audit "$@"
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
384 ;;
686
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
385 etcupdate-status|etcupdate_status|status-etcupdate|status_etcupdate)
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
386 command_etcupdate_status "$@"
bda643a6310e fpkg: Implement the "etcupdate-status" command
Franz Glasner <fzglas.hg@dom66.de>
parents: 685
diff changeset
387 ;;
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
388 update)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
389 command_update "$@"
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
390 ;;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
391 upgrade)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
392 command_upgrade "$@"
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
393 ;;
129
4aeff9d5275d The command upgrade-check ist now check-upgrade and aliased to the old spelling also
Franz Glasner <fzglas.hg@dom66.de>
parents: 128
diff changeset
394 check-upgrade|check_upgrade|upgrade-check|upgrade_check)
4aeff9d5275d The command upgrade-check ist now check-upgrade and aliased to the old spelling also
Franz Glasner <fzglas.hg@dom66.de>
parents: 128
diff changeset
395 command_check_upgrade "$@"
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
396 ;;
112
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
397 check-fast-track|check-fasttrack|check_fast_track|check_fasttrack)
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
398 command_check_fasttrack "$@"
0838fdca3a2b Implemented the check-fast-track command to check installed packages that are installed from LocalBSDPorts against FreeBSD and LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents: 109
diff changeset
399 ;;
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
400 config)
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
401 command_config "$@"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
402 ;;
169
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
403 uversion)
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
404 command_uversion "$@"
cc4117f5f4bd Implemented an "uversion" command: get the userspace FreeBSD-version of the host and all runnings jails
Franz Glasner <fzglas.hg@dom66.de>
parents: 168
diff changeset
405 ;;
146
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
406 vv)
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
407 command_vv "$@"
0e140f349924 - Provide a "vv" command on the host and in all running compatible jails: pkg -vv
Franz Glasner <fzglas.hg@dom66.de>
parents: 144
diff changeset
408 ;;
88
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
409 *)
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
410 echo "ERROR: unknown command \`${command}'" >&2
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
411 exit 2;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
412 ;;
76ddab9ab965 Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff changeset
413 esac