/[gentoo-x86]/eclass/nvidia-driver.eclass
Gentoo

Diff of /eclass/nvidia-driver.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.21 Revision 1.22
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/nvidia-driver.eclass,v 1.21 2013/04/10 15:10:18 jer Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/nvidia-driver.eclass,v 1.22 2013/05/16 14:25:13 jer Exp $
4 4
5# @ECLASS: nvidia-driver.eclass 5# @ECLASS: nvidia-driver.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# chainsaw@gentoo.org 7# chainsaw@gentoo.org
8# @AUTHOR: 8# @AUTHOR:
47 47
48# @FUNCTION: nvidia-driver-get-card 48# @FUNCTION: nvidia-driver-get-card
49# @DESCRIPTION: 49# @DESCRIPTION:
50# Retrieve the PCI device ID for each Nvidia video card you have 50# Retrieve the PCI device ID for each Nvidia video card you have
51nvidia-driver-get-card() { 51nvidia-driver-get-card() {
52 local NVIDIA_CARD="$(/usr/sbin/lspci -d 10de: -n | awk -F'[: ]' '/ 0300: /{print $6}')" 52 local NVIDIA_CARD=$(
53 [ -x /usr/sbin/lspci ] && /usr/sbin/lspci -d 10de: -n \
54 | awk -F'[: ]' '/ 0300: /{print $6}'
55 )
53 56
54 if [ -n "$NVIDIA_CARD" ]; then 57 if [ -n "$NVIDIA_CARD" ]; then
55 echo "$NVIDIA_CARD" 58 echo "$NVIDIA_CARD"
56 else 59 else
57 echo 0000 60 echo 0000

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20