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
|
#!/bin/sh -E
# Run without errexit because we are testing,
# but turn on errtrace so that we can get a
# nice debug of any errors
HANDLERS=handlers
SPOOL="$(mktemp -d /tmp/kickseed.XXXXXX)"
SUPPORTEDLOCALES=/usr/share/localechooser/SUPPORTED-short
trap 'rm -rf "$SPOOL"' EXIT HUP INT QUIT TERM
traperror () {
error_occurred=1
local err=$1 # error status
local line=$2 # LINENO
local linecallfunc=$3
local command="$4"
local funcstack="$5"
echo "<---"
echo "ERROR: line $line - command '$command' exited with status: $err"
if [ "$funcstack" != "::" ]; then
echo -n " ... Error at ${funcstack} "
if [ "$linecallfunc" != "" ]; then
echo -n "called at line $linecallfunc"
fi
else
echo -n " ... internal debug info from function ${FUNCNAME} (line $linecallfunc)"
fi
echo
echo "--->"
}
trap 'traperror $? $LINENO $BASH_LINENO "$BASH_COMMAND" $(printf "::%s" ${FUNCNAME[@]})' ERR
. ./kickseed.sh
ks_log () {
echo "LOG: $@" >&2
}
ks_preseed () {
echo "$@" >> "$SPOOL/parse/test-output"
}
ks_run_handler () {
echo "Would run $1 handler"
}
ks_run_script () {
TYPE="$1"
INTERPRETER="$2"
CHROOTED="$3"
SCRIPT="$4"
echo "Would run $TYPE script $SCRIPT using interpreter $INTERPRETER (chrooted: $CHROOTED):"
cat "$SCRIPT"
echo
}
ks_write_script () {
echo "Would write executable script $1:"
cat
echo
}
kickseed "$1"
sort "$SPOOL/parse/test-output"
kickseed_post
if [[ -n $error_occurred ]]; then
echo "ERROR: There were errors processing your Kickstart file.
During installation, any error will cause kickseed to
abort. You must fix all errors before trying to
use this Kickstart file. "
fi
|