summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2008-09-09 16:51:58 +0000
committerAlexis Ballier <aballier@gentoo.org>2008-09-09 16:51:58 +0000
commit82f20364f44b2e9967e01359c3d154120e9a88d3 (patch)
tree41e63d4ecacca16fc49352eafc4398e6d627d925 /app-admin/eselect-pdftex
parentAutomated update of use.local.desc (diff)
downloadhistorical-82f20364f44b2e9967e01359c3d154120e9a88d3.tar.gz
historical-82f20364f44b2e9967e01359c3d154120e9a88d3.tar.bz2
historical-82f20364f44b2e9967e01359c3d154120e9a88d3.zip
Initial import: manages /usr/bin/pdftex symlinks to allow easy usage of standalone pdftex ebuild.
Package-Manager: portage-2.2_rc8/cvs/Linux 2.6.26.3 x86_64
Diffstat (limited to 'app-admin/eselect-pdftex')
-rw-r--r--app-admin/eselect-pdftex/ChangeLog11
-rw-r--r--app-admin/eselect-pdftex/Manifest14
-rw-r--r--app-admin/eselect-pdftex/eselect-pdftex-0.1.ebuild28
-rw-r--r--app-admin/eselect-pdftex/files/pdftex.eselect-0.1153
-rw-r--r--app-admin/eselect-pdftex/metadata.xml5
5 files changed, 211 insertions, 0 deletions
diff --git a/app-admin/eselect-pdftex/ChangeLog b/app-admin/eselect-pdftex/ChangeLog
new file mode 100644
index 000000000000..25cdc2efabdd
--- /dev/null
+++ b/app-admin/eselect-pdftex/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for app-admin/eselect-pdftex
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-pdftex/ChangeLog,v 1.1 2008/09/09 16:51:57 aballier Exp $
+
+*eselect-pdftex-0.1 (09 Sep 2008)
+
+ 09 Sep 2008; Alexis Ballier <aballier@gentoo.org>
+ +files/pdftex.eselect-0.1, +metadata.xml, +eselect-pdftex-0.1.ebuild:
+ Initial import: manages /usr/bin/pdftex symlinks to allow easy usage of
+ standalone pdftex ebuild.
+
diff --git a/app-admin/eselect-pdftex/Manifest b/app-admin/eselect-pdftex/Manifest
new file mode 100644
index 000000000000..4d4dc7ee1e81
--- /dev/null
+++ b/app-admin/eselect-pdftex/Manifest
@@ -0,0 +1,14 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX pdftex.eselect-0.1 3933 RMD160 ef2f368ac269e618f1de4c1420031f30b0b3875b SHA1 892e0ea21bedead6431aff658f7644659a6c02a8 SHA256 d4c8f1d982c8751cb044896559d7549415437d46a5113bb606477053e38a9c5d
+EBUILD eselect-pdftex-0.1.ebuild 817 RMD160 2af469797b04c04a2f104a5141ea3edc93a1cabf SHA1 6d2e8498216e93a8ccb06cf84ec8770d8afd69f6 SHA256 96bf090e14e3d631515622b581833cf68140c6d1f0561599800c2fdd917a0c77
+MISC ChangeLog 485 RMD160 a8c68771da539dbaf94b5fe134fb4f6a612cf399 SHA1 31bb7cbf11de0231b5aeb73f38493b2f0e1dc065 SHA256 d63ac07bfb1bb5a0047d9e2ded8839582246a1efed64bea4c655cfd8ff2e3a17
+MISC metadata.xml 156 RMD160 2bf6b2ed9ff0fcef1e902cf093ccf4ae2dcc70a0 SHA1 e9260cd53905d8569cf3327ded4c6d01653fc389 SHA256 b4971b8472ab3fe4fbfe41b331a79193ca19e86c08d055ad1c20eaf9e04b79b6
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.9 (GNU/Linux)
+
+iEYEARECAAYFAkjGqbMACgkQvFcC4BYPU0qx5QCfQeZETCEpbuztWRkt8oG2kzGR
+gfcAn0wq4xhP2mltafSMtlUKrS0ofZzk
+=iljy
+-----END PGP SIGNATURE-----
diff --git a/app-admin/eselect-pdftex/eselect-pdftex-0.1.ebuild b/app-admin/eselect-pdftex/eselect-pdftex-0.1.ebuild
new file mode 100644
index 000000000000..24e65c27fe93
--- /dev/null
+++ b/app-admin/eselect-pdftex/eselect-pdftex-0.1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-pdftex/eselect-pdftex-0.1.ebuild,v 1.1 2008/09/09 16:51:57 aballier Exp $
+
+inherit eutils
+
+DESCRIPTION="pdftex module for eselect"
+HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86-fbsd"
+
+IUSE=""
+DEPEND=""
+# Depend on texlive-core-2008 that allows usage of this module, otherwise it
+# will not work so nicely.
+RDEPEND=">=app-admin/eselect-1.0.5
+ >=app-text/texlive-core-2008"
+
+src_install() {
+ local MODULEDIR="/usr/share/eselect/modules"
+ local MODULE="pdftex"
+ dodir ${MODULEDIR}
+ insinto ${MODULEDIR}
+ newins "${FILESDIR}/${MODULE}.eselect-${PVR}" ${MODULE}.eselect || die "failed to install"
+}
diff --git a/app-admin/eselect-pdftex/files/pdftex.eselect-0.1 b/app-admin/eselect-pdftex/files/pdftex.eselect-0.1
new file mode 100644
index 000000000000..f88ed70489c6
--- /dev/null
+++ b/app-admin/eselect-pdftex/files/pdftex.eselect-0.1
@@ -0,0 +1,153 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: pdftex.eselect-0.1,v 1.1 2008/09/09 16:51:58 aballier Exp $
+
+DESCRIPTION="Manage /usr/bin/pdftex implementations"
+MAINTAINER="ml@gentoo.org"
+SVN_DATE='$Date: 2008/09/09 16:51:58 $'
+VERSION=$(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="$(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="${1}" targets
+ if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
+ targets=( $(find_targets ) )
+ target=${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 properly."
+ 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=( $(find_targets ) )
+ current=$(identify_target)
+ if [[ -n ${targets[@]} ]] ; then
+ for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
+ [[ ${targets[${i}]} == ${current} ]] && \
+ targets[${i}]="${targets[${i}]} $(highlight '*' )"
+ done
+ write_list_start "Available pdftex versions:"
+ write_numbered_list "${targets[@]}"
+ else
+ write_kv_list_entry "(none found)" ""
+ fi
+}
+
+### 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 "<target>"
+}
+
+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 remove 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}" == "--if-unset" ]] ) || \
+ die -q "Usage error"
+
+ if [[ -L "${ROOT}/usr/bin/pdftex" ]] ; then
+ [[ ${1} == "--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 remove manually"
+ elif ! [[ -z $(find_targets ) ]] ; then
+ set_symlinks 1 || die -q "Can't set a new version"
+ fi
+}
+
+# vim: set ft=eselect :
diff --git a/app-admin/eselect-pdftex/metadata.xml b/app-admin/eselect-pdftex/metadata.xml
new file mode 100644
index 000000000000..ba6a8a8800d5
--- /dev/null
+++ b/app-admin/eselect-pdftex/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>tex</herd>
+</pkgmetadata>