5b570ad5a0
This allows determining whether it's OK to use particular configuration variables that will throw errors when used in older versions.
12 lines
399 B
Nix
12 lines
399 B
Nix
{ dovecot, gawk, gnused, jq, runCommand }:
|
|
|
|
runCommand "dovecot-version" {
|
|
buildInputs = [dovecot gnused jq];
|
|
} ''
|
|
jq -n \
|
|
--arg dovecot_version "$(dovecot --version |
|
|
sed 's/\([0-9.]*\).*/\1/' |
|
|
awk -F '.' '{ print $1"."$2"."$3 }')" \
|
|
'[$dovecot_version | split("."), ["major", "minor", "patch"]]
|
|
| transpose | map( { (.[1]): .[0] | tonumber }) | add' > $out
|
|
''
|