diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2020-05-22 20:10:43 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2020-05-27 20:20:57 +0100 |
commit | c54b9d619157d9a24e72f04d5698a00ee9a368dd (patch) | |
tree | 86fabd815e75bc59356120a88b9970bbc718cc0b /eclass/kernel-2.eclass | |
parent | sci-mathematics/psmt2-frontend: ignore CFLAGS warning (diff) | |
download | gentoo-c54b9d619157d9a24e72f04d5698a00ee9a368dd.tar.gz gentoo-c54b9d619157d9a24e72f04d5698a00ee9a368dd.tar.bz2 gentoo-c54b9d619157d9a24e72f04d5698a00ee9a368dd.zip |
kernel-2.eclass: avoid lexicographical compare on versions, bug #705246
Originally found in bug #705240 as:
```
if [[ ... || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.28 ]]; then
```
'>' are string comparisons. They are benign so far, but
will start failing on linux-10 :)
Let's be consistent and use version comparison.
Closes: https://bugs.gentoo.org/705246
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/kernel-2.eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 07af8d8ab2c5..930bcf22e29e 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1015,7 +1015,7 @@ postinst_sources() { # K_SECURITY_UNSUPPORTED=deblob # if we are to forcably symlink, delete it if it already exists first. - if [[ ${K_SYMLINK} > 0 ]]; then + if [[ ${K_SYMLINK} -gt 0 ]]; then [[ -h ${EROOT}usr/src/linux ]] && { rm "${EROOT}"usr/src/linux || die; } MAKELINK=1 fi @@ -1078,7 +1078,7 @@ postinst_sources() { KV_PATCH=$(ver_cut 3 ${OKV}) if [[ "$(tc-arch)" = "sparc" ]]; then if [[ $(gcc-major-version) -lt 4 && $(gcc-minor-version) -lt 4 ]]; then - if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] ; then + if [[ ${KV_MAJOR} -ge 3 ]] || ver_test ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} -gt 2.6.24 ; then echo elog "NOTE: Since 2.6.25 the kernel Makefile has changed in a way that" elog "you now need to do" @@ -1272,7 +1272,7 @@ unipatch() { # do not apply fbcondecor patch to sparc/sparc64 as it breaks boot # bug #272676 if [[ "$(tc-arch)" = "sparc" || "$(tc-arch)" = "sparc64" ]]; then - if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.28 ]]; then + if [[ ${KV_MAJOR} -ge 3 ]] || ver_test ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} -gt 2.6.28 ; then if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then UNIPATCH_DROP="${UNIPATCH_DROP} *_fbcondecor*.patch" echo @@ -1521,7 +1521,7 @@ kernel-2_src_unpack() { # fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox # only do this for kernel < 2.6.27 since this file does not exist in later # kernels - if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] ; then + if [[ -n ${KV_MINOR} ]] && ver_test ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} -lt 2.6.27 ; then sed -i \ -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \ "${S}"/arch/ppc/Makefile |