author | wenzelm |
Wed, 14 Apr 2021 14:28:30 +0200 | |
changeset 73579 | 8ddf6728ad80 |
parent 73513 | b7bb665fe850 |
child 73580 | a96564139fa7 |
permissions | -rw-r--r-- |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
1 |
# -*- shell-script -*- :mode=shellscript: |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
2 |
# |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
3 |
# Author: Makarius |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
4 |
# |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
5 |
# Isabelle shell functions, with on-demand re-initialization for |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
6 |
# non-interactive bash processess. NB: bash shell functions are not portable |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
7 |
# and may be dropped by aggressively POSIX-conformant versions of /bin/sh. |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
8 |
|
62416 | 9 |
if type splitarray >/dev/null 2>/dev/null |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
10 |
then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
11 |
: |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
12 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
13 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
14 |
if [ "$OSTYPE" = cygwin ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
15 |
function platform_path() { cygpath -i -C UTF8 -w -p "$@"; } |
69157 | 16 |
function standard_path() { cygpath -i -u -p "$@" | tr -d '\r'; } |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
17 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
18 |
function platform_path() { echo "$@"; } |
69157 | 19 |
function standard_path() { echo "$@"; } |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
20 |
fi |
69157 | 21 |
export -f platform_path standard_path |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
22 |
|
72894
bd2269b6cd99
updated "macOS" terminology: current Big Sur is already version 11;
wenzelm
parents:
72465
diff
changeset
|
23 |
#GNU tar (notably on macOS) |
73579 | 24 |
function tar() { "${ISABELLE_TAR:-false}" "$@"; } |
25 |
export -f tar |
|
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
26 |
|
69134 | 27 |
#OCaml management via OPAM |
73500 | 28 |
function isabelle_opam () |
69134 | 29 |
{ |
30 |
if [ -z "$ISABELLE_OPAM" ]; then |
|
31 |
echo "Unknown ISABELLE_OPAM -- OCaml management tools unavailable" >&2 |
|
32 |
return 127 |
|
33 |
else |
|
72465 | 34 |
env OPAMROOT="$ISABELLE_OPAM_ROOT" OPAMCOLOR="never" "$ISABELLE_OPAM" "$@" |
69134 | 35 |
fi |
36 |
} |
|
37 |
export -f isabelle_opam |
|
38 |
||
69150 | 39 |
#GHC management via Stack |
73500 | 40 |
function isabelle_stack () |
69147 | 41 |
{ |
42 |
if [ -z "$ISABELLE_STACK" ]; then |
|
69150 | 43 |
echo "Unknown ISABELLE_STACK -- GHC management tools unavailable" >&2 |
69147 | 44 |
return 127 |
45 |
else |
|
69267
517655a528fe
always insist in specified resolver/compiler version;
wenzelm
parents:
69255
diff
changeset
|
46 |
env STACK_ROOT="$(platform_path "$ISABELLE_STACK_ROOT")" "$ISABELLE_STACK" --resolver "$ISABELLE_STACK_RESOLVER" --compiler "$ISABELLE_GHC_VERSION" "$@" |
69147 | 47 |
fi |
48 |
} |
|
49 |
export -f isabelle_stack |
|
50 |
||
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
51 |
#robust invocation via ISABELLE_JDK_HOME |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
52 |
function isabelle_jdk () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
53 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
54 |
if [ -z "$ISABELLE_JDK_HOME" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
55 |
echo "Unknown ISABELLE_JDK_HOME -- Java development tools unavailable" >&2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
56 |
return 127 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
57 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
58 |
local PRG="$1"; shift |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
59 |
"$ISABELLE_JDK_HOME/bin/$PRG" "$@" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
60 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
61 |
} |
62413 | 62 |
export -f isabelle_jdk |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
63 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
64 |
#robust invocation via JAVA_HOME |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
65 |
function isabelle_java () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
66 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
67 |
if [ -z "$JAVA_HOME" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
68 |
echo "Unknown JAVA_HOME -- Java unavailable" >&2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
69 |
return 127 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
70 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
71 |
local PRG="$1"; shift |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
72 |
"$JAVA_HOME/bin/$PRG" "$@" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
73 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
74 |
} |
62413 | 75 |
export -f isabelle_java |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
76 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
77 |
#robust invocation via SCALA_HOME |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
78 |
function isabelle_scala () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
79 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
80 |
if [ -z "$JAVA_HOME" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
81 |
echo "Unknown JAVA_HOME -- Java unavailable" >&2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
82 |
return 127 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
83 |
elif [ -z "$SCALA_HOME" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
84 |
echo "Unknown SCALA_HOME -- Scala unavailable" >&2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
85 |
return 127 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
86 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
87 |
local PRG="$1"; shift |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
88 |
"$SCALA_HOME/bin/$PRG" "$@" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
89 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
90 |
} |
62413 | 91 |
export -f isabelle_scala |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
92 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
93 |
#classpath |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
94 |
function classpath () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
95 |
{ |
66667
2e580fcf6522
avoid local shell variables intruding the resulting environment (via "set -o allexport" in getsettings);
wenzelm
parents:
63994
diff
changeset
|
96 |
local X="" |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
97 |
for X in "$@" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
98 |
do |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
99 |
if [ -z "$ISABELLE_CLASSPATH" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
100 |
ISABELLE_CLASSPATH="$X" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
101 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
102 |
ISABELLE_CLASSPATH="$ISABELLE_CLASSPATH:$X" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
103 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
104 |
done |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
105 |
export ISABELLE_CLASSPATH |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
106 |
} |
62413 | 107 |
export -f classpath |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
108 |
|
73513
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
109 |
#java_library |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
110 |
function java_library () |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
111 |
{ |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
112 |
local X="" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
113 |
for X in "$@" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
114 |
do |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
115 |
case "$ISABELLE_PLATFORM_FAMILY" in |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
116 |
linux) |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
117 |
if [ -z "$LD_LIBRARY_PATH" ]; then |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
118 |
export LD_LIBRARY_PATH="$X" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
119 |
else |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
120 |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$X" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
121 |
fi |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
122 |
;; |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
123 |
macos) |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
124 |
if [ -z "$JAVA_LIBRARY_PATH" ]; then |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
125 |
export JAVA_LIBRARY_PATH="$X" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
126 |
else |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
127 |
export JAVA_LIBRARY_PATH="$JAVA_LIBRARY_PATH:$X" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
128 |
fi |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
129 |
;; |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
130 |
windows) |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
131 |
if [ -z "$PATH" ]; then |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
132 |
export PATH="$X" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
133 |
else |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
134 |
export PATH="$PATH:$X" |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
135 |
fi |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
136 |
;; |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
137 |
esac |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
138 |
done |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
139 |
export ISABELLE_CLASSPATH |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
140 |
} |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
141 |
export -f java_library |
b7bb665fe850
more systematic java_library: avoid empty entries, declaration order as for other bash functions;
wenzelm
parents:
73500
diff
changeset
|
142 |
|
69342 | 143 |
#Isabelle fonts |
144 |
function isabelle_fonts () |
|
145 |
{ |
|
146 |
local X="" |
|
147 |
for X in "$@" |
|
148 |
do |
|
149 |
if [ -z "$ISABELLE_FONTS" ]; then |
|
150 |
ISABELLE_FONTS="$X" |
|
151 |
else |
|
152 |
ISABELLE_FONTS="$ISABELLE_FONTS:$X" |
|
153 |
fi |
|
154 |
done |
|
155 |
export ISABELLE_FONTS |
|
156 |
} |
|
157 |
export -f isabelle_fonts |
|
158 |
||
69374 | 159 |
function isabelle_fonts_hidden () |
160 |
{ |
|
161 |
local X="" |
|
162 |
for X in "$@" |
|
163 |
do |
|
164 |
if [ -z "$ISABELLE_FONTS_HIDDEN" ]; then |
|
165 |
ISABELLE_FONTS_HIDDEN="$X" |
|
166 |
else |
|
167 |
ISABELLE_FONTS_HIDDEN="$ISABELLE_FONTS_HIDDEN:$X" |
|
168 |
fi |
|
169 |
done |
|
170 |
export ISABELLE_FONTS_HIDDEN |
|
171 |
} |
|
172 |
export -f isabelle_fonts_hidden |
|
173 |
||
71733 | 174 |
#Isabelle/Scala services |
175 |
function isabelle_scala_service () |
|
69255
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
176 |
{ |
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
177 |
local X="" |
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
178 |
for X in "$@" |
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
179 |
do |
71733 | 180 |
if [ -z "$ISABELLE_SCALA_SERVICES" ]; then |
181 |
ISABELLE_SCALA_SERVICES="$X" |
|
69255
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
182 |
else |
71733 | 183 |
ISABELLE_SCALA_SERVICES="$ISABELLE_SCALA_SERVICES:$X" |
69255
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
184 |
fi |
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
185 |
done |
71733 | 186 |
export ISABELLE_SCALA_SERVICES |
69255
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
187 |
} |
71733 | 188 |
export -f isabelle_scala_service |
69255
800b1ce96fce
more general support for Isabelle/PIDE file formats -- less hardwired Bibtex operations;
wenzelm
parents:
69157
diff
changeset
|
189 |
|
72162 | 190 |
#Special directories |
191 |
function isabelle_directory () |
|
192 |
{ |
|
193 |
local X="" |
|
194 |
for X in "$@" |
|
195 |
do |
|
196 |
if [ -z "$ISABELLE_DIRECTORIES" ]; then |
|
197 |
ISABELLE_DIRECTORIES="$X" |
|
198 |
else |
|
199 |
ISABELLE_DIRECTORIES="$ISABELLE_DIRECTORIES:$X" |
|
200 |
fi |
|
201 |
done |
|
202 |
export ISABELLE_DIRECTORIES |
|
203 |
} |
|
204 |
export -f isabelle_directory |
|
205 |
||
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
206 |
#administrative build |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
207 |
if [ -e "$ISABELLE_HOME/Admin/build" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
208 |
function isabelle_admin_build () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
209 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
210 |
"$ISABELLE_HOME/Admin/build" "$@" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
211 |
} |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
212 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
213 |
function isabelle_admin_build () { return 0; } |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
214 |
fi |
62413 | 215 |
export -f isabelle_admin_build |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
216 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
217 |
#arrays |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
218 |
function splitarray () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
219 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
220 |
SPLITARRAY=() |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
221 |
local IFS="$1"; shift |
66667
2e580fcf6522
avoid local shell variables intruding the resulting environment (via "set -o allexport" in getsettings);
wenzelm
parents:
63994
diff
changeset
|
222 |
local X="" |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
223 |
for X in $* |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
224 |
do |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
225 |
SPLITARRAY["${#SPLITARRAY[@]}"]="$X" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
226 |
done |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
227 |
} |
62413 | 228 |
export -f splitarray |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
229 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
230 |
#init component tree |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
231 |
function init_component () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
232 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
233 |
local COMPONENT="$1" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
234 |
case "$COMPONENT" in |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
235 |
/*) ;; |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
236 |
*) |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
237 |
echo >&2 "Absolute component path required: \"$COMPONENT\"" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
238 |
exit 2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
239 |
;; |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
240 |
esac |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
241 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
242 |
if [ -d "$COMPONENT" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
243 |
if [ -z "$ISABELLE_COMPONENTS" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
244 |
ISABELLE_COMPONENTS="$COMPONENT" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
245 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
246 |
ISABELLE_COMPONENTS="$ISABELLE_COMPONENTS:$COMPONENT" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
247 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
248 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
249 |
echo >&2 "### Missing Isabelle component: \"$COMPONENT\"" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
250 |
if [ -z "$ISABELLE_COMPONENTS_MISSING" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
251 |
ISABELLE_COMPONENTS_MISSING="$COMPONENT" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
252 |
else |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
253 |
ISABELLE_COMPONENTS_MISSING="$ISABELLE_COMPONENTS_MISSING:$COMPONENT" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
254 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
255 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
256 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
257 |
if [ -f "$COMPONENT/etc/settings" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
258 |
source "$COMPONENT/etc/settings" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
259 |
local RC="$?" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
260 |
if [ "$RC" -ne 0 ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
261 |
echo >&2 "Return code $RC from bash script: \"$COMPONENT/etc/settings\"" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
262 |
exit 2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
263 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
264 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
265 |
if [ -f "$COMPONENT/etc/components" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
266 |
init_components "$COMPONENT" "$COMPONENT/etc/components" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
267 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
268 |
} |
62413 | 269 |
export -f init_component |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
270 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
271 |
#init component forest |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
272 |
function init_components () |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
273 |
{ |
66667
2e580fcf6522
avoid local shell variables intruding the resulting environment (via "set -o allexport" in getsettings);
wenzelm
parents:
63994
diff
changeset
|
274 |
local REPLY="" |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
275 |
local BASE="$1" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
276 |
local CATALOG="$2" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
277 |
local COMPONENT="" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
278 |
local -a COMPONENTS=() |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
279 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
280 |
if [ ! -f "$CATALOG" ]; then |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
281 |
echo >&2 "Bad component catalog file: \"$CATALOG\"" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
282 |
exit 2 |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
283 |
fi |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
284 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
285 |
{ |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
286 |
while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; } |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
287 |
do |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
288 |
case "$REPLY" in |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
289 |
\#* | "") ;; |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
290 |
/*) COMPONENTS["${#COMPONENTS[@]}"]="$REPLY" ;; |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
291 |
*) COMPONENTS["${#COMPONENTS[@]}"]="$BASE/$REPLY" ;; |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
292 |
esac |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
293 |
done |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
294 |
} < "$CATALOG" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
295 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
296 |
for COMPONENT in "${COMPONENTS[@]}" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
297 |
do |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
298 |
init_component "$COMPONENT" |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
299 |
done |
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
300 |
} |
62413 | 301 |
export -f init_components |
62412
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
302 |
|
ffdc5cf36dc5
more robust treatment of shell functions: dynamic_env recreates lost definitions on demand, e.g. after going through aggressive versions of /bin/sh -> dash;
wenzelm
parents:
diff
changeset
|
303 |
fi |