summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/c2lx
blob: f9c0e0e575461c9cc0e52726aa3f5f50a49aac2b (plain)
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
#!/bin/sh 
# $Id$
# Originally written by Karl Berry. Public domain.
# 
# Front-front-end script for c2l to update
# (with first arg "3") LaTeX3,
# or (with first arg "e") LaTeX2e,
# or (with first arg "dev") LaTeX-dev,
# etc.,
# each of which is comprised of several packages to be updated together.
# 
# Look at the end of the output for the summarized results for each
# package, e.g., to see if any files ended up getting misplaced.
# 
# Final argument "p" runs place also (same as c2l --place).

placebase=${TMPDIR-/tmp}/`id -u`.tlplace
dirsfile=$placebase.dirs
firstfile=$placebase.first
tmpfile=$placebase.tmp
c2loutfile=$placebase.c2lout

if test "x$1" = xe || test "x$1" = x2e; then
  shift; label=l2e
  pkgs="amsmath cyrillic graphics tools latex firstaid latex-lab l3build"
elif test "x$1" = xdev; then
  shift; label=ldev
  pkgs="latex-amsmath-dev latex-firstaid-dev latex-graphics-dev latex-lab-dev"
  pkgs="$pkgs latex-tools-dev latex-base-dev l3build"
elif test "x$1" = x3; then
  shift; label=l3
  pkgs="l3kernel l3packages l3experimental l3build l3backend"
elif test "x$1" = x3dev; then
  shift; label=l3dev
  pkgs="l3kernel-dev l3backend-dev"
elif test "x$1" = xdeng; then
  shift; label=deng
  pkgs="elegantbook elegantnote elegantpaper"
elif test "x$1" = xhep; then
  shift; label=hep
  pkgs="hep-font hep-math-font hep-acronym hep-bibliography hep-float"
  pkgs="$pkgs hep-graphic hep-math hep-paper hep-reference hep-text hep-title"
elif test "x$1" = xjxu; then
  shift; label=jxu
  pkgs="colorist crefthe einfart minimalist simplivre"
  #pkgs="$pkgs beaulivre  create-theorem mindflow projlib q-and-a homework lebhart"
elif test "x$1" = xminim-all; then
  shift; label=minim
  pkgs="minim-hatching minim-math minim-mp minim-pdf minim-xmp minim"
else
  echo "$0: unknown latex or group type: $1" >&2
  echo "$0: must be one of: e dev 3 3dev ... minim-all (USTL)." >&2
  exit 1
fi

echo "`basename $0`: $label pkgs: $pkgs"

# 
for p in $pkgs; do
  echo "${label} pkg $p" >&2 # progress report of a sort
  printf "\f ${label} pkg $p\n"
  # each c2l call creates various; combine the directory lists and output.
  c2l "$@" $p | tee $c2loutfile
  sed -n "1,/`printf '\f'`/p" $c2loutfile >>$firstfile # first part of output
  echo >>$firstfile
  cat $dirsfile >>$tmpfile
done

sort -u $tmpfile >$dirsfile
wc $dirsfile
echo
cat $firstfile