Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: texlive-common.eclass texlive-module.eclass
Date: Sat, 20 Oct 2007 13:02:10
Message-Id: E1IjDna-0007D1-60@stork.gentoo.org
1 aballier 07/10/20 12:51:26
2
3 Modified: texlive-common.eclass texlive-module.eclass
4 Log:
5 add etexlinks helper function, use it for installing modules, bug #196246
6
7 Revision Changes Path
8 1.2 eclass/texlive-common.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-common.eclass?rev=1.2&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-common.eclass?rev=1.2&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-common.eclass?r1=1.1&r2=1.2
13
14 Index: texlive-common.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v
17 retrieving revision 1.1
18 retrieving revision 1.2
19 diff -u -r1.1 -r1.2
20 --- texlive-common.eclass 14 Oct 2007 07:44:09 -0000 1.1
21 +++ texlive-common.eclass 20 Oct 2007 12:51:25 -0000 1.2
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2007 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.1 2007/10/14 07:44:09 aballier Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-common.eclass,v 1.2 2007/10/20 12:51:25 aballier Exp $
27
28 #
29 # Original Author: Alexis Ballier <aballier@g.o>
30 @@ -42,3 +42,49 @@
31 find texmf-dist -name $1 -exec touch "${mark}" \;
32 [ -f "${mark}" ]
33 }
34 +
35 +# Mimic the install_link function of texlinks
36 +# Should have the same behavior as the one in /usr/bin/texlinks
37 +# except that it is under the control of the package manager
38 +# Note that $1 corresponds to $src and $2 to $dest in this function
39 +# ( Arguments are switched because texlinks main function sends them switched )
40 +# This function should not be called from an ebuild, prefer etexlinks that will
41 +# also do the fmtutil file parsing.
42 +
43 +texlive-common_do_symlinks() {
44 + while [ $# != 0 ]; do
45 + case $1 in
46 + cont-??|metafun|mptopdf)
47 + elog "Symlink $1 skipped (special case)"
48 + ;;
49 + *)
50 + if [ $1 = $2 ];
51 + then
52 + elog "Symlink $1 -> $2 skipped"
53 + elif [ -e "${D}/usr/bin/$1" ];
54 + then
55 + elog "Symlink $1 skipped (file exists)"
56 + else
57 + elog "Making symlink from $1 to $2"
58 + dosym $2 /usr/bin/$1
59 + fi
60 + ;;
61 + esac
62 + shift; shift;
63 + done
64 +}
65 +
66 +# Mimic texlinks on a fmtutil format file
67 +# $1 has to be a fmtutil format file like fmtutil.cnf
68 +# etexlinks foo will install the symlinks that texlinks --cnffile foo would have
69 +# created. We cannot use texlinks with portage as it is not DESTDIR aware.
70 +# (It would not fail but will not create the symlinks if the target is not in
71 +# the same dir as the source)
72 +# Also, as this eclass must not depend on a tex distribution to be installed we
73 +# cannot use texlinks from here.
74 +
75 +etexlinks() {
76 + # Install symlinks from formats to engines
77 + texlive-common_do_symlinks $(sed '/^[ ]*#/d; /^[ ]*$/d' "$1" | awk '{print $1, $2}')
78 +}
79 +
80
81
82
83 1.3 eclass/texlive-module.eclass
84
85 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-module.eclass?rev=1.3&view=markup
86 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-module.eclass?rev=1.3&content-type=text/plain
87 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/texlive-module.eclass?r1=1.2&r2=1.3
88
89 Index: texlive-module.eclass
90 ===================================================================
91 RCS file: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v
92 retrieving revision 1.2
93 retrieving revision 1.3
94 diff -u -r1.2 -r1.3
95 --- texlive-module.eclass 17 Oct 2007 14:34:09 -0000 1.2
96 +++ texlive-module.eclass 20 Oct 2007 12:51:25 -0000 1.3
97 @@ -1,6 +1,6 @@
98 # Copyright 1999-2004 Gentoo Foundation
99 # Distributed under the terms of the GNU General Public License v2
100 -# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.2 2007/10/17 14:34:09 aballier Exp $
101 +# $Header: /var/cvsroot/gentoo-x86/eclass/texlive-module.eclass,v 1.3 2007/10/20 12:51:25 aballier Exp $
102
103 #
104 # Original Author: Alexis Ballier <aballier@g.o>
105 @@ -81,6 +81,10 @@
106 # Install texmf and config files to the system
107
108 texlive-module_src_install() {
109 + for i in texmf/fmtutil/format*.cnf; do
110 + [ -f "${i}" ] && etexlinks "${i}"
111 + done
112 +
113 insinto /usr/share
114 [ -d texmf ] && doins -r texmf
115 [ -d texmf-dist ] && doins -r texmf-dist
116
117
118
119 --
120 gentoo-commits@g.o mailing list