build-distro: simplify build loop, remove dead code in option parsing

parent d9364696
...@@ -126,7 +126,7 @@ move_iso() { ...@@ -126,7 +126,7 @@ move_iso() {
mv -vf "$TMP"/out/ximper-*.iso "$VMDIR"/"$DFILENAME" mv -vf "$TMP"/out/ximper-*.iso "$VMDIR"/"$DFILENAME"
} }
OPTS=$(getopt -o h --long help,nvidia,debug,clean,all,de:,net,network,repos: -- "$@") || { OPTS=$(getopt -o h --long help,nvidia,all,debug,clean,de:,net,network,repos: -- "$@") || {
print_error "Ошибка обработки опций." print_error "Ошибка обработки опций."
} }
...@@ -146,7 +146,7 @@ while true; do ...@@ -146,7 +146,7 @@ while true; do
printf "\n" printf "\n"
printf " Настройки образа:\n" printf " Настройки образа:\n"
printf " --nvidia Собрать дистрибутив с драйверами NVIDIA\n" printf " --nvidia Собрать дистрибутив с драйверами NVIDIA\n"
printf " --all Собрать все дистрибутивы (default + nvidia)\n" printf " --all Собрать все варианты (default + nvidia)\n"
printf " -r | --repos Установить используемые репозитории\n" printf " -r | --repos Установить используемые репозитории\n"
printf " (По умолчанию: deferred,ximper)\n" printf " (По умолчанию: deferred,ximper)\n"
printf " (репозитории используются тольок во время сборки)\n" printf " (репозитории используются тольок во время сборки)\n"
...@@ -196,16 +196,6 @@ while true; do ...@@ -196,16 +196,6 @@ while true; do
shift shift
break break
;; ;;
"")
shift
;;
*)
if [ -n "$REPOS" ] && [ "$1" = "$REPOS" ]; then
shift
continue
fi
print_error "Неверная опция: $1"
;;
esac esac
done done
...@@ -233,32 +223,21 @@ fi ...@@ -233,32 +223,21 @@ fi
print_build_info print_build_info
# Генерация списка задач на сборку pushd "$PROFILESDIR" > /dev/null || exit
build_list=()
handle_uncommitted_changes
for desktop_env in "${DESKTOP_ENVS[@]}"; do for desktop_env in "${DESKTOP_ENVS[@]}"; do
if [ "$ALLDISTROS" == true ]; then if [ "$ALLDISTROS" == true ]; then
build_list+=("$desktop_env:nvidia") makebuild "default" "$desktop_env"
build_list+=("$desktop_env:default") makebuild "nvidia" "$desktop_env"
elif [ "$NVIDIA" == true ]; then
makebuild "nvidia" "$desktop_env"
else else
if [ "$NVIDIA" == true ]; then makebuild "default" "$desktop_env"
build_list+=("$desktop_env:nvidia")
else
build_list+=("$desktop_env:default")
fi
fi fi
done done
pushd "$PROFILESDIR" > /dev/null || exit
handle_uncommitted_changes
# Выполнение сборки для каждого элемента в списке
for build_item in "${build_list[@]}"; do
IFS=':' read -r desktop_env build_type <<< "$build_item"
makebuild "$build_type" "$desktop_env"
done
revert_temp_commit revert_temp_commit
cleartmp cleartmp
popd > /dev/null || exit popd > /dev/null || exit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment