mirror of https://github.com/Icinga/icinga2.git
ITL: apt: render vars.apt_[dist_]upgrade=true as --[dist-]upgrade, not --[dist-]upgrade=true
but preserve vars.apt_[dist_]upgrade=-s as --[dist-]upgrade=-s.
This commit is contained in:
parent
32c7f7730d
commit
e4c22e3973
|
@ -1923,20 +1923,43 @@ object CheckCommand "apt" {
|
||||||
command = [ PluginDir + "/check_apt" ]
|
command = [ PluginDir + "/check_apt" ]
|
||||||
|
|
||||||
arguments = {
|
arguments = {
|
||||||
"--extra-opts" = {
|
// apt-get takes only options starting with "-" (like "-sqq") before
|
||||||
value = "$apt_extra_opts$"
|
// the upgrade command, so passing e.g. "foobar" as "--upgrade=foobar"
|
||||||
description = "Read options from an ini file."
|
// makes no sense. This allows to easily decide between "-x=-y"
|
||||||
}
|
// (strings starting with "-") and "-x" (everything else).
|
||||||
"--upgrade" = {
|
"--upgrade" = {
|
||||||
value = "$apt_upgrade$"
|
set_if = {{
|
||||||
separator = "="
|
var v = macro("$apt_upgrade$")
|
||||||
|
return match("-*", string(v).trim()) ? false : v
|
||||||
|
}}
|
||||||
description = "[Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default."
|
description = "[Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default."
|
||||||
}
|
}
|
||||||
"--dist-upgrade" = {
|
"--dist-upgrade" = {
|
||||||
value = "$apt_dist_upgrade$"
|
set_if = {{
|
||||||
separator = "="
|
var v = macro("$apt_dist_upgrade$")
|
||||||
|
return match("-*", string(v).trim()) ? false : v
|
||||||
|
}}
|
||||||
description = "Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options."
|
description = "Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options."
|
||||||
}
|
}
|
||||||
|
"--upgrade=OPTS" = {
|
||||||
|
set_if = {{ match("-*", string(macro("$apt_upgrade$")).trim()) }}
|
||||||
|
key = "--upgrade"
|
||||||
|
separator = "="
|
||||||
|
value = "$apt_upgrade$"
|
||||||
|
description = "[Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default."
|
||||||
|
}
|
||||||
|
"--dist-upgrade=OPTS" = {
|
||||||
|
set_if = {{ match("-*", string(macro("$apt_dist_upgrade$")).trim()) }}
|
||||||
|
key = "--dist-upgrade"
|
||||||
|
separator = "="
|
||||||
|
value = "$apt_dist_upgrade$"
|
||||||
|
description = "Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options."
|
||||||
|
}
|
||||||
|
|
||||||
|
"--extra-opts" = {
|
||||||
|
value = "$apt_extra_opts$"
|
||||||
|
description = "Read options from an ini file."
|
||||||
|
}
|
||||||
"--include" = {
|
"--include" = {
|
||||||
value = "$apt_include$"
|
value = "$apt_include$"
|
||||||
description = "Include only packages matching REGEXP. Can be specified multiple times the values will be combined together."
|
description = "Include only packages matching REGEXP. Can be specified multiple times the values will be combined together."
|
||||||
|
|
Loading…
Reference in New Issue