diff options
author | Alexis Ballier <aballier@gentoo.org> | 2007-10-20 12:51:25 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2007-10-20 12:51:25 +0000 |
commit | 489fd08f2e2b39be10efd1c76058cc14b59688c3 (patch) | |
tree | 2a8524ef82b9c651736fc1a542ca6f81dedbeab6 /eclass | |
parent | Excluded problematic patches. Fixes bug 196507. (diff) | |
download | gentoo-2-489fd08f2e2b39be10efd1c76058cc14b59688c3.tar.gz gentoo-2-489fd08f2e2b39be10efd1c76058cc14b59688c3.tar.bz2 gentoo-2-489fd08f2e2b39be10efd1c76058cc14b59688c3.zip |
add etexlinks helper function, use it for installing modules, bug #196246
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/texlive-common.eclass | 48 | ||||
-rw-r--r-- | eclass/texlive-module.eclass | 6 |
2 files changed, 52 insertions, 2 deletions
diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index 4bdbc34932e6..f21912bf27d4 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.1 2007/10/14 07:44:09 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.2 2007/10/20 12:51:25 aballier Exp $ # # Original Author: Alexis Ballier <aballier@gentoo.org> @@ -42,3 +42,49 @@ texlive-common_is_file_present_in_texmf() { find texmf-dist -name $1 -exec touch "${mark}" \; [ -f "${mark}" ] } + +# Mimic the install_link function of texlinks +# Should have the same behavior as the one in /usr/bin/texlinks +# except that it is under the control of the package manager +# Note that $1 corresponds to $src and $2 to $dest in this function +# ( Arguments are switched because texlinks main function sends them switched ) +# This function should not be called from an ebuild, prefer etexlinks that will +# also do the fmtutil file parsing. + +texlive-common_do_symlinks() { + while [ $# != 0 ]; do + case $1 in + cont-??|metafun|mptopdf) + elog "Symlink $1 skipped (special case)" + ;; + *) + if [ $1 = $2 ]; + then + elog "Symlink $1 -> $2 skipped" + elif [ -e "${D}/usr/bin/$1" ]; + then + elog "Symlink $1 skipped (file exists)" + else + elog "Making symlink from $1 to $2" + dosym $2 /usr/bin/$1 + fi + ;; + esac + shift; shift; + done +} + +# Mimic texlinks on a fmtutil format file +# $1 has to be a fmtutil format file like fmtutil.cnf +# etexlinks foo will install the symlinks that texlinks --cnffile foo would have +# created. We cannot use texlinks with portage as it is not DESTDIR aware. +# (It would not fail but will not create the symlinks if the target is not in +# the same dir as the source) +# Also, as this eclass must not depend on a tex distribution to be installed we +# cannot use texlinks from here. + +etexlinks() { + # Install symlinks from formats to engines + texlive-common_do_symlinks $(sed '/^[ ]*#/d; /^[ ]*$/d' "$1" | awk '{print $1, $2}') +} + diff --git a/eclass/texlive-module.eclass b/eclass/texlive-module.eclass index e055875f970e..e37e949b1801 100644 --- a/eclass/texlive-module.eclass +++ b/eclass/texlive-module.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.2 2007/10/17 14:34:09 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.3 2007/10/20 12:51:25 aballier Exp $ # # Original Author: Alexis Ballier <aballier@gentoo.org> @@ -81,6 +81,10 @@ texlive-module_src_compile() { # Install texmf and config files to the system texlive-module_src_install() { + for i in texmf/fmtutil/format*.cnf; do + [ -f "${i}" ] && etexlinks "${i}" + done + insinto /usr/share [ -d texmf ] && doins -r texmf [ -d texmf-dist ] && doins -r texmf-dist |