1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
#!/bin/sh
# $Id$
#
# install-pkg.sh -- install individual packages from live distributions
# into running installations.
#
# Copyright (c) Thomas Esser, Sebastian Rahtz, 1996, 1997, 1998, 1999,
# 2002, 2003, 2004, 2005.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# Send bug reports or suggestions to tex-live@tug.org.
#
# Call this script with a full-featured bourne shell, which may be
# /bin/sh, /bin/bsh (e.g. AIX-4.XX), /bin/sh5 (e.g. ULTRIX) or
# /bin/bash (on GNU systems) on your system.
HERE=`cd \`dirname $0\` && /bin/pwd`
. $HERE/utils.sh
list_files()
{
this=$1
$verbose && echo " list_files $this"
morecols=`grep "^-" $this | sed 's/.//'`
packages=`grep "^+" $this | sed 's/.//'`
grep "^[a-z]" $this >> tmp
for i in $packages; do
if echo "$i" | grep '^collection-' >/dev/null; then
echo "(ignoring dependency on collection $i)"
continue
fi
list_files $LISTS/$i
done
# tex4ht's binaries are in bin-tex4htk.<system>. Sigh.
# otherwise, binaries are in bin-<name>.<system>, whereas bin-<name>
# itself has arch-independent files, like pool files.
name=`basename $this`
for binlist in bin-$name bin-$name.$System bin-${name}k.$System; do
if test -f $LISTS/$binlist; then
$verbose && echo " found binary $binlist"
grep "^[a-z]" $LISTS/$binlist >> tmp
fi
done
for p in $morecols; do
echo "(skipping dependency on collection $p)"
done
}
TAROPT=""
TARPROG=tar
list=false; src=true; doc=true; hash=true; config=false;verbose=false
unset col pkg tarfile cddir
while test $# -gt 0; do
case $1 in
-p) if test $# -ge 2; then
pkg=$2; shift
else
fatal "Missing argument for -p"
fi;;
--collection=*)
col=`echo $1 | sed -e 's/.*=//' -e 's/collection-//'`;;
--package=*)
pkg=`echo $1 | sed 's/.*=//'`;;
--nodoc)
doc=false;;
--nosrc)
src=false;;
--nohash)
hash=false;;
--texconfig)
config=true;;
--listonly)
list=true;;
--verbose)
verbose=true;;
--archive=*)
tarfile=`echo $1 | sed 's/.*=//'`
list=false;;
--cddir=*)
cddir=`echo $1 | sed 's/.*=//'`;;
--listdir=*)
listdir=`echo $1 | sed 's/.*=//'`;;
*) echo "$0: $1 is not a valid option, goodbye." >&2; exit 1;;
esac
shift
done
TARPROG=tar
TAROPT=""
find_tar
thisdir=`pwd`
CDDIR=${cddir-${OVERRIDE_CDDIR-$thisdir}}
LISTS=${listdir-${OVERRIDE_LISTS-$CDDIR/texmf/lists}}
work_dir=${TMP-/tmp}/.tmp.pkginst.$$
trap 'cd /; rm -rf $work_dir; trap 0' 0 1 2 15
{ mkdir $work_dir && cd $work_dir; } || exit
test -d $LISTS || fatal "$0: $LISTS: no such directory. Are you sure this is the TeX Live CD?"
: ${TEXMF=`kpsewhich -expand-var '$TEXMFMAIN'`}
: ${TEXMFSYSVAR=`kpsewhich -expand-var '$TEXMFSYSVAR'`}
TEXDIR=`echo $TEXMF | sed 's/texmf.*//'`
platform_guess
cd $work_dir
touch files
filters="| grep -v '^ *$' "
$src || filters="$filters | grep -v texmf-dist/source/"
$doc || filters="$filters | grep -v texmf-dist/doc/"
System=`echo $Sys | sed 's/_/-/g'`
if $verbose; then
echo Package [$pkg] / Collection [$col] >&2
echo Install point is $TEXDIR >&2
echo Install binaries for system $System >&2
fi
if test -n "$col"; then
colfile=$LISTS/collection-$col
if test -f $colfile; then
:>tmp
list_files $LISTS/collection-$col
eval sort < tmp $filters | grep -v '^\!' | uniq > files
eval grep '\^\!' tmp | tr ' ' '=' > jobs
rm tmp
else
echo "$0: $col: no such collection (missing $colfile)."
fi
fi
if test -n "$pkg"; then
pkgfile=$LISTS/$pkg
if test -f $pkgfile; then
:>tmp
list_files $LISTS/$pkg
eval sort < tmp $filters | grep -v '^\!' | uniq > files
eval grep '\^\!' tmp | tr ' ' '=' > jobs
else
echo "$0: $pkg: no such package (missing $pkgfile)." >&2
exit 1
fi
fi
if $list; then
cat files
exit
fi
if test -n "$tarfile"; then
case $tarfile in
/*) : ;;
*) tarfile=$thisdir/$tarfile;;
esac
if test "x$TAROPT" = "x"; then
echo "$0: archive option is not supported on this system." >&2
else
echo Package [$pkg] / Collection [$col] being tarred up into $tarfile
cd $CDDIR; $TARPROG -c -f $tarfile $TAROPT $work_dir/files
fi
exit
fi
test -z $pkg$col && exit
if $verbose; then
echo Files to be copied: >&2
cat files >&2
echo >&2
fi
if test "x$TAROPT" = "x"; then
(
cd "$CDDIR"
TARPROG=$TARPROG TEXDIR=$TEXDIR $XARGS \
sh -c '$TARPROG cf - "$@" | (cd "$TEXDIR"; umask 0; $TARPROG xf -)' sh
) <$work_dir/files
else
(cd $CDDIR; $TARPROG -c -f - $TAROPT $work_dir/files) | (cd $TEXDIR; umask 0; $TARPROG -x -f -)
fi
X=`kpsewhich language.dat`
if test -n "$X"; then
cd `dirname $X`
Z=`pwd`
if $verbose; then
echo Making language.dat in $Z >&2
echo " from your language selections." >&2
fi
Y=`kpsewhich language.us`
cd `dirname $Y`
cat language.us language.*.dat > $Z/language.dat
fi
for f in `ls $work_dir/jobs`
do
$verbose && echo " do work items listed in $f" >&2
for j in `sort $f | uniq`
do
command=`echo $j | sed 's/.\(.*\)=.*/\1/'`
parameter=`echo $j | sed 's/.*=\(.*\)/\1/'`
$verbose && echo " EXECUTE $command on $parameter" >&2
case $command in
addMap)
echo "Map $parameter" >> $TEXMFSYSVAR/web2c/updmap.cfg;;
addMixedMap)
echo "MixedMap $parameter" >> $TEXMFSYSVAR/web2c/updmap.cfg;;
addDvipsMap)
echo "p +$parameter" >> $TEXMFSYSVAR/dvips/config/config.ps;;
addDvipdfmMap)
test -f $TEXMFSYSVAR/dvipdfm/config/config && echo "f $parameter" >> $TEXMFSYSVAR/dvipdfm/config/config;;
esac
done
done
: ${TEXMFDIST=`kpsewhich -expand-var '$TEXMFDIST'`}
$hash && mktexlsr $TEXMF $TEXMFDIST
updmap-sys --nohash --cnffile=$TEXMFSYSVAR/web2c/updmap.cfg \
--dvipsoutputdir=$TEXMFSYSVAR/fonts/map/dvips/updmap \
--dvipdfmoutputdir=$TEXMFSYSVAR/fonts/map/dvipdfm/updmap \
--pdftexoutputdir=$TEXMFSYSVAR/fonts/map/pdftex/updmap
$config && texconfig-sys init
$config || echo "PLEASE RUN texconfig or texconfig-sys to make new formats."
|