Skip to content

Commit

Permalink
Use of version_lt function instead of less than (eclipse-che#5141)
Browse files Browse the repository at this point in the history
less_than is not working with for example “5.9.1” and “5.10.0”, 5.9.0 being said to be a greater version

bash-4.3# version_lt "5.9.0" "5.10.1"
—> 0

bash-4.3# less_than "5.9.0" "5.10.1"
—> 1

bash-4.3# less_than "5.6" "5.8"
—> 0

Change-Id: I33417f012c193416bfb746df125c19e92a868b4e
note: version_lt is a less and equals method, so we need to exclude the condition : tag == base version
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
  • Loading branch information
benoitf committed May 19, 2017
1 parent 062e0b7 commit 63b440a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dockerfiles/base/scripts/base/startup_04_pre_cli_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ compare_versions() {
TAG=$(echo $VERSION_LIST_JSON | jq ".results[$COUNTER].name")
TAG=${TAG//\"}

if [ "$TAG" != "nightly" ] && [ "$TAG" != "latest" ]; then
if less_than $BASE_VERSION $TAG; then
if [ "$TAG" != "nightly" ] && [ "$TAG" != "latest" ] && [ "$TAG" != "${BASE_VERSION}" ]; then
if version_lt $BASE_VERSION $TAG; then
RETURN_VERSION=$TAG
break;
fi
Expand Down

0 comments on commit 63b440a

Please sign in to comment.