diff options
author | Jeroen Roovers <jer@gentoo.org> | 2019-12-02 11:08:30 +0100 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2019-12-02 11:14:32 +0100 |
commit | ab0fb1519721067734702a3d4f2fa91c968eaa34 (patch) | |
tree | 766869ba1259641afa944720ec30fd6a0391d5b1 /eclass/nvidia-driver.eclass | |
parent | net-dns/openresolv: Bump to version 3.9.2 (diff) | |
download | gentoo-ab0fb1519721067734702a3d4f2fa91c968eaa34.tar.gz gentoo-ab0fb1519721067734702a3d4f2fa91c968eaa34.tar.bz2 gentoo-ab0fb1519721067734702a3d4f2fa91c968eaa34.zip |
nvidia-driver.eclass: Fix GPU vs version compatibility check
- In commit 245f417b539760ccf4939630f2c6b826ce34a556 I replaced
version_compare() with ver_test but failed to properly adjust the check
from the "is at least" return value to its ver_test equivalent. Invert
the test return value for clarity and check for a version mask less than
PV.
- Use lower case for local variable name.
- Fix a comment while there.
Fixes: https://bugs.gentoo.org/701734
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Tested-by: Kobboi
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Diffstat (limited to 'eclass/nvidia-driver.eclass')
-rw-r--r-- | eclass/nvidia-driver.eclass | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/eclass/nvidia-driver.eclass b/eclass/nvidia-driver.eclass index b71b7a769aeb..8c108a9c338e 100644 --- a/eclass/nvidia-driver.eclass +++ b/eclass/nvidia-driver.eclass @@ -175,12 +175,12 @@ nvidia-driver_get_mask() { # @FUNCTION: nvidia-driver_check_gpu # @DESCRIPTION: -# Prints out a warning if the driver does not work w/ the installed video nvidia_gpu +# Prints out a warning if the driver does not work with the installed GPU nvidia-driver_check_gpu() { - local NVIDIA_MASK="$(nvidia-driver_get_mask)" + local nvidia_mask="$(nvidia-driver_get_mask)" - if [ -n "${NVIDIA_MASK}" ]; then - if ! ver_test "${NVIDIA_MASK##*-}" -eq "${PV}" ; then + if [ -n "${nvidia_mask}" ]; then + if ver_test "${nvidia_mask##*-}" -lt "${PV}" ; then ewarn "***** WARNING *****" ewarn ewarn "You are currently installing a version of nvidia-drivers that is" @@ -190,9 +190,9 @@ nvidia-driver_check_gpu() { ewarn ewarn "Add the following mask entry to the local package.mask file:" if [ -d "${ROOT}/etc/portage/package.mask" ]; then - ewarn "echo \"${NVIDIA_MASK}\" > /etc/portage/package.mask/nvidia-drivers" + ewarn "echo \"${nvidia_mask}\" > /etc/portage/package.mask/nvidia-drivers" else - ewarn "echo \"${NVIDIA_MASK}\" >> /etc/portage/package.mask" + ewarn "echo \"${nvidia_mask}\" >> /etc/portage/package.mask" fi ewarn ewarn "Failure to perform the steps above could result in a non-working" |