summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-linked-scripts
blob: 75504eafdb65ec5f9a0502bbd3b41920009a5597 (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
#!/bin/sh
# $Id$
# Public domain.  Originally written 2011, Peter Breitenlohner.
#
# This script updates the linked scripts (but doesn't commit anything).

mydir=`cd \`dirname $0\` && pwd`
Master=`cd $mydir/../.. && pwd`

compare_and_copy () {
  for file in "$@"; do
    #echo "comparing $Src/$file to $Dest..."
    echo "$file" | grep '/context.sh$' >/dev/null && continue # context in flux
    
    cmp -s $Src/$file $Dest/$file && continue
    
    echo "updating $Src/$file -> $Dest/$file"
    diff -u0 $Src/$file $Dest/$file
    cp $Src/$file $Dest/$file || exit 1
  done
}

# Master/texmf-dist/scripts => Build/source/texk/texlive/linked_scripts

Dest=`cd $Master/../Build/source/texk/texlive/linked_scripts && pwd`
Src=$Master/texmf-dist/scripts

test -r $Dest/scripts.lst || {
  echo "$0: \`$Dest/scripts.lst' missing'"
  exit 1
}

# echo "$Src => $Dest"

. $Dest/scripts.lst

compare_and_copy $texmf_scripts

# Build/source/texk/texlive/tl_scripts => Master/texmf-dist/scripts/texlive

Src=`cd $Dest/../tl_scripts && pwd`
Dest=$Master/texmf-dist/scripts/texlive

test -r $Src/scripts.lst || {
  echo "$0: \`$Src/scripts.lst' missing'"
  exit 1
}

# echo "$Src => $Dest"

. $Src/scripts.lst

compare_and_copy $tl_scripts