Skip to content

Commit 1e1a225

Browse files
committed
[clean] : Remove unnecessary code
1 parent 88cbf61 commit 1e1a225

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

build.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ _usage () {
146146
echo " Default: ${work_dir}"
147147
echo
148148

149-
local blank="33" _arch _list _dirname _type
149+
local blank="33" _arch _dirname _type
150150

151151
for _type in "locale" "kernel"; do
152152
echo " ${_type} for each architecture:"
@@ -334,8 +334,7 @@ check_bool() {
334334
_value="$(eval echo '$'${_variable})"
335335
if [[ ! -v "${1}" ]] || [[ "${_value}" = "" ]]; then
336336
if [[ "${debug}" = true ]]; then echo; fi; msg_error "The variable name ${_variable} is empty." "1"
337-
fi
338-
if [[ ! "${_value}" = "true" ]] && [[ ! "${_value}" = "false" ]]; then
337+
elif [[ ! "${_value}" = "true" ]] && [[ ! "${_value}" = "false" ]]; then
339338
if [[ "${debug}" = true ]]; then echo; fi; msg_error "The variable name ${_variable} is not of bool type." "1"
340339
elif [[ "${debug}" = true ]]; then
341340
echo -e " ${_value}"
@@ -348,14 +347,12 @@ check_bool() {
348347
prepare_env() {
349348
# Check packages
350349
if [[ "${nodepend}" = false ]]; then
351-
local _check_failed=false _pkg _result=0 _version _local _latest
350+
local _check_failed=false _pkg _result=0
352351
msg_info "Checking dependencies ..."
353352
for _pkg in ${dependence[@]}; do
354353
eval "${tools_dir}/package.py" "${_pkg}" $( [[ "${debug}" = false ]] && echo "> /dev/null") || _result="${?}"
355354
case "${_result}" in
356355
"3")
357-
#[[ "${debug}" = true ]] && echo
358-
#msg_error "${_pkg} is not installed."
359356
_check_failed=true
360357
;;
361358
"4")
@@ -370,9 +367,7 @@ prepare_env() {
370367

371368
# Load loop kernel module
372369
if [[ "${noloopmod}" = false ]]; then
373-
if [[ ! -d "/usr/lib/modules/$(uname -r)" ]]; then
374-
msg_error "The currently running kernel module could not be found.\nProbably the system kernel has been updated.\nReboot your system to run the latest kernel." "1"
375-
fi
370+
if [[ ! -d "/usr/lib/modules/$(uname -r)" ]]; then msg_error "The currently running kernel module could not be found.\nProbably the system kernel has been updated.\nReboot your system to run the latest kernel." "1"; fi
376371
if [[ -z "$(lsmod | getclm 1 | grep -x "loop")" ]]; then modprobe loop; fi
377372
fi
378373

@@ -391,8 +386,7 @@ prepare_env() {
391386
_trap_remove_work() {
392387
local status=${?}
393388
if [[ "${normwork}" = false ]]; then
394-
echo
395-
"${tools_dir}/clean.sh" -o -w $(realpath "${work_dir}") $([[ "${debug}" = true ]] && echo -n "-d")
389+
echo; "${tools_dir}/clean.sh" -o -w $(realpath "${work_dir}") $([[ "${debug}" = true ]] && echo -n "-d")
396390
fi
397391
exit ${status}
398392
}

0 commit comments

Comments
 (0)