Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 23 May 2020 22:59:17
Message-Id: 1590274744.aa1d259decdfd73a49e0c49e88a8ec5675453266.slyfox@gentoo
1 commit: aa1d259decdfd73a49e0c49e88a8ec5675453266
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 22 18:53:44 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sat May 23 22:59:04 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa1d259d
7
8 linux-info.eclass: avoid lexicographical compare on numbers, bug #705248
9
10 Originally found in bug #705240 as:
11
12 ```
13 error=0
14 ...
15 if [[ ${error} > 0 ]]; then
16 ...
17 ```
18
19 '>' are string comparisons. They are benign in this case, but let's
20 be consistent and use integer comparison.
21
22 Closes: https://bugs.gentoo.org/705248
23 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
24
25 eclass/linux-info.eclass | 6 +++---
26 1 file changed, 3 insertions(+), 3 deletions(-)
27
28 diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
29 index 44eebcf52a9..405ef5571e1 100644
30 --- a/eclass/linux-info.eclass
31 +++ b/eclass/linux-info.eclass
32 @@ -813,7 +813,7 @@ check_extra_config() {
33 linux_chkconfig_present ${config} || error=1
34 fi
35
36 - if [[ ${error} > 0 ]]; then
37 + if [[ ${error} -gt 0 ]]; then
38 local report_func="eerror" local_error
39 local_error="ERROR_${config}"
40 local_error="${!local_error}"
41 @@ -848,14 +848,14 @@ check_extra_config() {
42 fi
43 done
44
45 - if [[ ${hard_errors_count} > 0 ]]; then
46 + if [[ ${hard_errors_count} -gt 0 ]]; then
47 eerror "Please check to make sure these options are set correctly."
48 eerror "Failure to do so may cause unexpected problems."
49 eerror "Once you have satisfied these options, please try merging"
50 eerror "this package again."
51 export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
52 die "Incorrect kernel configuration options"
53 - elif [[ ${soft_errors_count} > 0 ]]; then
54 + elif [[ ${soft_errors_count} -gt 0 ]]; then
55 ewarn "Please check to make sure these options are set correctly."
56 ewarn "Failure to do so may cause unexpected problems."
57 else