#!/bin/sh # $Id$ # # install-pkg-compr.sh -- install individual packages from the compressed # (inst) distribution into running installations. # # Copyright (c) Thomas Esser, Sebastian Rahtz 1996, 1997, 1998, 1999, # 2002, 2003, 2004, 2005, 2006. # # 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 . $HERE/common.sh list_bundle() { name=$1 if test -f $CDDIR/archive/$name.zip; then echo $name >> LIST morecols=`grep "^-" $LISTS/$name | sed 's/.//'` packages=`grep "^+" $LISTS/$name | sed 's/.//'` grep "^[a-z]" $LISTS/$name >> tmp else echo "(missing archive $CDDIR/archive/$name.zip)" fi for i in $packages; do if echo "$i" | grep '^collection-' >/dev/null; then echo "(ignoring dependency on collection $i)" continue fi test -f $CDDIR/archive/$i.zip && list_bundle $i done # (see comments in install-pkg-compr.sh about the bin lists we check.) for binlist in bin-$name bin-$name.$System bin-${name}k.$System; do if test -f $LISTS/$binlist; then $verbose && echo "found binary $binlist" echo $binlist >> LIST grep "^[a-z]" $LISTS/$binlist >> tmp fi done for p in $morecols; do echo "(skipping dependency on collection $p)" done } list=false; src=true; doc=true; hash=true; config=false;verbose=false unset col pkg cddir : ${TEXMF=`kpsewhich -expand-var '$TEXMFMAIN'`} : ${TEXMFSYSVAR=`kpsewhich -expand-var '$TEXMFSYSVAR'`} TEXDIR=`echo $TEXMF | sed 's/texmf.*//'` # Require it to exist. if test ! -d $TEXDIR; then echo "$0: No directory $TEXDIR." >&2 echo "$0: Set TEXMFMAIN to override, or make the directory." >&2 echo "$0: (or use --archive to make a tar archive instead of installing.)">&2 exit 1 fi while test $# -gt 0; do case $1 in -p) if test $# -ge 2; then pkg=$2; shift else fatal "Missing argument for -p" fi;; --texdir=*) TEXDIR=`echo $1 | sed 's/.*=//'`;; --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;; --noconfig) config=false;; --config) config=true;; --listonly) list=true;; --verbose) verbose=true;; --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 thisdir=`pwd` CDDIR=${cddir-${OVERRIDE_CDDIR-$thisdir}} LISTS=${listdir-${OVERRIDE_LISTS-$CDDIR/texmf/lists}} work_dir=${TMP-/tmp}/tmpkginst.$$ trap 'cd /; rm -rf $work_dir; trap 0' 0 1 2 15 { mkdir $work_dir && cd $work_dir; } || exit test -d $CDDIR || fatal "$0: $CDDIR: no such directory. Are you sure this is the TeX Live CD?" platform_guess find_echo cd $work_dir || exit 1 filters=" " $src || filters="$filters texmf-dist/source\*" $doc || filters="$filters 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_bundle collection-$col eval grep '\^\!' tmp | tr ' ' '=' > jobs rm tmp else echo "$0: $col: no such collection (missing $colfile)." >&2 fi fi if test -n "$pkg"; then pkgfile=$LISTS/$pkg if test -f $pkgfile; then :>tmp list_bundle $pkg eval grep '\^\!' tmp | tr ' ' '=' > jobs else echo "$0: $pkg: no such package (missing $pkgfile)." >&2 exit 1 fi fi if $list; then for f in `sort -u $work_dir/LIST` do if test -f $CDDIR/archive/$f.zip then $verbose && echo list $CDDIR/archive/$f.zip >&2 unzip -l $CDDIR/archive/$f.zip fi done exit fi zipoption=" -qq " $verbose && zipoption="" test -z $pkg$col && exit $verbose && echo "unpack in $TEXDIR" >&2 for f in `sort -u $work_dir/LIST` do if test -f $CDDIR/archive/$f.zip then $verbose && echo " Install files from $f" >&2 (cd $TEXDIR && unzip -o $zipoption $CDDIR/archive/$f -x $filters) fi done $verbose && echo "* Done unpacking." >&2 if $config then $verbose && echo "Files unpacked only. No configuration done" exit 0 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 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/'` 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."