__nextcloud: completly respect --install-only parameter

This commit changes the manifest to do not check for too low versions
and does not download and unpack a tarball if available if the parameter
--install-only is set. This should make it useable now.

Also, a short message change to match the manual.
This commit is contained in:
matze 2020-10-24 15:39:54 +02:00
parent ea58f98ecb
commit b6f4da7692
2 changed files with 21 additions and 15 deletions

View file

@ -187,7 +187,7 @@ if [ -s "$__object/files/conf-cmds" ]; then
printf "SU\n" printf "SU\n"
# print a message # print a message
echo config >> "$__messages_out" echo configured >> "$__messages_out"
fi fi

View file

@ -94,27 +94,33 @@ nextcloud_uri="https://download.nextcloud.com/server/releases/nextcloud-${versio
nextcloud_sum="${nextcloud_uri}.sha256" nextcloud_sum="${nextcloud_uri}.sha256"
# Only check if there is a current installation # Check if there is a current installation. It depends where the upstream
# tarball should be unpacked (directly or moved in a later stage).
if [ "$version_is" ]; then if [ "$version_is" ]; then
# Block downgrades as there are may caused from the automatic upgrader # Only set and check the version if a upgrade is allowed.
# if the current version is higher than the version that should be installed # if this block will be skipped, no upgrade will be done
if version_ge "$version_is" "$version_should"; then if ! [ -f "$__object/parameter/install-only" ]; then
# it's an error if the current version is higher than the one that should be installed # Block downgrades as there are may caused from the automatic upgrader
printf "The current nextcloud version '%s' is higher than the version that should be installed (%s)\n" \ # if the current version is higher than the version that should be installed
"$version_is" "$version_should" >&2 if version_ge "$version_is" "$version_should"; then
printf "Please bump the nextcloud version to '%s' or higher!\n" "$version_is" >&2 # it's an error if the current version is higher than the one that should be installed
exit 2 printf "The current nextcloud version '%s' is higher than the version that should be installed (%s)\n" \
fi "$version_is" "$version_should" >&2
printf "Please bump the nextcloud version to '%s' or higher!\n" "$version_is" >&2
exit 2
fi
# Set destination to a temporary directory # Set destination to a temporary directory
destination="$webroot/.$__object_id" destination="$webroot/.$__object_id"
fi
else else
# Set destination to the real destination # Set destination to the real destination
destination="$webroot/$__object_id" destination="$webroot/$__object_id"
fi fi
# Upgrade the nextcloud version # Install/Upgrade the nextcloud version if there is a destination set.
if [ "$version_is" != "$version_should" ]; then # it checks if it is necessary and intended to upgrade
if [ "$destination" ] && [ "$version_is" != "$version_should" ]; then
updatedir="$( dirname "$installdir" )" updatedir="$( dirname "$installdir" )"
# Be sure the parent directory exists for installation # Be sure the parent directory exists for installation