-
Notifications
You must be signed in to change notification settings - Fork 50
/
build.shellfire
65 lines (51 loc) · 1.8 KB
/
build.shellfire
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
core_dependency_requires '*' rm mkdir
build()
{
build_travis_ci_updateGitSubmodulesRecursively
build_travis_ci_ensureGnupgKeyringExists
build_prepareOutput
build_createInitialFatten 'initial-fatten'
build_assignDefaultComponents
core_variable_array_iterate build_nonOptions build_component
}
build_createInitialFatten()
{
local groupName="$1"
core_message NOTICE "Initial fattening of '$groupName' as a self-hosting bootstrap"
local fattenedOutputPath="$build_outputPath"/fattened/"$groupName"/all
rm -rf "$fattenedOutputPath" 2>/dev/null || sudo -p "Please enter the password for user %p to let root rm -rf '$fattenedOutputPath': " rm -rf "$fattenedOutputPath"
mkdir -m 0755 -p "$fattenedOutputPath"
"$build_fattenPath_default" --verbose $(core_init_verbosity) --force --repository-path tools/fatten --output-path "$fattenedOutputPath" --bin-path "$build_binPath" -- fatten
# Override to force use of our fattened fatten
build_fattenPath="${fattenedOutputPath}${build_binPath}"/fatten
}
build_assignDefaultComponents()
{
if core_variable_array_isEmpty build_nonOptions; then
core_variable_array_append build_nonOptions \
'fatten' \
'swaddle' \
'shellfire'
fi
}
build_component()
{
local component="$core_variable_array_element"
local buildComponentFunction="build_component_${component}"
if ! core_functions_exists "$buildComponentFunction"; then
core_exitError $core_commandLine_exitCode_USAGE "There is no build component '$component'"
fi
"$buildComponentFunction" "$@"
}
build_component_fatten()
{
build_fattenAndSwaddle 'fatten' "$build_relativePath"/tools/fatten fatten
}
build_component_swaddle()
{
build_fattenAndSwaddle 'swaddle' "$build_relativePath"/tools/swaddle swaddle
}
build_component_shellfire()
{
build_fattenAndSwaddle 'shellfire' "$build_relativePath" paths.d-helper
}