summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-images
blob: a1c48e57cae066c660ea02e0f9682e766a0310d8 (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
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
#!/bin/sh -e
# $Id$
#
# Create the .iso file system images for TeX Live:
# a) live: the complete uncompressed system (for DVD)
# 
# Copyright 2003, 2004, 2005 Sebastian Rahtz.
# Copyright 2007, 2008 Karl Berry.
#
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
# In 2003, we also produced:
# c) demo: live subset which can be run as is (CD)
# but this was dropped in 2004.
#
# From 2004-2007, we also produced:
# b) inst: compressed zip files and installer only (CD)
# but this was dropped in 2008.
#
# Send bug reports or suggestions to tex-live@tug.org.

unset CDPATH  # avoid output from cd
umask 0
renice +19 -p $$ >/dev/null 2>&1

HERE=`cd \`dirname $0\` && /bin/pwd`
cd $HERE || exit 1  # the Master/tlpkg/bin directory
master=`cd ../.. && /bin/pwd`
test -z "$master" && exit 1

NAME=texlivetest
V=2008
D=`date +%Y%m%d`

debug=${OVERRIDE_DEBUG-false}
target=/home/ftp/texlive/Images/test
work=/home/texlive/tmp/TL_$$
quiet=  # for passing to mkisofs
makelive=true
mkisofs=mkisofs

while test $# -gt 0; do
  case $1 in
  --debug)     debug=true; quiet=;;
  --help)      echo "No help, use the source, sorry."; exit 0;;
  --mkisofs=*) mkisofs=`echo $1 | sed 's/.*=//'`;;
  --nolive)    makelive=false;;
  --quiet)     quiet=-quiet;;
  --source=*)  master=`echo $1 | sed 's/.*=//'`;;
  --work=*)    work=`echo $1 | sed 's/.*=//'`;;
  --target=*)  target=`echo $1 | sed 's/.*=//'`;;
   *) break;;
  esac
  shift
done

if $debug; then
  echo "master = $master"
  echo "target = $target"
  echo "work = $work"
fi
mkdir -p $target

# From the days when we made multiple images.  Keep it factored out in
# case they come back.
common_mkisofs_options=" $quiet -pad -J -dir-mode 0755 -r \
   -copyright LICENSE.TL \
   -x ./support/tests \
   -x .svn \
"

# 
MAKELIVE () {
  echo "-- `date` Writing live image to $live_iso."

  prefix=$target/$NAME$V
  live_iso=$prefix-$D.iso

  # remove old images and checksums.
  rm -f $prefix-*.iso* $prefix-*.md5 $prefix-*.sha256

  # The Master directory is the image.
  (cd $master || exit 1
   mkisofs $common_mkisofs_options -o $live_iso .
  )

  # also make compressed version, helps people downloading test images.
  lzma -v <$live_iso >$live_iso.lzma

  # make checksums
  # and symlinks with short names (potentially used in /etc/fstab).
  for ext in "" .lzma; do
    rm -f $prefix.iso$ext $prefix.iso$ext.md5 $prefix.iso$ext.sha256
    
    (cd $target && md5sum `basename $live_iso$ext`) >$live_iso$ext.md5
    (cd $target && sha256sum `basename $live_iso$ext`) >$live_iso$ext.sha256

    ln -s `basename $live_iso$ext` $prefix.iso$ext
    ln -s `basename $live_iso`$ext.md5 $prefix.iso$ext.md5
    ln -s `basename $live_iso`$ext.sha256 $prefix.iso$ext.sha256
    
    ls -l $live_iso$ext
  done
}


#  main program.

$makelive && MAKELIVE 

rm -rf $work