--- trunk/opengl-update/opengl-update.sh 2007/11/14 18:15:11 617 +++ tags/openglupdate-2_2_13/opengl-update.sh 2011/05/30 09:01:06 1325 @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.2 2007-11-14 18:15:11 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 $ # Author: Martin Schlemmer # Further modifications by Donnie Berkholz # Further modifications based off submissions to bug #54984 @@ -67,8 +67,8 @@ for dir in ${PREFIX}/lib{,32,64}/opengl/* do if [[ -d ${dir} ]] && - [[ ${dir##*/} != global ]] - && ! hasq ${dir##*/} ${implems} + [[ ${dir##*/} != global ]] && + ! hasq ${dir##*/} ${implems} then implems=${implems:+${implems} }${dir##*/} fi @@ -102,11 +102,13 @@ Usage: ${0##*/} [] Set the opengl implementation. Valid options: + --help|-h|-?: Prints this help. + --version: Shows the version of this utility. --use-old: If an implementation is already set, use that one. --prefix=: Set the source prefix (default: /usr) --dst-prefix=: Set the destination prefix (default: /usr) --impl-headers: Use headers provided by this implementation to - override golbal ones provided by opengl-update. + override global ones provided by opengl-update. Usage: ${0##*/} --get-implementation Print the current implementaion @@ -170,7 +172,7 @@ --impl-headers) USE_PROFILE_HEADERS="yes" ;; - --help|-h|-?) ACION="usage" ;; + --help|-h|-?) ACTION="usage" ;; --version) ACTION="version" ;; @@ -197,7 +199,7 @@ done } -set-new-implementation() +set_new_implementation() { local GL_IMPLEM=${1} local GL_LOCAL @@ -227,7 +229,7 @@ [[ -d ${PREFIX}/${LIBDIR}/opengl ]] || continue else [[ -d ${PREFIX}/${LIBDIR}/opengl ]] && - ! -h ${PREFIX}/${LIBDIR} ]] || continue + [[ ! -h ${PREFIX}/${LIBDIR} ]] || continue fi # Fallback on xorg if we don't have this implementation for this LIBDIR. @@ -367,7 +369,12 @@ done - echo "LDPATH=\"${ldpath}\"" > ${ENV_D} + # put only one LDPATH per line! + local i + for i in $(echo ${ldpath} | sed "s:\::\ :g") + do + echo "LDPATH=\"${i}\"" >> ${ENV_D} + done echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D} env-rebuild @@ -385,7 +392,7 @@ AVAIL_IMPLEMS=$(get_implementations) CURRENT_GL_IMPLEM=$(get_current_implem) USE_PROFILE_HEADERS="no" -VERSION="2.2.4" +VERSION="@@VERSION@@" parse_options ${@} @@ -401,14 +408,14 @@ ;; old-implementation) - set-new-implementation ${CURRENT_GL_IMPLEM} + set_new_implementation ${CURRENT_GL_IMPLEM} exit $? ;; set-implementation) if [[ -n ${NEW_GL_IMPLEM} ]] then - set-new-implementation ${NEW_GL_IMPLEM} + set_new_implementation ${NEW_GL_IMPLEM} exit $? else print_usage