mirror of
https://github.com/friendica/docker
synced 2024-12-29 12:52:11 +01:00
Fix version compare logic
This commit is contained in:
parent
34e0bd306e
commit
81b8476b4b
14 changed files with 30 additions and 14 deletions
|
@ -3,9 +3,10 @@ set -eu
|
|||
|
||||
# copy of see .docker-files/entrypoint.sh - testing all versions
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
|
||||
if ! version_greater "2019.06" "2019.06-rc"; then
|
||||
exit 1;
|
||||
fi
|
||||
|
@ -33,3 +34,18 @@ fi
|
|||
if ! version_greater "2019.05" "2019.05-dev"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.07-1" "2020.07"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.07-2" "2020.07-1"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.07-1" "2020.07-dev"; then
|
||||
exit 1;
|
||||
fi
|
||||
if ! version_greater "2020.09-rc" "2020.09-dev"; then
|
||||
exit 1
|
||||
fi
|
||||
if version_greater "2020.06-rc" "2020.09-dev"; then
|
||||
exit 1;
|
||||
fi
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
|
@ -13,7 +13,7 @@ run_as() {
|
|||
|
||||
# checks if the the first parameter is greater than the second parameter
|
||||
version_greater() {
|
||||
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
|
||||
[ "$(printf '%s\n' "$@" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/' | sort -t '.' -k1,1n -k2,2n -k3,3nbr | head -n 1)" != "$(printf "$1" | sed -e 's/-rc/.1/' | sed -e 's/-dev/.2/')" ]
|
||||
}
|
||||
|
||||
# usage: file_env VAR [DEFAULT]
|
||||
|
|
Loading…
Reference in a new issue