Skip to content

Commit

Permalink
nvidia-driver.eclass: Fix GPU vs version compatibility check
Browse files Browse the repository at this point in the history
- In commit 245f417 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 <[email protected]>
Tested-by: Kobboi
Signed-off-by: Jeroen Roovers <[email protected]>
  • Loading branch information
Jeroen Roovers committed Dec 2, 2019
1 parent b2e2f09 commit ab0fb15
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eclass/nvidia-driver.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit ab0fb15

Please sign in to comment.