summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer/install-tl.sh
blob: 5dc1b2da7bd8a11bf997e967b06283aa37639498 (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
#!/bin/sh

# default: tcl gui or not
if test `uname -s` = Darwin; then
  tcl=yes
else
  tcl=no
fi
# are there reasons not to use the tcl gui?
notcl=no

unset wait_for_gui
unset gui_set

# We need "$@" syntax because some parameters may contain spaces.
# In order to make use of this syntax we must pass along ALL parameters.
for p in "$@"; do
  # TODO: sanitize $p; abort if necessary
  case $p in
    -tcl | --tcl)
      if test $gui_set; then echo Gui set more than once; exit 1; fi
      gui_set=1
      unset wait_for_gui
      tcl=yes
      ;;
    -print-platform | --print-platform | -version | --version)
      unset wait_for_gui
      notcl=yes
      ;;
    -gui | --gui)
      if test $gui_set; then echo Gui set more than once; exit 1; fi
      gui_set=1
      tcl=yes
      wait_for_gui=1
      ;;
    --gui=* | -gui=*)
      if test $gui_set; then echo Gui set more than once; exit 1; fi
      gui_set=1
      if test $p = -gui=text -o $p = --gui=text; then
        tcl=no
      else
        tcl=yes
      fi
      unset wait_for_gui
      ;;
    -no-gui | --no-gui)
      unset wait_for_gui
      notcl=yes
      ;;
    *)
      if test $wait_for_gui; then
        if test $p = text; then
          tcl=no
        else
          tcl=yes
        fi
        unset wait_for_gui
      fi
      ;;
  esac
done
if test $notcl = yes; then
  tcl=no
fi

# silence perl locale warnings
PERL_BADLANG=0
export PERL_BADLANG

# We can safely pass all original parameters to perl:
# In install-tl[.pl], from_ext_gui will overrule the gui parameter.
# The lang parameter will be handled by tcl and not come into play in perl

if test "$tcl" = "yes"; then
  wish `dirname $0`/install-tl-gui.tcl -- "$@" &
else
  perl `dirname $0`/../../install-tl "$@"
fi