/[gentoo-x86]/eclass/texlive-common.eclass
Gentoo

Diff of /eclass/texlive-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.1 2007/10/14 07:44:09 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.2 2007/10/20 12:51:25 aballier Exp $
4 4
5# 5#
6# Original Author: Alexis Ballier <aballier@gentoo.org> 6# Original Author: Alexis Ballier <aballier@gentoo.org>
7# Purpose: Provide various functions used by both texlive-core and texlive 7# Purpose: Provide various functions used by both texlive-core and texlive
8# modules. 8# modules.
40 local mark="${T}/$1.found" 40 local mark="${T}/$1.found"
41 find texmf -name $1 -exec touch "${mark}" \; 41 find texmf -name $1 -exec touch "${mark}" \;
42 find texmf-dist -name $1 -exec touch "${mark}" \; 42 find texmf-dist -name $1 -exec touch "${mark}" \;
43 [ -f "${mark}" ] 43 [ -f "${mark}" ]
44} 44}
45
46# Mimic the install_link function of texlinks
47# Should have the same behavior as the one in /usr/bin/texlinks
48# except that it is under the control of the package manager
49# Note that $1 corresponds to $src and $2 to $dest in this function
50# ( Arguments are switched because texlinks main function sends them switched )
51# This function should not be called from an ebuild, prefer etexlinks that will
52# also do the fmtutil file parsing.
53
54texlive-common_do_symlinks() {
55 while [ $# != 0 ]; do
56 case $1 in
57 cont-??|metafun|mptopdf)
58 elog "Symlink $1 skipped (special case)"
59 ;;
60 *)
61 if [ $1 = $2 ];
62 then
63 elog "Symlink $1 -> $2 skipped"
64 elif [ -e "${D}/usr/bin/$1" ];
65 then
66 elog "Symlink $1 skipped (file exists)"
67 else
68 elog "Making symlink from $1 to $2"
69 dosym $2 /usr/bin/$1
70 fi
71 ;;
72 esac
73 shift; shift;
74 done
75}
76
77# Mimic texlinks on a fmtutil format file
78# $1 has to be a fmtutil format file like fmtutil.cnf
79# etexlinks foo will install the symlinks that texlinks --cnffile foo would have
80# created. We cannot use texlinks with portage as it is not DESTDIR aware.
81# (It would not fail but will not create the symlinks if the target is not in
82# the same dir as the source)
83# Also, as this eclass must not depend on a tex distribution to be installed we
84# cannot use texlinks from here.
85
86etexlinks() {
87 # Install symlinks from formats to engines
88 texlive-common_do_symlinks $(sed '/^[ ]*#/d; /^[ ]*$/d' "$1" | awk '{print $1, $2}')
89}
90

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20