summaryrefslogtreecommitdiff
path: root/Master/Tools/update-auto
blob: 83d50fb79c3840ecc679643ac1ce01a5d39db8fc (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
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
#!/bin/sh
# $Id: //depot/Master/Tools/update-auto#47 $  $Date: 2005/10/07 $  $Author: karl $
# Public domain.  Originally written 2003, Karl Berry.
# 
# Deal with files that are automatically updated in one way or another.
# 
# We should rewrite this to use rdist or make or something, but we'll
# stick with this kludgy approach as long as we have perforce.

PATH=/usr/local/bin:$PATH; export PATH
umask 0

# most stuff in Master.
Master=`cd \`dirname $0\`/.. && /bin/pwd`
cd $Master || exit 1

temp=/tmp/ua$$
trap "rm -f $temp*" 0 1 2 15

#  autogenerate README.EN from readme.html.
# 
./Tools/htmltext <readme.en.html >$temp
if diff $temp README.EN; then
  echo "  README.EN ok."
else
  p4 edit README.EN || exit 1
  mv $temp README.EN
  #
  printf "Change: new
Description:
\t$0 (from readme.en.html)
Files:
\t//depot/Master/README.EN
" | p4 submit -i README.EN
fi


#  English FAQ from ctan mirror on tug.org.
#
faqmaster=/home/ftp/tex-archive/help/uk-tex-faq
faqslave=texmf-doc/doc/english/FAQ-en
for f in $faqmaster/*; do
  # ignore some of the generated files
  echo $f | egrep '(tar.gz|dvi|ps|letterfaq.pdf)$' >/dev/null \
  && continue

  basef=`basename $f`
  faqslavef=$faqslave/$basef
  if diff $faqslavef $f; then
    echo "    $faqslavef ok."
  else
    p4 edit $faqslavef || exit 1
    cp $f $faqslavef
    printf "Change: new
Description:
\t$0 (from $f)
Files:
\t//depot/Master/$faqslavef
" | p4 submit -i $faqslavef
  fi
done
# for now, don't bother auto-updating the html files.


#  modes.mf from elsewhere on tug.org.
#
modesmaster=/home/ftp/tex/modes.mf
modesslave=texmf-dist/metafont/misc/modes.mf
#
if diff $modesslave $modesmaster; then
  echo "  $modesslave ok."
else
  p4 edit $modesslave || exit 1
  cp $modesmaster $modesslave
  #
  printf "Change: new
Description:
\t$0 (from `hostname`:$modesmaster)
Files:
\t//depot/Master/$modesslave
" | p4 submit -i $modesslave
fi


#  texinfo.tex from elsewhere on tug.org.
#
tximaster=/home/ftp/tex/texinfo.tex
txislave=texmf-dist/tex/texinfo/texinfo.tex
#
if diff $txislave $tximaster; then
  echo "  $txislave ok."
else
  p4 edit $txislave || exit 1
  cp $tximaster $txislave
  #
  printf "Change: new
Description:
\t$0 (from `hostname`:$tximaster)
Files:
\t//depot/Master/$txislave
" | p4 submit -i $txislave
fi


#  fontname from elsewhere on tug.org.
# 
fontnamemaster=/home/httpd/html/fontname
fontnamedocslave=texmf-dist/doc/fontname
#
for basef in ChangeLog Makefile bitstrea.aka \
             fontname.pdf fontname.html fontname.texi; do
  fontnameslavef=$fontnamedocslave/$basef
  if diff $fontnameslavef $fontnamemaster/$basef; then
    echo "   $fontnameslavef ok."
  else
    p4 edit $fontnameslavef || exit 1
    cp $fontnamemaster/$basef $fontnameslavef
    printf "Change: new
Description:
\t$0 (from $basef)
Files:
\t//depot/Master/$fontnameslavef
" | p4 submit -i $fontnameslavef
  fi
done


# fontname runtime files.
#
fontnamemapslave=texmf-dist/fonts/map/fontname
#
files=`cd $fontnamemaster && ls *.map`
for basef in $files; do
  test $basef = wolfram.map && continue   # obsolete for TL
  fontnamemapslavef=$fontnamemapslave/$basef
  if diff $fontnamemapslavef $fontnamemaster/$basef; then
    echo "   $fontnamemapslavef ok."
  else
    p4 edit $fontnamemapslavef || exit 1
    cp $fontnamemaster/$basef $fontnamemapslavef
    printf "Change: new
Description:
\t$0 (from $basef)
Files:
\t//depot/Master/$fontnamemapslavef
" | p4 submit -i $fontnamemapslavef
  fi
done
 

fontnameencslave=texmf-dist/fonts/enc/dvips/base
#
files=`cd $fontnamemaster && ls *.enc`
for basef in $files; do
  fontnameencslavef=$fontnameencslave/$basef
  if diff $fontnameencslavef $fontnamemaster/$basef; then
    echo "   $fontnameencslavef ok."
  else
    p4 edit $fontnameencslavef || exit 1
    cp $fontnamemaster/$basef $fontnameencslavef
    printf "Change: new
Description:
\t$0 (from $basef)
Files:
\t//depot/Master/$fontnameencslavef
" | p4 submit -i $fontnameencslavef
  fi
done
 

#  doc.html.
doctemp=docnew.html
./Tools/mkdocindex | tee $doctemp | grep -v '<small>Generated' >$doctemp.new
grep -v '<small>Generated' doc.html >$doctemp.cur
if diff $doctemp.cur $doctemp.new; then
  echo "  doc.html ok."
else
  p4 edit doc.html || exit 1
  mv $doctemp doc.html
  #
  printf "Change: new
Description:
\t$0 (from mkdocindex)
Files:
\t//depot/Master/doc.html
" | p4 submit -i doc.html
fi
rm $doctemp*


#  config.{guess,sub} from GNU.
# 
updated=
for gnuconf in config.guess config.sub; do
  wget -O $temp "http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/$gnuconf?rev=HEAD&content-type=text/plain" >$temp.2 2>&1
  if test ! -s $temp; then
    echo "$0: skipping, could not retrieve $gnuconf:" >&2
    cat $temp.2
    continue
  fi
  if cmp -s $temp $gnuconf; then
    echo "  $gnuconf ok."
  else
    # autoupdate all copies in source.
   (cd ..
    alldev="Master/$gnuconf `find Build/source Build/source.development -name $gnuconf`"
    for f in $alldev; do
      echo "  updating $f."
      p4 edit $f || continue
      cp -pf $temp $f
    done
    p4 change -o \
    | sed "s!<enter description here>!$gnuconf update by $0!" \
    | p4 submit -i
   )
  fi
done