esac
done
-Function_Global_wizard_language () {
+Function_Global_Main_wizard_language () {
if [[ ${skip_set_lang} = false ]]; then
echo "このウィザードでどちらの言語を使用しますか?"
echo "この質問はウィザード内のみの設定であり、ビルドへの影響はありません。"
"日本語" ) wizard_language=jp ;;
"English" ) wizard_language=en ;;
"Japanese" ) wizard_language=jp ;;
- * ) Function_Global_wizard_language ;;
+ * ) Function_Global_Main_wizard_language ;;
esac
fi
}
-Function_Global_check_required_files () {
+Function_Global_Main_check_required_files () {
local file _chkfile i error=false
_chkfile() {
if [[ ! -f "${1}" ]]; then
}
-Function_Global_install_dependent_packages () {
+Function_Global_Main_install_dependent_packages () {
local checkpkg pkg installed_pkg installed_ver check_pkg
msg "データベースの更新をしています..." "Updating package datebase..."
echo
}
-Function_Global_guide_to_the_web () {
+Function_Global_Main_guide_to_the_web () {
if [[ "${wizard_language}" = "jp" ]]; then
msg "wizard.sh ではビルドオプションの生成以外にもパッケージのインストールやキーリングのインストールなど様々なことを行います。"
msg "もし既に環境が構築されておりそれらの操作が必要ない場合は、以下のサイトによるジェネレータも使用することができます。"
fi
}
-Function_Global_setup_keyring () {
+Function_Global_Main_setup_keyring () {
local yn
msg_n "Alter Linuxの鍵を追加しますか?(y/N): " "Are you sure you want to add the Alter Linux key? (y/N):"
read yn
case ${yn} in
y | Y | yes | Yes | YES ) sudo "${script_path}/keyring.sh" --alter-add ;;
n | N | no | No | NO ) return 0 ;;
- * ) Function_Global_setup_keyring ;;
+ * ) Function_Global_Main_setup_keyring ;;
esac
fi
}
-Function_Global_remove_dependent_packages () {
+Function_Global_Main_remove_dependent_packages () {
if [[ -n "${install}" ]]; then
sudo pacman -Rsn --config "${pacman_conf}" ${install[@]}
fi
}
-select_arch() {
+Function_Global_Ask_build_arch() {
local yn
local details
local ask_arch
case ${yn} in
y | Y | yes | Yes | YES ) details=true ;;
n | N | no | No | NO ) details=false ;;
- * ) select_comp_type; return 0 ;;
+ * ) Function_Global_Ask_comp_type; return 0 ;;
esac
ask_arch () {
return 0
}
-enable_plymouth () {
+Function_Global_Ask_plymouth () {
local yn
msg_n "Plymouthを有効化しますか?[no](y/N) : " "Do you want to enable Plymouth? [no] (y/N) : "
read yn
case ${yn} in
y | Y | yes | Yes | YES ) plymouth=true ;;
n | N | no | No | NO ) plymouth=false ;;
- * ) enable_plymouth ;;
+ * ) Function_Global_Ask_plymouth ;;
esac
}
-enable_japanese () {
+Function_Global_Ask_japanese () {
local yn
msg_n "日本語を有効化しますか?[no](y/N) : " "Do you want to activate Japanese? [no] (y/N) : "
read yn
case ${yn} in
y | Y | yes | Yes | YES ) japanese=true ;;
n | N | no | No | NO ) japanese=false ;;
- * ) enable_japanese ;;
+ * ) Function_Global_Ask_japanese ;;
esac
}
-select_comp_type () {
+Function_Global_Ask_comp_type () {
local yn
local details
local ask_comp_type
case ${yn} in
y | Y | yes | Yes | YES ) details=true ;;
n | N | no | No | NO ) details=false ;;
- * ) select_comp_type; return 0 ;;
+ * ) Function_Global_Ask_comp_type; return 0 ;;
esac
ask_comp_type () {
}
-set_comp_option () {
+Function_Global_Ask_comp_option () {
local ask_comp_option
ask_comp_option() {
local gzip
case ${yn} in
y | Y | yes | Yes | YES ) details=true ;;
n | N | no | No | NO ) details=false ;;
- * ) set_comp_option; return 0 ;;
+ * ) Function_Global_Ask_comp_option; return 0 ;;
esac
if [[ ${details} = true ]]; then
ask_comp_option
}
-set_username () {
+Function_Global_Ask_username () {
local details
local ask_comp_type
msg_n \
case ${yn} in
y | Y | yes | Yes | YES ) details=true ;;
n | N | no | No | NO ) details=false ;;
- * ) set_username; return 0 ;;
+ * ) Function_Global_Ask_username; return 0 ;;
esac
ask_username () {
}
-set_password () {
+Function_Global_Ask_password () {
local details
local ask_comp_type
msg_n \
case ${yn} in
y | Y | yes | Yes | YES ) details=true ;;
n | N | no | No | NO ) details=false ;;
- * ) set_password; return 0 ;;
+ * ) Function_Global_Ask_password; return 0 ;;
esac
ask_password () {
}
-select_kernel () {
+Function_Global_Ask_kernel () {
set +e
local do_you_want_to_select_kernel
# チャンネルの指定
-select_channel () {
+Function_Global_Ask_channel () {
local i count=1 _channel channel_list description
# 数字である
channel=$(( channel - 1 ))
if [[ -z "${channel_list[${channel}]}" ]]; then
- select_channel
+ Function_Global_Ask_channel
return 0
else
channel="${channel_list[${channel}]}"
set -e
# 数字ではない
if [[ ! $(printf '%s\n' "${channel_list[@]}" | grep -qx "${channel}"; echo -n ${?} ) -eq 0 ]]; then
- select_channel
+ Function_Global_Ask_channel
return 0
fi
fi
# イメージファイルの所有者
-set_iso_owner () {
+Function_Global_Ask_owner () {
local owner
local user_check
user_check () {
read owner
if [[ $(user_check ${owner}) = false ]]; then
echo "ユーザーが存在しません。"
- set_iso_owner
+ Function_Global_Ask_owner
return 0
elif [[ -z "${owner}" ]]; then
echo "ユーザー名を入力して下さい。"
- set_iso_owner
+ Function_Global_Ask_owner
return 0
elif [[ "${owner}" = root ]]; then
echo "所有者の変更を行いません。"
# イメージファイルの作成先
-set_out_dir () {
+Function_Global_Ask_out_dir () {
msg "イメージファイルの作成先を入力して下さい。" "Enter the destination to create the image file."
msg "デフォルトは ${script_path}/out です。" "The default is ${script_path}/out."
echo -n ": "
msg_error \
"存在しているディレクトリを指定して下さい。" \
"Please specify the existing directory."
- set_out_dir
+ Function_Global_Ask_out_dir
return 0
elif [[ "${out_dir}" = / ]] || [[ "${out_dir}" = /home ]]; then
msg_error \
"そのディレクトリは使用できません。" \
"The directory is unavailable."
- set_out_dir
+ Function_Global_Ask_out_dir
return 0
elif [[ -n "$(ls ${out_dir})" ]]; then
msg_error \
"ディレクトリは空ではありません。" \
"The directory is not empty."
- set_out_dir
+ Function_Global_Ask_out_dir
return 0
fi
fi
}
-enable_tarball () {
+Function_Global_Ask_tarball () {
local yn
msg_n "tarballをビルドしますか?[no](y/N) : " "Build a tarball? [no] (y/N) : "
read yn
case ${yn} in
y | Y | yes | Yes | YES ) tarball=true ;;
n | N | no | No | NO ) tarball=false ;;
- * ) enable_tarball ;;
+ * ) Function_Global_Ask_tarball ;;
esac
}
# 最終的なbuild.shのオプションを生成
-Function_Global_create_argument () {
+Function_Global_Main_create_argument () {
local _ADD_ARG
_ADD_ARG () {
argument="${argument} ${@}"
}
# 上の質問の関数を実行
-Function_Global_ask_questions () {
- enable_japanese
- select_arch
- enable_plymouth
- select_kernel
- select_comp_type
- set_comp_option
- set_username
- set_password
- select_channel
- #set_iso_owner
- enable_tarball
- # set_out_dir
- lastcheck
+Function_Global_Main_ask_questions () {
+ Function_Global_Ask_japanese
+ Function_Global_Ask_build_arch
+ Function_Global_Ask_plymouth
+ Function_Global_Ask_kernel
+ Function_Global_Ask_comp_type
+ Function_Global_Ask_comp_option
+ Function_Global_Ask_username
+ Function_Global_Ask_password
+ Function_Global_Ask_channel
+ #Function_Global_Ask_owner
+ Function_Global_Ask_tarball
+ # Function_Global_Ask_out_dir
+ Function_Global_Ask_Confirm
}
# ビルド設定の確認
-lastcheck () {
+Function_Global_Ask_Confirm () {
msg "以下の設定でビルドを開始します。" "Start the build with the following settings."
echo
[[ -n "${japanese}" ]] && echo " Japanese : ${japanese}"
case ${yn} in
y | Y | yes | Yes | YES ) : ;;
n | N | no | No | NO ) ask ;;
- * ) lastcheck ;;
+ * ) Function_Global_Ask_Confirm ;;
esac
}
-Function_Global_run_build.sh () {
+Function_Global_Main_run_build.sh () {
if [[ ${nobuild} = true ]]; then
echo "${argument}"
else
}
-Function_Global_run_clean.sh() {
+Function_Global_Main_run_clean.sh() {
if [[ -d "${script_path}/work/" ]]; then
sudo rm -rf "${script_path}/work/"
fi
}
-Function_Global_set_iso_permission() {
+Function_Global_Main_set_iso_permission() {
if [[ -n "${owner}" ]]; then
chown -R "${owner}" "${script_path}/out/"
chmod -R 750 "${script_path}/out/"
}
# 関数を実行
-Function_Global_wizard_language
-Function_Global_check_required_files
-Function_Global_install_dependent_packages
-Function_Global_guide_to_the_web
-Function_Global_setup_keyring
-Function_Global_ask_questions
-Function_Global_create_argument
-Function_Global_run_build.sh
-Function_Global_remove_dependent_packages
-Function_Global_run_clean.sh
-Function_Global_set_iso_permission
+Function_Global_Main_wizard_language
+Function_Global_Main_check_required_files
+Function_Global_Main_install_dependent_packages
+Function_Global_Main_guide_to_the_web
+Function_Global_Main_setup_keyring
+Function_Global_Main_ask_questions
+Function_Global_Main_create_argument
+Function_Global_Main_run_build.sh
+Function_Global_Main_remove_dependent_packages
+Function_Global_Main_run_clean.sh
+Function_Global_Main_set_iso_permission