summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2007-07-16 15:01:05 +0000
committerDoug Goldstein <cardoe@gentoo.org>2007-07-16 15:01:05 +0000
commit9b8d643b10c7acdc871760d47a009349b945a3c6 (patch)
tree3e77f357276ec3e2d838d74a1f1edebce3ec1051 /eclass
parentsparc stable (diff)
downloadgentoo-2-9b8d643b10c7acdc871760d47a009349b945a3c6.tar.gz
gentoo-2-9b8d643b10c7acdc871760d47a009349b945a3c6.tar.bz2
gentoo-2-9b8d643b10c7acdc871760d47a009349b945a3c6.zip
check versions so we don't output the warning when they are emerging a proper version
Diffstat (limited to 'eclass')
-rw-r--r--eclass/nvidia-driver.eclass49
1 files changed, 29 insertions, 20 deletions
diff --git a/eclass/nvidia-driver.eclass b/eclass/nvidia-driver.eclass
index df6edf8f4d7c..c4a38701c844 100644
--- a/eclass/nvidia-driver.eclass
+++ b/eclass/nvidia-driver.eclass
@@ -1,12 +1,13 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/nvidia-driver.eclass,v 1.3 2007/07/16 13:39:36 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/nvidia-driver.eclass,v 1.4 2007/07/16 15:01:05 cardoe Exp $
#
# Original Author: Doug Goldstein <cardoe@gentoo.org>
# Purpose: Provide useful messages for nvidia-drivers based on currently
# installed Nvidia card
#
+inherit versionator
DEPEND="sys-apps/pciutils"
@@ -23,6 +24,9 @@ drv_71xx="0020 0028 0029 002c 002d 00a0 0100 0101 0103 0150 0151 0152 0153"
mask_96xx=">=x11-drivers/nvidia-drivers-1.0.9700"
mask_71xx=">=x11-drivers/nvidia-drivers-1.0.7200"
+pv_96xx="1.0.9700"
+pv_71xx="1.0.7200"
+
# Retrieve the PCI device ID for each Nvidia video card you have
nvidia-driver-get-card() {
local NVIDIA_CARD="$(/usr/sbin/lspci -d 10de: -n | \
@@ -61,26 +65,31 @@ nvidia-driver-get-mask() {
nvidia-driver-check-warning() {
local NVIDIA_MASK="$(nvidia-driver-get-mask)"
if [ -n "$NVIDIA_MASK" ]; then
- ewarn "***** WARNING *****"
- ewarn
- ewarn "You are currently installing a version of nvidia-drivers that is"
- ewarn "known not to work with a video card you have installed on your"
- ewarn "system. If this is intentional, please ignore this. If it is not"
- ewarn "please perform the following steps:"
- ewarn
- ewarn "Add the following mask entry to /etc/portage/package.mask by"
- if [ -d "${ROOT}/etc/portage/package.mask" ]; then
- ewarn "echo \"$NVIDIA_MASK\" > /etc/portage/package.mask/nvidia-drivers"
- else
- ewarn "echo \"$NVIDIA_MASK\" >> /etc/portage/package.mask"
+ version-compare "${NVIDIA_MASK##-*}" "${PV}"
+ r=$?
+
+ if [ "x$r" = "x1" ]; then
+ ewarn "***** WARNING *****"
+ ewarn
+ ewarn "You are currently installing a version of nvidia-drivers that is"
+ ewarn "known not to work with a video card you have installed on your"
+ ewarn "system. If this is intentional, please ignore this. If it is not"
+ ewarn "please perform the following steps:"
+ ewarn
+ ewarn "Add the following mask entry to /etc/portage/package.mask by"
+ if [ -d "${ROOT}/etc/portage/package.mask" ]; then
+ ewarn "echo \"$NVIDIA_MASK\" > /etc/portage/package.mask/nvidia-drivers"
+ else
+ ewarn "echo \"$NVIDIA_MASK\" >> /etc/portage/package.mask"
+ fi
+ ewarn
+ ewarn "Failure to perform the steps above could result in a non-working"
+ ewarn "X setup."
+ ewarn
+ ewarn "For more information please read:"
+ ewarn "http://www.nvidia.com/object/IO_32667.html"
+ ebeep 5
fi
- ewarn
- ewarn "Failure to perform the steps above could result in a non-working"
- ewarn "X setup."
- ewarn
- ewarn "For more information please read:"
- ewarn "http://www.nvidia.com/object/IO_32667.html"
- ebeep 5
fi
}