From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 546FC198006 for ; Mon, 11 Mar 2013 02:16:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A849E0760; Mon, 11 Mar 2013 02:16:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 924A8E0678 for ; Mon, 11 Mar 2013 02:16:46 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9E8D733C3B4 for ; Mon, 11 Mar 2013 02:16:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 32220E4363 for ; Mon, 11 Mar 2013 02:16:44 +0000 (UTC) From: "Christoph Junghans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christoph Junghans" Message-ID: <1362966604.7fa887fc34cfb4937abc8b034f3ec909404a1a2a.ottxor@gentoo> Subject: [gentoo-commits] proj/eselect:extern commit in: modules/ X-VCS-Repository: proj/eselect X-VCS-Files: modules/xvmc.eselect X-VCS-Directories: modules/ X-VCS-Committer: ottxor X-VCS-Committer-Name: Christoph Junghans X-VCS-Revision: 7fa887fc34cfb4937abc8b034f3ec909404a1a2a X-VCS-Branch: extern Date: Mon, 11 Mar 2013 02:16:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 709935fe-7aaf-40e0-990e-3922162d8734 X-Archives-Hash: 546b055e7c9995cd678d884bc8d3fd53 commit: 7fa887fc34cfb4937abc8b034f3ec909404a1a2a Author: Christoph Junghans gentoo org> AuthorDate: Mon Mar 11 01:50:04 2013 +0000 Commit: Christoph Junghans gentoo org> CommitDate: Mon Mar 11 01:50:04 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=7fa887fc xvmc.eselect: added prefix support (bug #434518) --- modules/xvmc.eselect | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-) diff --git a/modules/xvmc.eselect b/modules/xvmc.eselect index 15f8bd0..7213fcc 100644 --- a/modules/xvmc.eselect +++ b/modules/xvmc.eselect @@ -8,18 +8,24 @@ MAINTAINER="cardoe@gentoo.org" SVN_DATE='$Date$' VERSION=$(svn_date_to_version "${SVN_DATE}" ) +get_libname() { + [[ $(uname) == "Darwin" ]] \ + && echo ${1:+.}${1}.dylib \ + || echo .so${1:+.}${1} +} + XVMCLIBS=( -"libXvMCNVIDIA_dynamic.so.1" -"libXvMC.so.1" -"libviaXvMC.so.1" -"libviaXvMCPro.so.1" -"libchromeXvMC.so.1" -"libchromeXvMCPro.so.1" -"libXvMCVIA.so" -"libXvMCVIAPro.so" -"libI810XvMC.so.1" -"/usr/lib/libIntelXvMC.so" -"libAMDXvBA.so.1" ) +"libXvMCNVIDIA_dynamic$(get_libname 1)" +"libXvMC$(get_libname 1)" +"libviaXvMC$(get_libname 1)" +"libviaXvMCPro$(get_libname 1)" +"libchromeXvMC$(get_libname 1)" +"libchromeXvMCPro$(get_libname 1)" +"libXvMCVIA$(get_libname)" +"libXvMCVIAPro$(get_libname)" +"libI810XvMC$(get_libname 1)" +"/usr/lib/libIntelXvMC$(get_libname)" +"libAMDXvBA$(get_libname 1)" ) XVMCPRETTY=( "nvidia" "xorg-x11" @@ -36,7 +42,7 @@ XVMCPRETTY=( get_implementation_indices() { local ret n for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do - [[ -e "${ROOT}/usr/lib/${XVMCLIBS[n]##*/}" ]] && ret+=($n) + [[ -e "${EROOT}/usr/lib/${XVMCLIBS[n]##*/}" ]] && ret+=($n) done echo ${ret[@]} @@ -44,8 +50,8 @@ get_implementation_indices() { get_current_implementation_index() { local n - if [[ -f "${ROOT}/etc/X11/XvMCConfig" ]]; then - local current=$(< "${ROOT}/etc/X11/XvMCConfig") + if [[ -f "${EROOT}/etc/X11/XvMCConfig" ]]; then + local current=$(< "${EROOT}/etc/X11/XvMCConfig") for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do if [[ "${XVMCLIBS[n]}" = "${current}" ]]; then echo "${n}" @@ -59,11 +65,11 @@ get_current_implementation_index() { set_new_implementation() { echo -n "Switching to ${XVMCPRETTY[$1]} XvMC implementation..." - touch "${ROOT}/etc/X11/XvMCConfig" 2>&1 > /dev/null + touch "${EROOT}/etc/X11/XvMCConfig" 2>&1 > /dev/null if [[ $? -eq 0 ]]; then - echo "${XVMCLIBS[$1]}" > "${ROOT}/etc/X11/XvMCConfig" - chmod 644 "${ROOT}/etc/X11/XvMCConfig" - chown 0:0 "${ROOT}/etc/X11/XvMCConfig" + echo "${XVMCLIBS[$1]}" > "${EROOT}/etc/X11/XvMCConfig" + chmod 644 "${EROOT}/etc/X11/XvMCConfig" + [[ ${EROOT} == "/" ]] && chown 0:0 "${EROOT}/etc/X11/XvMCConfig" echo " done" else echo " failed!"