Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate sbin/fpkg @ 438:9c3b1966ba91
Extend copyright to 2024
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 01 May 2024 21:35:43 +0200 |
| parents | 84d2735fe7f6 |
| children | e7eba671bd74 |
| 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 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
17 VERSION="@@VERSION@@" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
18 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
19 USAGE=' |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
20 USAGE: fpkg [ OPTIONS] COMMAND [ COMMAND-OPTIONS ] |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
21 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
22 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 -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
|
25 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
26 -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
|
27 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
28 COMMANDS: |
|
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 audit |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
31 |
|
319
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
32 `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
|
33 compatible jails |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
34 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
35 update |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
36 |
|
319
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
37 `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
|
38 compatible jails |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
39 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
40 upgrade |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
41 |
|
319
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
42 `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
|
43 compatible jails |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
44 |
|
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
|
45 check-upgrade |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
46 upgrade-check |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
47 |
|
319
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
48 `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
|
49 compatible jails |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
50 |
|
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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 |
|
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
|
56 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
|
57 |
| 320 | 58 Retrieve the value of a given configuration option on the local host |
| 59 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
|
60 |
|
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
|
61 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
|
62 |
|
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
|
63 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
|
64 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
|
65 |
|
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
|
66 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
|
67 |
|
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
|
68 `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
|
69 |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
70 ENVIRONMENT: |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
71 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
72 FPKG_AUDIT_FLAGS |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
73 Additional flags given to `pkg audit` |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
74 (Default: -Fr) |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
75 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
76 FPKG_UPDATE_FLAGS |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
77 Additional flags given to `pkg update` |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
78 (Default: empty) |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
79 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
80 FPKG_UPGRADE_FLAGS |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
81 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
|
82 (Default: empty) |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
83 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
84 FPKG_SIGN |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
85 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
|
86 (Default: "===> ") |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
87 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
88 FPKG_SKIPSIGN |
| 98 | 89 Marker for the begin of a skipped output group |
| 90 (Default: "----> ") | |
| 91 | |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
92 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
|
93 |
|
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
94 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
|
95 as the host'"'"'s. |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
96 ' |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
97 |
|
109
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
98 # |
|
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
99 # Configuration directory |
|
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
100 # |
|
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
101 : ${CONFIGDIR:=@@ETCDIR@@} |
|
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
102 |
|
131
993fecdf2a70
Rename etc/tools.conf to etc/pkgtools.conf.
Franz Glasner <fzglas.hg@dom66.de>
parents:
129
diff
changeset
|
103 test -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
|
104 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
105 : ${FPKG_AUDIT_FLAGS:=-Fr} |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
106 : ${FPKG_UPDATE_FLAGS:=} |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
107 : ${FPKG_UPGRADE_FLAGS:=} |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
108 : ${FPKG_SIGN:='===> '} |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
109 : ${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
|
110 |
|
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
|
111 # |
|
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
|
112 # 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
|
113 # |
|
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
|
114 : ${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
|
115 |
|
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
|
116 # |
|
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
|
117 # 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
|
118 # 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
|
119 # 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
|
120 # |
|
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 : ${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
|
122 |
|
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
|
123 |
|
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
|
124 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
|
125 : '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
|
126 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
|
127 |
|
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
|
128 Args: |
|
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
|
129 _jail: the running jail to check for |
|
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
|
130 |
|
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 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
|
132 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
|
133 |
|
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 ' |
|
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 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
|
136 |
|
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
|
137 _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
|
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 _host_version=$(/bin/freebsd-version -u) || exit 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
|
140 _jail_version=$(jexec -l "${_jail}" /bin/freebsd-version -u) || exit 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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 } |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
146 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
147 |
|
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
|
148 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
|
149 : ' 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
|
150 |
|
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
|
151 ' |
|
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
|
152 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
|
153 for _jail in $(jls -N | awk '{if(NR>1)print $1}' | sort); do |
|
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
|
154 echo "${_jail}: $(jexec -l "${_jail}" /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
|
155 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
|
156 } |
|
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 |
|
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 |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
159 command_audit() { |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
160 : '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
|
161 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
162 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
163 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
164 pkg audit ${FPKG_AUDIT_FLAGS} |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
165 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
|
166 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
167 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
|
168 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
|
169 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
|
170 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
171 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
|
172 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
173 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
174 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
175 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
176 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
177 command_update() { |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
178 : '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
|
179 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
180 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
181 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
182 pkg update ${FPKG_UPDATE_FLAGS} |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
183 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
|
184 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
185 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
|
186 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
|
187 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
|
188 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
189 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
|
190 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
191 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
192 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
193 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
194 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
195 command_upgrade() { |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
196 : '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
|
197 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
198 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
199 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
200 pkg upgrade ${FPKG_UPGRADE_FLAGS} |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
201 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
|
202 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
203 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
|
204 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
|
205 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
|
206 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
207 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
|
208 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
209 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
210 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
211 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
212 |
|
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
|
213 command_check_upgrade() { |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
214 : '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
|
215 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
216 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
217 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
218 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
|
219 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
|
220 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
221 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
|
222 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
|
223 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
|
224 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
225 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
|
226 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
227 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
228 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
229 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
230 |
|
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
|
231 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
|
232 : '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
|
233 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
|
234 |
|
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
|
235 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
|
236 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
|
237 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
|
238 |
|
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 ' |
|
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 local _name local _repo _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
|
241 |
|
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 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
|
243 pkg query '%n %R' | |
|
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 while read _name _repo; 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
|
245 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
|
246 echo " ${_name}" |
|
113
2d531cbd0feb
Explicitely disable the automatic repo update (using "-U") in the fast-track check
Franz Glasner <fzglas.hg@dom66.de>
parents:
112
diff
changeset
|
247 printf " %-15s : %s\n" "${LOCALBSDPORTS_REPO}" "$(pkg version -U -r ${LOCALBSDPORTS_REPO} -n ${_name} -v)" |
|
2d531cbd0feb
Explicitely disable the automatic repo update (using "-U") in the fast-track check
Franz Glasner <fzglas.hg@dom66.de>
parents:
112
diff
changeset
|
248 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
|
249 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
|
250 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
|
251 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
|
252 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
|
253 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
|
254 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
|
255 pkg -j "${_j}" query '%n %R' | |
|
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
|
256 while read _name _repo; 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
|
257 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
|
258 echo " ${_name}" |
|
113
2d531cbd0feb
Explicitely disable the automatic repo update (using "-U") in the fast-track check
Franz Glasner <fzglas.hg@dom66.de>
parents:
112
diff
changeset
|
259 printf " %s-15s : %s\n" "${LOCALBSDPORTS_REPO}" "$(pkg -j ${_j} version -U -r ${LOCALBSDPORTS_REPO} -n ${_name} -v)" |
|
2d531cbd0feb
Explicitely disable the automatic repo update (using "-U") in the fast-track check
Franz Glasner <fzglas.hg@dom66.de>
parents:
112
diff
changeset
|
260 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
|
261 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
|
262 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
|
263 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
|
264 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
|
265 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
|
266 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
|
267 } |
|
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
|
268 |
|
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 |
|
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
|
270 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
|
271 : '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
|
272 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
|
273 |
|
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
|
274 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
|
275 _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
|
276 |
|
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
|
277 ' |
|
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 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
|
279 |
|
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 _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
|
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 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
|
283 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
|
284 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
|
285 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
|
286 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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 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
|
292 # 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
|
293 #pkg -j "${_j}" 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
|
294 jexec "${_j}" 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 } |
|
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 |
|
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 |
|
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
|
302 command_vv() { |
|
318
58ad548487c4
Typo in comment: "pkv" -> "pkg"
Franz Glasner <fzglas.hg@dom66.de>
parents:
169
diff
changeset
|
303 : '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
|
304 |
|
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 ' |
|
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 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 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
|
312 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
|
313 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
|
314 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
|
315 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
|
316 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
|
317 } |
|
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 |
|
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 |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
320 # |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
321 # Global option handling |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
322 # |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
323 while getopts "Vh" _opt ; do |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
324 case ${_opt} in |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
325 V) |
|
386
84d2735fe7f6
Simplified version tagging a lot: it is also faster now.
Franz Glasner <fzglas.hg@dom66.de>
parents:
320
diff
changeset
|
326 printf 'fpkg %s\n' '@@SIMPLEVERSIONSTR@@' |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
327 exit 0 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
328 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
329 h) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
330 echo "${USAGE}" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
331 exit 0 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
332 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
333 \?) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
334 exit 2; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
335 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
336 *) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
337 echo "ERROR: option handling failed" >&2 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
338 exit 2 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
339 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
340 esac |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
341 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
342 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
343 # |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
344 # 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
|
345 # command-local options. |
|
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 shift $((OPTIND-1)) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
348 OPTIND=1 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
349 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
350 command="$1" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
351 shift |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
352 |
|
90
aefad9391470
Extra error message if not command is given
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
353 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
|
354 |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
355 case "${command}" in |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
356 audit) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
357 command_audit "$@" |
|
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 update) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
360 command_update "$@" |
|
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 upgrade) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
363 command_upgrade "$@" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
364 ;; |
|
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
|
365 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
|
366 command_check_upgrade "$@" |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
367 ;; |
|
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
|
368 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
|
369 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
|
370 ;; |
|
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
|
371 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
|
372 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
|
373 ;; |
|
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
|
374 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
|
375 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
|
376 ;; |
|
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
|
377 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
|
378 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
|
379 ;; |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
380 *) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
381 echo "ERROR: unknown command \`${command}'" >&2 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
382 exit 2; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
383 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
384 esac |
