Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51738 - errors in opengl-update script
Summary: errors in opengl-update script
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-22 07:45 UTC by Rene Androsch
Modified: 2004-05-23 12:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rene Androsch 2004-05-22 07:45:56 UTC
My opengl-update script did not. Whenever I did a "opengl-update nvidia" it displayed my the usage lines...

So I opened the script and there were a lot of lines likes this one "\${1}" which didn't work, so after cleaning it a bit, I can now do a opengl-update nvidia again.


Here is the updated script:
--start--
#!/bin/bash
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author:  Martin Schlemmer <azarah@gentoo.org>
# $Header: /home/cvsroot/gentoo/src/livecd/profiles/lw-ut2003/opengl-update,v 1.1 2003/10/19 03:46:49 livewire Exp $
source /etc/init.d/functions.sh

if [ `id -u` -ne 0 ]
then
	eerror "${0}: must be root."
	exit 1
fi

usage() {
cat << FOO
usage: opengl-update <GL implementation>

note:
       This utility switch between OpenGL implementations.  Currently there
       are two supported implementations, namely "xfree" and "nvidia", the
       implementations for XFree86 and the NVidia drivers respectively.

examples:
       opengl-update xfree
       This will setup things to use libGL.so from XFree86

       opengl-update nvidia
       This will setup things to use libGL.so from the NVidia drivers.

FOO
	exit 1
}

if [ $# -ne 1 ]
then
	usage
fi
if [ ! -d /usr/lib/opengl/${1} ]
then
	usage
else
	ebegin "Switching to ${1} OpenGL interface"

	#set up the \$LDPATH
	echo "LDPATH=/usr/lib/opengl/${1}/lib" >/etc/env.d/09opengl
	/usr/sbin/env-update &>/dev/null

	#setup the /usr/lib/libGL.so symlink
	rm -f /etc/opengl/libGL.so /etc/opengl/libGL.so.1

	realname="$(readlink /usr/lib/opengl/${1}/lib/libGL.so)"
	ln -sf /usr/lib/opengl/${1}/lib/${realname} \
		/etc/opengl/libGL.so
	ln -sf /usr/lib/opengl/${1}/lib/${realname} \
		/etc/opengl/libGL.so.1

	#setup the /usr/X11R6/lib/libMesaGL.so symlink
	rm -f /etc/opengl/libMesaGL.so
	realname="$(readlink /usr/lib/opengl/${1}/lib/libGL.so)"
	ln -sf /usr/lib/opengl/${1}/lib/${realname} \
		/etc/opengl/libMesaGL.so

	rm -f /etc/opengl/libGLcore.so*

	if [ -e /usr/lib/opengl/${1}/lib/libGLcore.so ]
	then
		realname="$(readlink /usr/lib/opengl/${1}/lib/libGLcore.so)"
		ln -sf /usr/lib/opengl/${1}/lib/${realname} \
			/etc/opengl/libGLcore.so
		ln -sf /usr/lib/opengl/${1}/lib/${realname} \
			/etc/opengl/libGLcore.so.1
	fi

	#setup the /usr/X11R6/lib/modules/extensions/libglx.so symlink
	rm -f /etc/opengl/libglx.*

	if [ -e /usr/lib/opengl/${1}/extensions/libglx.so ]
	then
		ln -sf /usr/lib/opengl/${1}/extensions/libglx.so \
			/etc/opengl/libglx.so
	fi
	#setup the /usr/X11R6/lib/modules/extensions/libglx.a symlink
	if [ -e /usr/lib/opengl/${1}/extensions/libglx.a ]
	then
		ln -sf /usr/lib/opengl/${1}/extensions/libglx.a \
			/etc/opengl/libglx.a
	fi

	eend 0
fi


# vim:ts=4
--end--

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Tuan Van (RETIRED) gentoo-dev 2004-05-22 10:58:01 UTC
may be a dup of bug #51726
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2004-05-22 22:41:57 UTC
Could you please provide a patch against the latest opengl-update in portage, and attach it as a plain-text attachment? Thanks.
Comment 3 Rene Androsch 2004-05-23 12:09:49 UTC
I emerged opengl-update again and noticed that the gentoo has 4.0 kb and my version only 2.4 kb -> so mine was very different...

I'm closing this bug, since its invalid.