1 |
On Mon, 16 Nov 2015 23:38:08 +0000 (UTC) |
2 |
"Mike Pagano" <mpagano@g.o> wrote: |
3 |
|
4 |
> commit: aac24917ebe254a23990f0d7fff9f6f570b99d15 |
5 |
> Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
6 |
> AuthorDate: Mon Nov 16 23:37:55 2015 +0000 |
7 |
> Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
8 |
> CommitDate: Mon Nov 16 23:37:55 2015 +0000 |
9 |
> URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aac24917 |
10 |
> |
11 |
> kernel-2.eclass: Fix for git-sources 4.4_rcX |
12 |
> |
13 |
> eclass/kernel-2.eclass | 4 ++-- |
14 |
> 1 file changed, 2 insertions(+), 2 deletions(-) |
15 |
> |
16 |
> diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass |
17 |
> index 0f47b8c..5a9ea9f 100644 |
18 |
> --- a/eclass/kernel-2.eclass |
19 |
> +++ b/eclass/kernel-2.eclass |
20 |
> @@ -1079,9 +1079,9 @@ unipatch() { |
21 |
> # https://bugs.gentoo.org/show_bug.cgi?id=507656 # |
22 |
> #################################################################### |
23 |
> if [[ ${PN} == "git-sources" ]] ; then |
24 |
> - if [[ ${KV_MAJOR}${KV_PATCH} -ge 315 && ${RELEASETYPE} == -rc ]] ; then |
25 |
> + if [[ ${KV_MAJOR}.${KV_PATCH} > 3.15 && ${RELEASETYPE} == -rc ]] ; then |
26 |
|
27 |
Don't do string comparison on numbers. It can fail randomly, |
28 |
and teaches others who read it bad practices. For example, it would |
29 |
fail when kernel reaches version 10 ;-P. |
30 |
|
31 |
Instead: |
32 |
|
33 |
[[ ${KV_MAJOR} -gt 3 || ( ${KV_MAJOR} -eq 3 && ${KV_PATCH} -gt 15 ) ]] |
34 |
|
35 |
> ebegin "Applying ${i/*\//} (-p1)" |
36 |
> - if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then |
37 |
> + if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -le 2 ]; then |
38 |
> eend 0 |
39 |
> rm ${STDERR_T} |
40 |
> break |
41 |
> |
42 |
|
43 |
|
44 |
|
45 |
-- |
46 |
Best regards, |
47 |
Michał Górny |
48 |
<http://dev.gentoo.org/~mgorny/> |