-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvsetup.sh
More file actions
132 lines (118 loc) · 3.96 KB
/
envsetup.sh
File metadata and controls
132 lines (118 loc) · 3.96 KB
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
#!/bin/bash
set -e -o pipefail -u
##
# Export some needed things for head script to work with
##
# Dont allow to run this script in other places than specified symlink dir ( So no unknown issues occure )
if [ -f build/toolset/envsetup.sh ];then
cd "$(dirname "$0")"
else
echo "Dont run this in other places than its symlink root dir ( Only in a project root dir that has folder called setup )!!!"
exit 1
fi
export P_ROOT=$(pwd)
# Load all modules with load_module script
source $P_ROOT/build/toolset/load_modules.sh
##
# Main Functions
##
# Run basic env setup
env_setup
sleep 2
# Declare pkg list variable here
declare -a PKG_LIST=()
if [ "$#" -lt 1 ]; then
show_help
fi
while (("$#" >= 1)); do
case "$1" in
--) shift 1; break;;
-h|--help) show_help;;
--aarch64) set_aarch64 && intended;; # TODO finish arch manager and needed edits for docker...
-b|--build) TOOL_BUILD=true;;
-f|--force-build) echo '--force ' > $TOOL_TEMP/tmpvar001;;
--no-extract) echo '--noextract ' > $TOOL_TEMP/tmpvar002;;
--kde) echo "${DOCKER_BUILD_CONTAINER_NAME_KDE}" > $TOOL_TEMP/docker001;;
--pkgrel-bump) echo 'TOOL_SKIPBUMP=false' > $TOOL_TEMP/envvar001;;
--mkiso) export intended && iso_variant_selector;;
--mkiso-clean-cli) intended && make_cli_clean_iso;;
--mkiso-plasma-clean-cli) intended && make_plasma_clean_iso;; # Create LiveOS env with plasma desktop
--leave-tmp) echo 'true' > $TOOL_TEMP/.keep_tmp;; # This will be used by docker builder only ( keep away from help menu )
-c|--clean) TOOL_CLEAN=true;;
--repo-update) echo "WIP" ;;
-d|--docker)
if [ $# -eq 1 ]; then
msg_error "Docker option cant be used alone ( need to be first arg! )"
fi
if [ -z "$1" ]; then
msg_warning "Make sure to add/use docker experience before adding build/clean option"
msg_error "nevertheless this option is in wrong place, now panicking"
else
export TOOL_DOCKER=true
echo true > $TOOL_TEMP/is_docker
fi ;;
--docker-shell) docker_shell_session ;;
-dr|--docker-reset) docker_reset_build && message "Docker reset done, exiting" && exit ;;
--imgsys-amd64) docker_imgsys_amd64 && exit;;
--imgsys-arm64) docker_imgsys_arm64 && exit;;
--docker-debug) docker_check_health && exit ;;
*) export PKG_LIST+=("${1}");;
-*) unknown_option ${1};;
--*) unknown_option ${1};;
esac
shift 1
done
case "$TOOL_BUILD" in
"true")
case "$TOOL_DOCKER" in
"true")
case "$TOOL_CLEAN" in
"true")
build_pkg_docker
clean_pkg_docker
;;
"false")
build_pkg_docker
;;
esac
;;
"false")
case "$TOOL_CLEAN" in
"true")
build_pkg
clean_pkg
;;
"false")
build_pkg
;;
esac
;;
esac
;;
"false")
case "$TOOL_CLEAN" in
"true")
case "$TOOL_DOCKER" in
"true")
clean_pkg_docker
;;
"false")
clean_pkg
;;
esac
;;
"false")
case "$INTENDED" in
"true")
# Echo nothing so script can exit by itself
echo " "
;;
"false")
msg_error 'No proper commands have been feed ( please see -h / --help )'
;;
esac
;;
esac
esac
# On successful exit clean tmp
clean_tmp