Merge pull request #64 from nupplaphil/bug/58-version_greater

Bugfixing version_greater() method
This commit is contained in:
Hypolite Petovan 2019-06-16 09:35:51 -04:00 committed by GitHub
commit 25f988edbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 51 additions and 10 deletions

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea/

View File

@ -52,6 +52,11 @@ jobs:
script:
- ./generate-stackbrew-library.sh
- <<: *test-scripts
env: SCRIPT=test-entrypoint.sh
script:
- ./.travis/test-entrypoint.sh
- stage: test images (amd64)
env: VERSION=2019.04 VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=2019.04 VARIANT=fpm ARCH=amd64

35
.travis/test-entrypoint.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
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" ]
}
if ! version_greater "2019.06" "2019.06-rc"; then
exit 1;
fi
if ! version_greater "2019.06" "2019.04-rc"; then
exit 1;
fi
if version_greater "2019.06-rc" "2019.06"; then
exit 1;
fi
if version_greater "2019.04" "2019.06"; then
exit 1;
fi
if ! version_greater "2019.06" "2019.04"; then
exit 1;
fi
if ! version_greater "2019.07" "2019.06-rc"; then
exit 1;
fi
if version_greater "2019.05" "2019.06-rc"; then
exit 1;
fi
if version_greater "2019.05-dev" "2019.05"; then
exit 1;
fi
if ! version_greater "2019.05" "2019.05-dev"; then
exit 1;
fi

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)

View File

@ -12,7 +12,7 @@ run_as() {
# checks if the the first parameter is greater than the second parameter
version_greater() {
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 | head -n 1)" != "$1" ]
[ "$(printf '%s\n' "$@" | sort -r -t '-' -k2,2 | sort -t '.' -n -k1,1 -k2,2 -s | head -n 1)" != "$1" ]
}
# clones the whole develop branch (Friendica and Addons)