-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmulle-bash
executable file
·845 lines (681 loc) · 18.8 KB
/
mulle-bash
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
#! /bin/sh
#
# Copyright (c) 2022 Nat! - Mulle kybernetiK
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of Mulle kybernetiK nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# shellcheck shell=bash
# shellcheck disable=SC2236
# shellcheck disable=SC2166
# shellcheck disable=SC2006
[ "${TRACE}" = 'YES' -o "${MULLE_BASH_TRACE}" = 'YES' ] && set -x && : "$0" "$@"
_fatal()
{
echo "fatal error ($0): $*" >&2
exit 1
}
# ***
# *** STAGE 1 : Boot into bash or zsh
# *** We are in sh (or something like this)
# *** This must be identical with mulle-boot.sh
#
# Prelude to be placed at top of each script. Rerun this script either in
# bash or zsh, if not already running in either (which can happen!)
# Allows script to run on systems that either have bash (linux) or
# zsh (macOS) only by default.
#
# Unfortunately you can't have an interactive shell with -c, so we can't have
# an interactive mulle-bash with mulle-bashfunctions preloaded. Work around
# is to load them manually with . `mulle-bashfunctions load`
#
if [ "${1:-}" != --no-auto-shell ]
then
_MULLE_UNAME="`PATH="/bin:/usr/bin:${PATH}" uname`"
case "${_MULLE_UNAME}" in
[Dd]arwin)
[ -z "${ZSH_VERSION+x}" ]
;;
*)
[ -z "${BASH_VERSION+x}" -a -z "${ZSH_VERSION+x}" ]
;;
esac
if [ $? -eq 0 ]
then
exe_shell=
if [ ! -z "${MULLE_BASH_EXE_SHELL}" ]
then
exe_shell="`command -v "${MULLE_BASH_EXE_SHELL}"`"
fi
if [ -z "${exe_shell}" ]
then
case "${_MULLE_UNAME}" in
[Dd]arwin)
exe_shell="`command -v "zsh" `"
exe_shell="${exe_shell:-zsh}" # for error if not installed
;;
*)
exe_shell="`command -v "bash" `"
exe_shell="${exe_shell:-`command -v "zsh" `}"
exe_shell="${exe_shell:-bash}" # for error if not installed
;;
esac
fi
script="$0"
#
# Quote incoming arguments for shell expansion
#
args=""
for arg in "$@"
do
# True bourne sh doesn't know ${a//b/c} and <<<
case "${arg}" in
*\'*)
# Use cat instead of echo to avoid possible echo -n
# problems. Escape single quotes in string.
arg="`cat <<EOF | sed -e s/\'/\'\\\"\'\\\"\'/g
${arg}
EOF
`"
;;
esac
if [ -z "${args}" ]
then
args="'${arg}'"
else
args="${args} '${arg}'"
fi
done
#
# bash/zsh will use arg after -c <arg> as $0, convenient!
#
# MEMO: this used to be PATH="/bin:/usr/bin:${PATH}" but i can't
# remember why, and it also tripped up our path search
PATH="${PATH:-/bin:/usr/bin}" exec "${exe_shell}" -c ". ${script} --no-auto-shell ${args}" "${script}"
fi
else
no_auto_shell='YES'
shift # get rid of --no-auto-shell
fi
if [ ! -z "${POSIXLY_CORRECT+x}" ]
then
set +o posix # turn off posix
fi
# ***
# *** STAGE 2 : Determine requirements for mulle-bashfunctions library to use.
# *** We are in bash! (or zsh)
# ***
#
# this is "our" version
# the actual loaded version may differ (and will change this variable)
#
MULLE_BASHFUNCTIONS_VERSION="6.5.1"
MULLE_BASHFUNCTIONS_LIBEXEC_DIRNAME="libexec"
MULLE_EXECUTABLE="$1"
if [ $# -eq 0 ]
then
_fatal "mulle-bash can't be run interactively."$'\n'"Run \`mulle-bashfunctions help\` for help."
fi
# code used by the installer
if [ "$1" = "version" -a "${no_auto_shell}" = 'YES' ]
then
echo "${MULLE_BASHFUNCTIONS_VERSION}"
exit 0
fi
#
# leading backslash ? looks like we're getting called from
# mingw via a .BAT or so. Correct this now
#
case "$PATH" in
"\\"*)
PATH="${PATH//\\/\/}"
;;
esac
#
# allow symlinks like mulle-bash[-variant].[version]
#
MULLE_BASHFUNCTIONS_VARIANT="${0##*/}" # get filename
MULLE_BASHFUNCTIONS_VARIANT="${MULLE_BASHFUNCTIONS_VARIANT#mulle-bash}"
MULLE_BASHFUNCTIONS_VARIANT="${MULLE_BASHFUNCTIONS_VARIANT#-}" # get variant part
MULLE_BASHFUNCTIONS_VERSION_QUALIFIER="${MULLE_BASHFUNCTIONS_VARIANT#*.}" # get all extensions
MULLE_BASHFUNCTIONS_VARIANT="${MULLE_BASHFUNCTIONS_VARIANT%.*}" # strip extension
if [ "$1" = "libexec-dir" ]
then
MULLE_BASHFUNCTIONS_VERSION_QUALIFIER="${2:-}"
else
if [ -z "${MULLE_BASHFUNCTIONS_VARIANT}" -o -z "${MULLE_BASHFUNCTIONS_VERSION_QUALIFIER}" ]
then
if [ ! -r "$1" ]
then
_fatal "Can't open \"$1\", need absolute or relative path"
fi
#
# check lines for a '#! MULLE_BASHFUNCTIONS_VERSION_QUALIFIER comment,
# if there is one take this version to find libexec-dir
#
while :
do
IFS=$'\n' read -r line
case "${line}" in
\#\!*)
;;
*)
_fatal "\"$1\" is not a usable shell script as #! is missing"
;;
esac
done=
while [ "${done}" != 'YES' ]
do
IFS=$'\n' read -r line
case "${line}" in
\#\!*MULLE_BASHFUNCTIONS_VERSION_QUALIFIER*=*)
version="${line#\#\!}" # remove #!
version="${version%%#*}" # remove any comments
version="${version#*MULLE_BASHFUNCTIONS_VERSION_QUALIFIER*=}" # remove
version="${version%%\ }" # remove spaces
version="${version##\ }" # remove spaces
MULLE_BASHFUNCTIONS_VERSION_QUALIFIER=${version} # remove whitespace
;;
\#\!*MULLE_BASHFUNCTIONS_VARIANT*=*)
variant="${line#\#\!}" # remove #!
variant="${variant%%#*}" # remove any comments
variant="${variant#*MULLE_BASHFUNCTIONS_VARIANT*=}" # remove
variant="${variant%%\ }" # remove spaces
variant="${variant##\ }" # remove spaces
MULLE_BASHFUNCTIONS_VARIANT="-${variant}" # remove whitespace
;;
*)
done='YES'
;;
esac
done
unset done
unset line
break
done < "$1"
fi
fi
# ***
# *** Ungainly temporary library code follows, skip to STAGE 3
# ***
r_add_line()
{
local lines="$1"
local line="$2"
if [ ! -z "${lines:0:1}" ]
then
if [ ! -z "${line:0:1}" ]
then
RVAL="${lines}"$'\n'"${line}"
else
RVAL="${lines}"
fi
else
RVAL="${line}"
fi
}
r_escaped_sed_pattern()
{
local s="$1"
s="${s//\\/\\\\}"
s="${s//\[/\\[}"
s="${s//\]/\\]}"
s="${s//\//\\/}"
s="${s//\$/\\$}"
s="${s//\*/\\*}"
s="${s//\./\\.}"
s="${s//\^/\\^}"
RVAL="$s"
}
r_dirname()
{
RVAL="$1"
while :
do
case "${RVAL}" in
/)
return
;;
*/)
RVAL="${RVAL%?}"
continue
;;
esac
break
done
local last
last="${RVAL##*/}"
RVAL="${RVAL%${last}}"
while :
do
case "${RVAL}" in
/)
return
;;
*/)
RVAL="${RVAL%?}"
;;
*)
RVAL="${RVAL:-.}"
return
;;
esac
done
}
r_prepend_path_if_relative()
{
case "$2" in
/*)
RVAL="$2"
;;
*)
RVAL="$1/$2"
;;
esac
}
r_resolve_symlinks()
{
local filepath
RVAL="$1"
if filepath="`readlink "${RVAL}"`"
then
r_dirname "${RVAL}"
r_prepend_path_if_relative "${RVAL}" "${filepath}"
r_resolve_symlinks "${RVAL}"
fi
}
#
# sort them in numeric order so 10.1.2, 9.1.0, 9.22.0, 9.3.0
# becomes 10.1.2, 9.22.0, 9.3.0, 9.1.0 when sorting reverse (sortflags="r")
# or 9.1.0, 9.3.0, 9.22.0, 10.1.2 with the default sort
#
versions_sort()
{
local sortflags="$1"
sort -u -t. -k "1,1n${sortflags}" -k "2,2n${sortflags}" -k "3,3n${sortflags}"
}
#
# Plop our version in, sort and pick the ones after ours
#
versions_find_next()
{
local versions="$1"
local version="$2"
local sortflags="$3"
#
# If ours is not in there yet, plop it in
#
if ! grep -F -q -s -x "${version}" <<< "${versions}"
then
r_add_line "${versions}" "${version}"
versions="${RVAL}"
fi
# Now sort again and pick the one after ours
versions="`versions_sort ${sortflags} <<< "${versions}" `"
r_escaped_sed_pattern "${version}"
# delete all lines up to pattern, then implicitly print and quit
# sed -e "0,/^${RVAL}\$/d" -e '{q;}' <<< "${versions}"
# want a list of applicable versions
sed -e "0,/^${RVAL}\$/d" <<< "${versions}"
}
#
# will filter versions according to operation and version
# the result will be sorted in ascending order
#
versions_operation()
{
local versions="$1"
local operation="$2"
local version="$3"
case "${operation}" in
'>=')
grep -F -x "${version}" <<< "${versions}"
versions_find_next "${versions}" "${version}"
;;
'>')
versions_find_next "${versions}" "${version}"
;;
'<=')
versions_find_next "${versions}" "${version}" "r" | versions_sort
grep -F -x "${version}" <<< "${versions}"
;;
'<')
versions_find_next "${versions}" "${version}" "r" | versions_sort
;;
'==')
grep -F -x "${version}" <<< "${versions}"
;;
'!=')
versions_sort <<< "${versions}" | \
grep -F -x -v "${version}" | \
"${_choose}" -1
;;
*)
_internal__fatal "unknown operator \"${operator}\""
;;
esac
return 0
}
#
# A small parser
#
r_versions_qualify_s()
{
# log_entry "r_versions_qualify_s" "${_s}" "$@"
local versions="$1"
local operator
local version
_s="${_s#"${_s%%[![:space:]]*}"}" # remove leading whitespace characters
case "${_s}" in
"("*)
_s="${_s:1}"
r_versions_qualify "${versions}"
_s="${_s#"${_s%%[![:space:]]*}"}" # remove leading whitespace characters
# if [ "${_closer}" != 'YES' ]
# then
if [ "${_s:0:1}" != ")" ]
then
_fatal "Closing ) missing at \"${_s}\" of versions qualifier \"${_qualifier}\""
fi
_s="${_s:1}"
# fi
return
;;
'>='*|'<='*|'=='*|'!='*)
operator="${_s:0:2}"
_s="${_s:2}"
;;
'<>'*)
operator='!='
_s="${_s:2}"
;;
'<'*|'>'*)
operator="${_s:0:1}"
_s="${_s:1}"
;;
'='*)
operator='=='
_s="${_s:1}"
;;
[0-9]*)
operator='>='
;;
"")
_fatal "Missing expression after versions qualifier \"${_qualifier}\""
;;
*)
_fatal "Unknown command at \"${_s}\" of versions qualifier \"${_qualifier}\""
;;
esac
## fall thru for common operation code
_s="${_s#"${_s%%[![:space:]]*}"}" # remove leading whitespace characters
version="${_s%%[ )]*}"
_s="${_s#"${version}"}"
#log_entry tags_match "${versions}" "${key}"
RVAL="`versions_operation "${versions}" "${operator}" "${version}"`" || exit 1
}
r_versions_qualify_i()
{
# log_entry "r_versions_qualify_i" "${_s}" "$@"
local versions="$1"
local result="$2"
_s="${_s#"${_s%%[![:space:]]*}"}" # remove leading whitespace characters
case "${_s}" in
[Aa][Nn][Dd]*)
_s="${_s:3}"
r_versions_qualify "${versions}"
RVAL="`grep -F -x -f <( echo "${result}") <<< "${RVAL}" `"
return 0
;;
[Oo][Rr]*)
_s="${_s:2}"
r_versions_qualify "${versions}"
r_add_line "${result}" "${RVAL}"
RVAL="`sort -u <<< "${RVAL}"`"
return 0
;;
")")
echo "${result}"
return 0
;;
"")
echo "${result}"
return 0
;;
esac
_fatal "Unexpected expression at ${_s} of versions qualifier \"${_qualifier}\""
}
r_versions_qualify()
{
# log_entry "r_versions_qualify" "${_s}" "$@"
local versions="$1"
local result
r_versions_qualify_s "${versions}"
result="${RVAL}"
while :
do
_s="${_s#"${_s%%[![:space:]]*}"}" # remove leading whitespace characters
case "${_s}" in
")"*|"")
break
;;
esac
r_versions_qualify_i "${versions}" "${result}"
result="${RVAL}"
done
RVAL="${result}"
}
#
#
#
versions_filter()
{
local versions="$1"
local filter="$2"
local _choose
# used for error messages
# pick newest by default
_choose='tail'
filter="${filter#"${filter%%[![:space:]]*}"}" # remove leading whitespace characters
case "${filter}" in
[Oo][Ll][Dd][Ee][Ss][Tt]:*)
filter="${filter:7}"
_choose='head'
;;
[Nn][Ee][Ww][Ee][Ss][Tt]:*)
filter="${filter:7}"
_choose='tail'
;;
esac
local _qualifier
_qualifier="${filter}"
if [ -z "${filter}" ]
then
filter=">= 0.0.0"
fi
local _s
# local _closer
# used to traverse the string
_s="${filter}"
r_versions_qualify "${versions}"
if [ ! -z "${RVAL}" ]
then
"${_choose}" -1 <<< "${RVAL}"
fi
return 0
}
#
# this r_get_libexec_dir is actually more powerful than that
# in mulle-init.sh
#
r_get_bashfunctions_libexec_dir()
{
local executablepath="$1"
local matchfile="$2"
local qualifier="$3"
local exedirpath
local prefix
case "${executablepath}" in
\.*|/*|~*)
;;
*)
executablepath="`command -v "${executablepath}"`"
;;
esac
r_resolve_symlinks "${executablepath}"
executablepath="${RVAL}"
r_dirname "${executablepath}"
exedirpath="`( cd "${RVAL}" ; pwd -P)`"
r_dirname "${exedirpath}"
prefix="${RVAL}"
local libexec_dir
# on ARCH MULLE_BASHFUNCTIONS_LIBEXEC_DIRNAME will be lib
libexec_dir="${prefix}/${MULLE_BASHFUNCTIONS_LIBEXEC_DIRNAME:-libexec}/mulle-bashfunctions"
if [ ! -z "${qualifier}" ]
then
versions="`( cd "${libexec_dir}" ; ls -1d [0-9]*.[0-9]*.[0-9]* ) 2> /dev/null`"
if [ -z "${versions}" ]
then
versions="${MULLE_BASHFUNCTIONS_VERSION}"
fi
version="`versions_filter "${versions}" "${qualifier}" `"
if [ -z "${version}" ]
then
return 1
fi
libexec_dir="${libexec_dir}/${version}"
else
libexec_dir="${libexec_dir}/${MULLE_BASHFUNCTIONS_VERSION}"
fi
if [ ! -f "${libexec_dir}/${matchfile}" ]
then
libexec_dir="${exedirpath}/src"
fi
case "${libexec_dir}" in
/*|~*)
RVAL="${libexec_dir}"
;;
.)
RVAL="$PWD"
;;
*)
RVAL="$PWD/${libexec_dir}"
;;
esac
[ -f "${RVAL}/${matchfile}" ]
}
# ***
# *** STAGE 3 : Figure out MULLE_BASHFUNCTIONS_LIBEXEC_DIR on this machine.
# *** if we have an environment set, check that version matches
if [ ! -z "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR:-}" ]
then
case "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}" in
*/${MULLE_BASHFUNCTIONS_VERSION}/*)
# match nice
;;
*)
# can't use it
unset MULLE_BASHFUNCTIONS_LIBEXEC_DIR
;;
esac
fi
if [ -z "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR:-}" ]
then
if ! r_get_bashfunctions_libexec_dir "$0" \
"mulle-bashfunctions${MULLE_BASHFUNCTIONS_VARIANT}.sh" \
"${MULLE_BASHFUNCTIONS_VERSION_QUALIFIER}"
then
_fatal "Could not find mulle-bashfunctions libexec directory (\
\$0=\"$0\", \
PWD=\"$PWD\", \
PATH=\"$PATH\", \
MULLE_EXECUTABLE=\"${MULLE_EXECUTABLE}\", \
MULLE_BASHFUNCTIONS_VERSION=\"${MULLE_BASHFUNCTIONS_VERSION}\", \
MULLE_BASHFUNCTIONS_VARIANT=\"${MULLE_BASHFUNCTIONS_VARIANT}\", \
MULLE_BASHFUNCTIONS_VERSION_QUALIFIER=\"${MULLE_BASHFUNCTIONS_VERSION_QUALIFIER}\")"
fi
MULLE_BASHFUNCTIONS_LIBEXEC_DIR="${RVAL}"
export MULLE_BASHFUNCTIONS_LIBEXEC_DIR
fi
if [ "$1" = "libexec-dir" ]
then
printf "%s\n" "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}"
exit 0
fi
# get rid of all these functions, so mulle-bashfunctions can silently load
# better versions
unset -f r_add_line
unset -f r_dirname
unset -f r_escaped_sed_pattern
unset -f r_get_bashfunctions_libexec_dir
unset -f r_prepend_path_if_relative
unset -f r_resolve_symlinks
unset -f r_versions_qualify
unset -f r_versions_qualify_i
unset -f r_versions_qualify_s
unset -f versions_filter
unset -f versions_find_next
unset -f versions_operation
unset -f versions_sort
# ***
# *** STAGE 4 : Load mulle-bashfunctions library
# ***
#
# Conundrum : if we turn off posix the :: separators don't work anymore
# on older : if we turn posix on the alias expansion doesn't work anymore
# bash :
#
if [ ${BASH_VERSION+x} ]
then
set +o posix # turn off
# set -o posix # turn on ( `sde::print_commands': not a valid identifier)
fi
if ! . "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions${MULLE_BASHFUNCTIONS_VARIANT}.sh"
then
_fatal "Failed to load \"${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions${MULLE_BASHFUNCTIONS_VARIANT}.sh\""
fi
unset no_auto_shell
#unset -f _fatal
[ ${MULLE_BASHLOADER_SH+x} ] || _fatal "Internal inconsistency error"
# ***
# *** STAGE 5 : Clear some global state
# ***
MULLE_FLAG_MAGNUM_FORCE='NO'
# technical flags
MULLE_TRACE=
MULLE_FLAG_EXEKUTOR_DRY_RUN='NO'
MULLE_FLAG_LOG_DEBUG='NO'
MULLE_FLAG_LOG_EXEKUTOR='NO'
MULLE_FLAG_LOG_FLUFF='NO'
MULLE_FLAG_LOG_SETTINGS='NO'
MULLE_FLAG_LOG_VERBOSE='NO'
MULLE_TRACE_POSTPONE='NO'
# ***
# *** STAGE 6 : Execute actual shell script
# ***
shift
. "${MULLE_EXECUTABLE}" "$@"