-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1971 from nextcloud/devel
[hotfix] library.sh: Fix resolution of target nextcloud version if requesting older version than current
- Loading branch information
Showing
3 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
fail() { | ||
echo "$@" | ||
exit 1 | ||
} | ||
|
||
#shellcheck source=./library.sh | ||
. "$(dirname "$0")/library.sh" ||: | ||
|
||
|
||
case=1 | ||
|
||
current=27.0.1 | ||
supported=27.0.8 | ||
requested="" | ||
|
||
expected=27.1.11 | ||
|
||
actual="$(determine_nc_update_version "$current" "$supported" "$requested")" | ||
|
||
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)" | ||
|
||
|
||
case=2 | ||
|
||
# TODO: Set to 26.0.1 | ||
current=26.0.13 | ||
supported=27.0.8 | ||
requested="" | ||
|
||
expected=27.1.11 | ||
|
||
actual="$(determine_nc_update_version "$current" "$supported" "$requested")" | ||
|
||
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)" | ||
|
||
|
||
case=3 | ||
|
||
current=26.0.1 | ||
supported=27.0.8 | ||
requested="27.1.3" | ||
|
||
expected=27.1.3 | ||
|
||
actual="$(determine_nc_update_version "$current" "$supported" "$requested")" | ||
|
||
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)" | ||
|
||
|
||
case=4 | ||
|
||
current=29.0.5 | ||
supported=27.0.8 | ||
requested="" | ||
|
||
expected=29.0.6 | ||
|
||
actual="$(determine_nc_update_version "$current" "$supported" "$requested")" | ||
|
||
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)" | ||
|
||
|
||
case=5 | ||
|
||
current=29.0.5 | ||
supported=27.0.8 | ||
requested="27.0.8" | ||
|
||
expected="29.0.5" | ||
|
||
actual="$(determine_nc_update_version "$current" "$supported" "$requested")" | ||
|
||
[[ "$expected" == "$actual" ]] || fail "C$case: unexpected nc target version: $actual (expected: $expected)" |