Gentoo Archives: gentoo-commits

From: "Chi-Thanh Christopher Nguyen (chithanh)" <chithanh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/ati-drivers/files: switchlibGL
Date: Sun, 02 Oct 2011 02:28:18
Message-Id: 20111002022803.40B2B2004C@flycatcher.gentoo.org
1 chithanh 11/10/02 02:28:03
2
3 Added: switchlibGL
4 Log:
5 Version bump, import of Enrico Tagliavini's ebuild from the x11 overlay.
6
7 (Portage version: 2.2.0_alpha53/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 x11-drivers/ati-drivers/files/switchlibGL
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/files/switchlibGL?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/files/switchlibGL?rev=1.1&content-type=text/plain
14
15 Index: switchlibGL
16 ===================================================================
17 #!/bin/bash
18 # switchlibGL
19 #
20 # Copyright (c) 2011 Advanced Micro Devices, Inc.
21 #
22 # Purpose:
23 # For switch between AMD and Intel graphic driver library.
24 #
25 # Usage:
26 # switchlibGL amd|intel|query
27 # amd: switches to the AMD version of libGL.
28 # intel: switches to the open-source version of libGL .
29 # query: checks, which version is currently active and prints either "amd"
30 # or "intel" or "unknown" on the standard output.
31 # must be root to execute this script
32
33 ARCH=`uname -m`
34 E_ERR=1
35
36 # Check if root
37 if [ "`whoami`" != "root" ]; then
38 echo "Must be root to run this script." 1>&2
39 exit $E_ERR
40 fi
41
42 # One parameter
43 if [ $# -ne 1 ]; then
44 echo "Usage: `basename $0` amd|intel|query " 1>&2
45 echo "Please choose one parameter " 1>&2
46 exit $E_ERR
47 fi
48
49
50 # Switch to right mode
51 case "$1" in
52 "amd" )
53 eselect opengl set ati
54 ;;
55 "intel" )
56 eselect opengl set xorg-x11
57 ;;
58 "query" )
59 current=`eselect opengl show`
60 case "$current" in
61 "ati" )
62 echo "amd"
63 ;;
64 "xorg-x11" )
65 echo "intel"
66 ;;
67 esac
68 ;;
69 * ) echo "Usage: `basename $0` amd|intel|query" 1>&2; exit $E_ERR;;
70 # other than amd|intel|query parameter report an error
71 esac
72
73 # A zero return value from the script upon exit indicates success.
74 exit 0