2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-11-05 14:31:53 +01:00

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)