Magellan Linux

Diff of /tags/openglupdate-2_2_13/opengl-update.sh

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

trunk/opengl-update/opengl-update.sh revision 620 by niro, Wed Nov 14 18:18:47 2007 UTC tags/openglupdate-2_2_13/opengl-update.sh revision 1325 by niro, Mon May 30 09:01:06 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # Copyright 1999-2004 Gentoo Foundation  # Copyright 1999-2004 Gentoo Foundation
3  # Distributed under the terms of the GNU General Public License v2  # Distributed under the terms of the GNU General Public License v2
4  # $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.5 2007-11-14 18:18:47 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.10 2007-11-14 19:19:16 niro Exp $
5  # Author:  Martin Schlemmer <azarah@gentoo.org>  # Author:  Martin Schlemmer <azarah@gentoo.org>
6  # Further modifications by Donnie Berkholz <spyderous@gentoo.org>  # Further modifications by Donnie Berkholz <spyderous@gentoo.org>
7  # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>  # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>
# Line 67  get_implementations() Line 67  get_implementations()
67   for dir in ${PREFIX}/lib{,32,64}/opengl/*   for dir in ${PREFIX}/lib{,32,64}/opengl/*
68   do   do
69   if [[ -d ${dir} ]] &&   if [[ -d ${dir} ]] &&
70   [[ ${dir##*/} != global ]]   [[ ${dir##*/} != global ]] &&
71   && ! hasq ${dir##*/} ${implems}   ! hasq ${dir##*/} ${implems}
72   then   then
73   implems=${implems:+${implems} }${dir##*/}   implems=${implems:+${implems} }${dir##*/}
74   fi   fi
# Line 102  print_usage() Line 102  print_usage()
102  Usage: ${0##*/} [<options>] <GL implementation>  Usage: ${0##*/} [<options>] <GL implementation>
103         Set the opengl implementation.         Set the opengl implementation.
104         Valid options:         Valid options:
105           --help|-h|-?:       Prints this help.
106           --version:          Shows the version of this utility.
107         --use-old:          If an implementation is already set, use that one.         --use-old:          If an implementation is already set, use that one.
108         --prefix=<val>:     Set the source prefix (default: /usr)         --prefix=<val>:     Set the source prefix (default: /usr)
109         --dst-prefix=<val>: Set the destination prefix (default: /usr)         --dst-prefix=<val>: Set the destination prefix (default: /usr)
110         --impl-headers:     Use headers provided by this implementation to         --impl-headers:     Use headers provided by this implementation to
111                             override golbal ones provided by opengl-update.                             override global ones provided by opengl-update.
112    
113  Usage: ${0##*/} --get-implementation  Usage: ${0##*/} --get-implementation
114         Print the current implementaion         Print the current implementaion
# Line 197  parse_options() Line 199  parse_options()
199   done   done
200  }  }
201    
202  set-new-implementation()  set_new_implementation()
203  {  {
204   local GL_IMPLEM=${1}   local GL_IMPLEM=${1}
205   local GL_LOCAL   local GL_LOCAL
# Line 227  set-new-implementation() Line 229  set-new-implementation()
229   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] || continue   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] || continue
230   else   else
231   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] &&   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] &&
232   ! -h ${PREFIX}/${LIBDIR} ]] || continue   [[ ! -h ${PREFIX}/${LIBDIR} ]] || continue
233   fi   fi
234    
235   # Fallback on xorg if we don't have this implementation for this LIBDIR.   # Fallback on xorg if we don't have this implementation for this LIBDIR.
# Line 367  set-new-implementation() Line 369  set-new-implementation()
369    
370   done   done
371    
372     # put only one LDPATH per line!
373   local i   local i
374   for i in $(echo ${ldpath} | sed "s:\::\ :g")   for i in $(echo ${ldpath} | sed "s:\::\ :g")
375   do   do
# Line 405  case ${ACTION} in Line 408  case ${ACTION} in
408   ;;   ;;
409    
410   old-implementation)   old-implementation)
411   set-new-implementation ${CURRENT_GL_IMPLEM}   set_new_implementation ${CURRENT_GL_IMPLEM}
412   exit $?   exit $?
413   ;;   ;;
414    
415   set-implementation)   set-implementation)
416   if [[ -n ${NEW_GL_IMPLEM} ]]   if [[ -n ${NEW_GL_IMPLEM} ]]
417   then   then
418   set-new-implementation ${NEW_GL_IMPLEM}   set_new_implementation ${NEW_GL_IMPLEM}
419   exit $?   exit $?
420   else   else
421   print_usage   print_usage

Legend:
Removed from v.620  
changed lines
  Added in v.1325