Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate sbin/fpkg @ 685:918932936c68
fpkg: handle some shellcheck issues
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 01 Oct 2024 14:25:34 +0200 |
| parents | 205f88bcedc1 |
| children | bda643a6310e |
| 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 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
37 update |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
38 |
|
319
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
39 `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
|
40 compatible jails |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
41 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
42 upgrade |
|
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 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
|
45 compatible jails |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
46 |
|
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
|
47 check-upgrade |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
48 upgrade-check |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
49 |
|
319
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
50 `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
|
51 compatible jails |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
52 |
|
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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 |
|
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
|
58 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
|
59 |
| 320 | 60 Retrieve the value of a given configuration option on the local host |
| 61 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
|
62 |
|
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
|
63 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
|
64 |
|
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 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
|
66 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
|
67 |
|
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
|
68 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
|
69 |
|
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
|
70 `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
|
71 |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
72 ENVIRONMENT: |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
73 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
74 FPKG_AUDIT_FLAGS |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
75 Additional flags given to `pkg audit` |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
76 (Default: -Fr) |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
77 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
78 FPKG_UPDATE_FLAGS |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
79 Additional flags given to `pkg update` |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
80 (Default: empty) |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
81 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
82 FPKG_UPGRADE_FLAGS |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
83 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
|
84 (Default: empty) |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
85 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
86 FPKG_SIGN |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
87 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
|
88 (Default: "===> ") |
|
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
89 |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
90 FPKG_SKIPSIGN |
| 98 | 91 Marker for the begin of a skipped output group |
| 92 (Default: "----> ") | |
| 93 | |
|
91
fffee187f1f7
Docu: effective environment variables
Franz Glasner <fzglas.hg@dom66.de>
parents:
90
diff
changeset
|
94 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
|
95 |
|
2ba574bd8ded
fpkg: Enhance fpkg's help message
Franz Glasner <fzglas.hg@dom66.de>
parents:
318
diff
changeset
|
96 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
|
97 as the host'"'"'s. |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
98 ' |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
99 |
|
109
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 # Configuration directory |
|
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
102 # |
|
685
918932936c68
fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents:
684
diff
changeset
|
103 : ${CONFIGDIR:="@@ETCDIR@@"} |
|
109
0bd594fb56f8
Read the tools.conf configuration file where appropriate
Franz Glasner <fzglas.hg@dom66.de>
parents:
107
diff
changeset
|
104 |
|
685
918932936c68
fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents:
684
diff
changeset
|
105 # shellcheck disable=SC1091 # not following... |
|
918932936c68
fpkg: handle some shellcheck issues
Franz Glasner <fzglas.hg@dom66.de>
parents:
684
diff
changeset
|
106 [ -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
|
107 |
|
680
a63e689d0529
fpkg: For default variable values: use "=" instead of ":="
Franz Glasner <fzglas.hg@dom66.de>
parents:
643
diff
changeset
|
108 : ${FPKG_AUDIT_FLAGS="-Fr"} |
|
a63e689d0529
fpkg: For default variable values: use "=" instead of ":="
Franz Glasner <fzglas.hg@dom66.de>
parents:
643
diff
changeset
|
109 : ${FPKG_UPDATE_FLAGS=} |
|
a63e689d0529
fpkg: For default variable values: use "=" instead of ":="
Franz Glasner <fzglas.hg@dom66.de>
parents:
643
diff
changeset
|
110 : ${FPKG_UPGRADE_FLAGS=} |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
111 : ${FPKG_SIGN:='===> '} |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
112 : ${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
|
113 |
|
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
|
114 # |
|
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 # 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
|
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 : ${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
|
118 |
|
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 # 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
|
121 # 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
|
122 # 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
|
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 : ${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
|
125 |
|
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
|
126 |
|
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 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
|
128 : '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
|
129 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
|
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 Args: |
| 451 | 132 _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
|
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 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
|
135 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
|
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 ' |
|
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 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
|
139 |
|
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="$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 |
|
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 _host_version=$(/bin/freebsd-version -u) || exit 1 |
|
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
|
143 _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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 } |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
149 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
150 |
|
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
|
151 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
|
152 : ' 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
|
153 |
|
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 ' |
|
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 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
|
156 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
|
157 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
|
158 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
|
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 |
|
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 |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
162 command_audit() { |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
163 : '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
|
164 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
165 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
166 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
167 pkg audit ${FPKG_AUDIT_FLAGS} |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
168 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
|
169 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
170 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
|
171 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
|
172 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
|
173 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
174 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
|
175 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
176 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
177 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
178 |
|
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 command_update() { |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
181 : '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
|
182 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
183 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
184 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
185 pkg update ${FPKG_UPDATE_FLAGS} |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
186 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
|
187 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
188 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
|
189 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
|
190 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
|
191 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
192 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
|
193 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
194 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
195 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
196 |
|
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 command_upgrade() { |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
199 : '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
|
200 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
201 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
202 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
203 pkg upgrade ${FPKG_UPGRADE_FLAGS} |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
204 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
|
205 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
206 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
|
207 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
|
208 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
|
209 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
210 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
|
211 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
212 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
213 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
214 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
215 |
|
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
|
216 command_check_upgrade() { |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
217 : '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
|
218 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
219 ' |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
220 echo "${FPKG_SIGN}LOCALHOST" |
|
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
221 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
|
222 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
|
223 echo "" |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
224 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
|
225 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
|
226 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
|
227 else |
|
107
f8642efe05a1
Renamed (environment/configuration) variables to have a FPKG_ prefix.
Franz Glasner <fzglas.hg@dom66.de>
parents:
99
diff
changeset
|
228 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
|
229 fi |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
230 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
231 } |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
232 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
233 |
|
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
|
234 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
|
235 : '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
|
236 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
|
237 |
|
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 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
|
239 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
|
240 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
|
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 ' |
|
681
7655c501d4f3
fpkg: FIX: invalid "local" declaration
Franz Glasner <fzglas.hg@dom66.de>
parents:
680
diff
changeset
|
243 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
|
244 |
|
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 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
|
246 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
|
247 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
|
248 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
|
249 echo " ${_name}" |
|
684
205f88bcedc1
fpkg: FIX: Quoting in $(...) constructs
Franz Glasner <fzglas.hg@dom66.de>
parents:
683
diff
changeset
|
250 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
|
251 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
|
252 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
|
253 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
|
254 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
|
255 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
|
256 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
|
257 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
|
258 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
|
259 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
|
260 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
|
261 echo " ${_name}" |
|
684
205f88bcedc1
fpkg: FIX: Quoting in $(...) constructs
Franz Glasner <fzglas.hg@dom66.de>
parents:
683
diff
changeset
|
262 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
|
263 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
|
264 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
|
265 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
|
266 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
|
267 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
|
268 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
|
269 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
|
270 } |
|
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 |
|
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 |
|
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
|
273 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
|
274 : '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
|
275 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
|
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 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
|
278 _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
|
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 ' |
|
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 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
|
282 |
|
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="$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
|
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 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
|
286 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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 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
|
294 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
|
295 # 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
|
296 #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
|
297 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
|
298 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
|
299 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
|
300 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
|
301 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
|
302 } |
|
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 |
|
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 command_vv() { |
|
318
58ad548487c4
Typo in comment: "pkv" -> "pkg"
Franz Glasner <fzglas.hg@dom66.de>
parents:
169
diff
changeset
|
306 : '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
|
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 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
|
310 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
|
311 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
|
312 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
|
313 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
|
314 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
|
315 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
|
316 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
|
317 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
|
318 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
|
319 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
|
320 } |
|
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 |
|
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 |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
323 # |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
324 # Global option handling |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
325 # |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
326 while getopts "Vh" _opt ; do |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
327 case ${_opt} in |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
328 V) |
|
386
84d2735fe7f6
Simplified version tagging a lot: it is also faster now.
Franz Glasner <fzglas.hg@dom66.de>
parents:
320
diff
changeset
|
329 printf 'fpkg %s\n' '@@SIMPLEVERSIONSTR@@' |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
330 exit 0 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
331 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
332 h) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
333 echo "${USAGE}" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
334 exit 0 |
|
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 exit 2; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
338 ;; |
|
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 echo "ERROR: option handling failed" >&2 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
341 exit 2 |
|
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 esac |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
344 done |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
345 |
|
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 # 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
|
348 # command-local options. |
|
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 shift $((OPTIND-1)) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
351 OPTIND=1 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
352 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
353 command="$1" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
354 shift |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
355 |
|
90
aefad9391470
Extra error message if not command is given
Franz Glasner <fzglas.hg@dom66.de>
parents:
88
diff
changeset
|
356 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
|
357 |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
358 case "${command}" in |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
359 audit) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
360 command_audit "$@" |
|
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 update) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
363 command_update "$@" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
364 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
365 upgrade) |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
366 command_upgrade "$@" |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
367 ;; |
|
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
|
368 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
|
369 command_check_upgrade "$@" |
|
88
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
370 ;; |
|
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
|
371 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
|
372 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
|
373 ;; |
|
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
|
374 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
|
375 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
|
376 ;; |
|
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
|
377 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
|
378 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
|
379 ;; |
|
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
|
380 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
|
381 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
|
382 ;; |
|
88
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 echo "ERROR: unknown command \`${command}'" >&2 |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
385 exit 2; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
386 ;; |
|
76ddab9ab965
Add a tool for host and jail "pkg" management
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
387 esac |
