0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-20 02:46:10 +02:00

Remove extra function

Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
This commit is contained in:
Antonin Delpeuch 2023-07-08 08:00:57 +02:00
parent 33024932b7
commit 892c8edfcc

View file

@ -6,11 +6,6 @@ version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
} }
# version_too_far_apart A B returns whether the major version of A is more than that of B + 1
version_too_far_apart() {
[ ${majorImage%%.*} -gt $((${majorInstalled%%.*} + 1)) ]
}
# return true if specified directory is empty # return true if specified directory is empty
directory_empty() { directory_empty() {
[ -z "$(ls -A "$1/")" ] [ -z "$(ls -A "$1/")" ]
@ -162,7 +157,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if version_greater "$image_version" "$installed_version"; then if version_greater "$image_version" "$installed_version"; then
echo "Initializing nextcloud $image_version ..." echo "Initializing nextcloud $image_version ..."
if [ "$installed_version" != "0.0.0.0" ]; then if [ "$installed_version" != "0.0.0.0" ]; then
if version_too_far_apart "$image_version" "$installed_version"; then if [ ${majorImage%%.*} -gt $((${majorInstalled%%.*} + 1)) ]; then
echo "Can't start Nextcloud because upgrading from $installed_version to $image_version is not supported." echo "Can't start Nextcloud because upgrading from $installed_version to $image_version is not supported."
echo "It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16." echo "It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16."
exit 1 exit 1