Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 02 Dec 2019 10:14:40
Message-Id: 1575281672.ab0fb1519721067734702a3d4f2fa91c968eaa34.jer@gentoo
1 commit: ab0fb1519721067734702a3d4f2fa91c968eaa34
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 2 10:08:30 2019 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 2 10:14:32 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab0fb151
7
8 nvidia-driver.eclass: Fix GPU vs version compatibility check
9
10 - In commit 245f417b539760ccf4939630f2c6b826ce34a556 I replaced
11 version_compare() with ver_test but failed to properly adjust the check
12 from the "is at least" return value to its ver_test equivalent. Invert
13 the test return value for clarity and check for a version mask less than
14 PV.
15 - Use lower case for local variable name.
16 - Fix a comment while there.
17
18 Fixes: https://bugs.gentoo.org/701734
19 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
20 Tested-by: Kobboi
21 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
22
23 eclass/nvidia-driver.eclass | 12 ++++++------
24 1 file changed, 6 insertions(+), 6 deletions(-)
25
26 diff --git a/eclass/nvidia-driver.eclass b/eclass/nvidia-driver.eclass
27 index b71b7a769ae..8c108a9c338 100644
28 --- a/eclass/nvidia-driver.eclass
29 +++ b/eclass/nvidia-driver.eclass
30 @@ -175,12 +175,12 @@ nvidia-driver_get_mask() {
31
32 # @FUNCTION: nvidia-driver_check_gpu
33 # @DESCRIPTION:
34 -# Prints out a warning if the driver does not work w/ the installed video nvidia_gpu
35 +# Prints out a warning if the driver does not work with the installed GPU
36 nvidia-driver_check_gpu() {
37 - local NVIDIA_MASK="$(nvidia-driver_get_mask)"
38 + local nvidia_mask="$(nvidia-driver_get_mask)"
39
40 - if [ -n "${NVIDIA_MASK}" ]; then
41 - if ! ver_test "${NVIDIA_MASK##*-}" -eq "${PV}" ; then
42 + if [ -n "${nvidia_mask}" ]; then
43 + if ver_test "${nvidia_mask##*-}" -lt "${PV}" ; then
44 ewarn "***** WARNING *****"
45 ewarn
46 ewarn "You are currently installing a version of nvidia-drivers that is"
47 @@ -190,9 +190,9 @@ nvidia-driver_check_gpu() {
48 ewarn
49 ewarn "Add the following mask entry to the local package.mask file:"
50 if [ -d "${ROOT}/etc/portage/package.mask" ]; then
51 - ewarn "echo \"${NVIDIA_MASK}\" > /etc/portage/package.mask/nvidia-drivers"
52 + ewarn "echo \"${nvidia_mask}\" > /etc/portage/package.mask/nvidia-drivers"
53 else
54 - ewarn "echo \"${NVIDIA_MASK}\" >> /etc/portage/package.mask"
55 + ewarn "echo \"${nvidia_mask}\" >> /etc/portage/package.mask"
56 fi
57 ewarn
58 ewarn "Failure to perform the steps above could result in a non-working"