summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-lmtx-bin
blob: e590da3208fe154e0b463cc35f377a6c0231be3c (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
#!/bin/sh
# $Id$
# Public domain. Originally written 2023, Karl Berry.
# Download new luametatex binaries from the garden.

real0=`realpath $0`
mydir=`cd \`dirname "$real0"\` && pwd`  # Master/tlpkg/bin
Master=`cd $mydir/../.. && pwd`
test -z "$Master" && exit 1

cg=https://dl.contextgarden.net/build/luametatex/main

for cgplat in  \
  aarch64-linux \
  amd64-freebsd \
  armhf-linux \
  i386-freebsd \
  i386-linux \
  i386-solaris \
  x86_64-darwinlegacy \
  x86_64-linux \
  x86_64-linuxmusl \
  x86_64-solaris \
  x86_64-w64-mingw32 \
; do
  if test $cgplat = x86_64-w64-mingw32; then
    tlplat=windows
    exeext=.exe
  else
    tlplat=$cgplat
    exeext=
  fi
  cd $Master/bin/$tlplat || exit 1
  binfile=luametatex$exeext
  url=$cg/$cgplat/$binfile
  if wget -nv $url -O lmtx.new; then
    mv lmtx.new $binfile || exit 1
    echo "$tlplat/$binfile updated"
    if $tlplat = windows; then;
      cp -p $binfile context.exe
      cp -p $binfile mtxrun.exe
    fi
  else
    echo "$0: goodbye, wget failed: $url" >&2
    exit 1
  fi
done