summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-man
blob: 3e78dd1aba533a2ede38a1cf7297481549b4c82d (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
#!/bin/sh
# $Id$
# Public domain.  Originally written 2008, Karl Berry.
# 
# This script is run by hand at the end of a release cycle to copy the
# man pages from the temporary install tree resulting from a normal
# build to the live Master hierarchy.

mydir=`cd \`dirname $0\` && pwd`
Master=`cd $mydir/../.. && pwd`
Build=`cd $Master/../Build && pwd`
Build_inst=`cd $Build/source/inst && pwd`

: ${TMPDIR=/tmp}

for sect in 1 5; do
  # existing:
  rundir=$Master/texmf/doc/man/man$sect
  (cd $rundir && ls) >$TMPDIR/now

  # from a current build:
  cd $Build_inst/share/man/man$sect || exit 1
  ls >$TMPDIR/new

  # omit symlinks since they are now files using .so.  (xxtodo should check)
  find -type f | sort | xargs tar cf - | (cd $rundir && tar xf -)

  # add new:
  comm -13 $TMPDIR/now $TMPDIR/new >$TMPDIR/needed.$sect
  test -s $TMPDIR/needed && (cd $rundir && svn add `cat $TMPDIR/needed`) 

  # do not delete, since some man pages aren't installed from the build,
  # but just in case we want to look:
  comm -23 $TMPDIR/now $TMPDIR/new | grep -v '\.pdf$' >>$TMPDIR/extraman.$sect
  
  # see what we've done:
  (cd $rundir && svn status)
done