From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1N6WV5-0000I5-34 for garchives@archives.gentoo.org; Fri, 06 Nov 2009 21:37:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3220E0982; Fri, 6 Nov 2009 21:37:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 61BF2E0982 for ; Fri, 6 Nov 2009 21:37:42 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id E42B167BCC for ; Fri, 6 Nov 2009 21:37:41 +0000 (UTC) Received: from ulm by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1N6WV3-0006K1-9t for gentoo-commits@lists.gentoo.org; Fri, 06 Nov 2009 21:37:41 +0000 From: "Ulrich Mueller (ulm)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, ulm@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-admin/eselect-pdftex/files: pdftex.eselect-0.2 X-VCS-Repository: gentoo-x86 X-VCS-Files: pdftex.eselect-0.2 X-VCS-Directories: app-admin/eselect-pdftex/files X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller Content-Type: text/plain; charset=utf8 Message-Id: Sender: Ulrich Mueller Date: Fri, 06 Nov 2009 21:37:41 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 7cb8b615-4b93-42b9-8d41-0b4e3aced681 X-Archives-Hash: 2c3dad5233c5020ba99bf1e53852727c ulm 09/11/06 21:37:41 Added: pdftex.eselect-0.2 Log: Version bump, bug 292107. (Portage version: 2.2_rc46/cvs/Linux i686) Revision Changes Path 1.1 app-admin/eselect-pdftex/files/pdftex.eselect-0.2 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/eselect-= pdftex/files/pdftex.eselect-0.2?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/eselect-= pdftex/files/pdftex.eselect-0.2?rev=3D1.1&content-type=3Dtext/plain Index: pdftex.eselect-0.2 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # -*-eselect-*- vim: ft=3Deselect # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id: pdftex.eselect-0.2,v 1.1 2009/11/06 21:37:40 ulm Exp $ DESCRIPTION=3D"Manage /usr/bin/pdftex implementations" MAINTAINER=3D"ml@gentoo.org" SVN_DATE=3D'$Date: 2009/11/06 21:37:40 $' VERSION=3D$(svn_date_to_version "${SVN_DATE}" ) # find a list of pdftex symlink targets, best first find_targets() { local f for f in "${ROOT}"/usr/bin/pdftex-*; do if [[ -f ${f} ]] ; then echo "${f##*/pdftex-}" fi done | sort } # find version number of currently symlinked version identify_target() { local f f=3D"$(canonicalise "${ROOT}"/usr/bin/pdftex)" echo "${f##*/pdftex-}" } # try to remove the pdftex symlink remove_symlinks() { rm -f "${ROOT}"/usr/bin/pdftex &>/dev/null } # set the pdftex symlink set_symlinks() { local target=3D"${1}" targets if is_number "${target}" && [[ ${target} -ge 1 ]] ; then targets=3D( $(find_targets ) ) target=3D${targets[$(( ${target} - 1 ))]} fi if [[ -f "${ROOT}/usr/bin/pdftex-${target}" ]] ; then remove_symlinks ln -s "pdftex-${target}" "${ROOT}/usr/bin/pdftex" || \ die "Could not set ${target} /usr/bin/pdftex symlink" echo "Updating TeX formats" [ -z "${ROOT}" ] && fmtutil-sys --all &>/dev/null || write_warning_msg = "Could not update TeX formats for some reason, pdftex may not work proper= ly." else die -q "Target \"${target}\" doesn't appear to be valid!" fi } ### show action ### describe_show() { echo "Show the current pdftex version" } do_show() { [[ -z "${@}" ]] || die -q "Too many parameters" write_list_start "Current pdftex verson:" if [[ -L "${ROOT}/usr/bin/pdftex" ]] ; then write_kv_list_entry "$(identify_target)" "" elif [[ -e "${ROOT}/usr/bin/pdftex" ]] ; then write_kv_list_entry "(not a symlink)" "" else write_kv_list_entry "(unset)" "" fi } ### list action ### describe_list() { echo "List available pdftex versions" } do_list() { [[ -z "${@}" ]] || die -q "Too many parameters" local i targets current targets=3D( $(find_targets ) ) current=3D$(identify_target) for (( i =3D 0; i < ${#targets[@]}; i++ )); do [[ ${targets[i]} =3D ${current} ]] \ && targets[i]=3D$(highlight_marker "${targets[i]}") done write_list_start "Available pdftex versions:" write_numbered_list -m "(none found)" "${targets[@]}" } ### set action ### describe_set() { echo "Set a new pdftex version" } describe_set_options() { echo "target : Target version number or index from 'list' action" } describe_set_parameters() { echo "" } do_set() { if [[ -z "${1}" ]] ; then die -q "You didn't give me a version number" elif [[ -n "${2}" ]] ; then die -q "Too many parameters" elif [[ -L "${ROOT}/usr/bin/pdftex" ]] ; then if ! remove_symlinks ; then die -q "Can't remove existing version symlink" elif ! set_symlinks "${1}" ; then die -q "Can't set new version" fi elif [[ -e "${ROOT}/usr/bin/pdftex" ]] ; then die -q "${ROOT}/usr/bin/pdftex seems to be from an old ebuild, please r= emove manually" else set_symlinks "${1}" || die -q "Can't set new version" fi } ### update action ### describe_update() { echo "Automatically update the pdftex version number" } describe_update_options() { echo "--if-unset : Do not override currently selected version" } do_update() { [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" =3D=3D "--if-unset" ]]= ) || \ die -q "Usage error" if [[ -L "${ROOT}/usr/bin/pdftex" ]] ; then [[ ${1} =3D=3D "--if-unset" ]] && return remove_symlinks || die -q "Can't remove existing symlink" fi if [[ -e "${ROOT}/usr/bin/pdftex" ]] ; then die -q "${ROOT}/usr/bin/pdftex seems to be from an old ebuild, please r= emove manually" elif ! [[ -z $(find_targets ) ]] ; then set_symlinks 1 || die -q "Can't set a new version" fi }