--- opengl-update-2.2.4 2005-12-26 23:11:10.000000000 +0000 +++ opengl-update-2.2.4-magellan 2005-12-26 23:21:22.000000000 +0000 @@ -6,8 +6,12 @@ # Further modifications by Donnie Berkholz # Further modifications based off submissions to bug #54984 # Further modifications by Jeremy Huddleston +# +# hacked for use with magellan-linux +# +# -. /etc/init.d/functions.sh +. /etc/init.d/functions hasq() { local x @@ -25,20 +29,11 @@ check_user() { if [[ $(id -u) -ne 0 ]]; then - eerror "${0}: Must be run as root." + echo "${0}: Must be run as root." exit 1 fi } -check_version() { - if portageq has_version / 'x11-base/xorg-x11'; then - if ! portageq has_version / '>=x11-base/xorg-x11-6.8.0-r4'; then - eerror "This version requires >=x11-base/xorg-x11-6.8.0-r4" - exit 1 - fi - fi -} - get_current_implem() { local implem if [[ -f ${ENV_D} ]]; then @@ -104,7 +99,7 @@ $(echo ${AVAIL_IMPLEMS} | wc -w) available implementation${IMPLEM_PLURAL}: ${AVAIL_IMPLEMS} Examples: - ${0##*/} xorg-x11 + ${0##*/} xorg This will setup things to use libGL.so from X.org. ${0##*/} nvidia @@ -123,7 +118,7 @@ --use-old) if [[ -n "${ACTION}" ]]; then ACTION="error" - eerror "Invalid usage." + echo "Invalid usage." else if [[ -n "${CURRENT_GL_IMPLEM}" ]] && hasq ${CURRENT_GL_IMPLEM} ${AVAIL_IMPLEMS}; then ACTION="old-implementation" @@ -133,7 +128,7 @@ --get-implementation) if [[ -n "${ACTION}" ]]; then ACTION="error" - eerror "Invalid usage." + echo "Invalid usage." else ACTION="get-implementation" fi @@ -159,14 +154,14 @@ if [[ "${ACTION}" != "old-implementation" ]]; then if [[ -n "${ACTION}" ]]; then ACTION="error" - eerror "Invalid usage." + echo "Invalid usage." else ACTION="set-implementation" NEW_GL_IMPLEM="${opt}" fi fi else - eerror "Unrecognized option: ${opt}" + echo "Unrecognized option: ${opt}" ACTION="error" fi ;; @@ -178,18 +173,17 @@ local GL_IMPLEM=${1} local GL_LOCAL - check_version check_user # Set a sane umask... bug #83115 umask 022 if ! hasq ${GL_IMPLEM} ${AVAIL_IMPLEMS}; then - eerror "Invalid profile selected." + echo "Invalid profile selected." exit 1 fi - ebegin "Switching to ${GL_IMPLEM} OpenGL interface" + echo "Switching to ${GL_IMPLEM} OpenGL interface" rm -f ${ENV_D} &> /dev/null LIBDIRS="lib32 lib lib64" @@ -202,9 +196,9 @@ [[ -d "${PREFIX}/${LIBDIR}/opengl" && ! -h "${PREFIX}/${LIBDIR}" ]] || continue fi - # Fallback on xorg-x11 if we don't have this implementation for this LIBDIR. + # Fallback on xorg if we don't have this implementation for this LIBDIR. if [[ ! -d ${PREFIX}/${LIBDIR}/opengl/"${GL_IMPLEM}" ]]; then - GL_LOCAL="xorg-x11" + GL_LOCAL="xorg" else GL_LOCAL="${GL_IMPLEM}" fi @@ -308,9 +302,9 @@ elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]]; then [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} - elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg-x11/include/${file} ]]; then + elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file} ]]; then [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file} - ln -s ${PREFIX}/${LIBDIR}/opengl/xorg-x11/include/${file} + ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file} fi done popd &> /dev/null @@ -323,9 +317,9 @@ echo "LDPATH=\"${ldpath}\"" > ${ENV_D} echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D} - env-update + env-rebuild - eend 0 + return 0 } ## START PROGRAM ## @@ -338,7 +332,7 @@ AVAIL_IMPLEMS=$(get_implementations) CURRENT_GL_IMPLEM=$(get_current_implem) USE_PROFILE_HEADERS="no" -VERSION="2.2.1" +VERSION="2.2.4" parse_options ${@}