# Generate options of customize_airootfs.sh.
- local customize_airootfs_script_options
- customize_airootfs_script_options="-p '${password}' -k '${kernel_config_line}' -u '${username}' -o '${os_name}' -i '${install_dir}' -s '${usershell}' -a '${arch}' -g '${localegen}' -l '${language}' -z '${timezone}' -t ${theme_name}"
- if [[ ${boot_splash} = true ]]; then
- customize_airootfs_script_options="${customize_airootfs_script_options} -b"
- fi
- if [[ ${debug} = true ]]; then
- customize_airootfs_script_options="${customize_airootfs_script_options} -d"
- fi
- if [[ ${bash_debug} = true ]]; then
- customize_airootfs_script_options="${customize_airootfs_script_options} -x"
- fi
- if [[ ${rebuild} = true ]]; then
- customize_airootfs_script_options="${customize_airootfs_script_options} -r"
- fi
+ local airootfs_script_options
+ airootfs_script_options="-p '${password}' -k '${kernel_config_line}' -u '${username}' -o '${os_name}' -i '${install_dir}' -s '${usershell}' -a '${arch}' -g '${localegen}' -l '${language}' -z '${timezone}' -t ${theme_name}"
+ [[ ${boot_splash} = true ]] && airootfs_script_options="${airootfs_script_options} -b"
+ [[ ${debug} = true ]] && airootfs_script_options="${airootfs_script_options} -d"
+ [[ ${bash_debug} = true ]] && airootfs_script_options="${airootfs_script_options} -x"
+ [[ ${rebuild} = true ]] && airootfs_script_options="${airootfs_script_options} -r"
# X permission
local chmod_755
-w "${work_dir}/${arch}" \
-C "${work_dir}/pacman-${arch}.conf" \
-D "${install_dir}" \
- -r "/root/customize_airootfs.sh ${customize_airootfs_script_options}" \
+ -r "/root/customize_airootfs.sh ${airootfs_script_options}" \
run
if [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_${channel_name}.sh" ]]; then
-w "${work_dir}/${arch}" \
-C "${work_dir}/pacman-${arch}.conf" \
-D "${install_dir}" \
- -r "/root/customize_airootfs_${channel_name}.sh ${customize_airootfs_script_options}" \
+ -r "/root/customize_airootfs_${channel_name}.sh ${airootfs_script_options}" \
run
elif [[ -f "${work_dir}/${arch}/airootfs/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh" ]]; then
${mkalteriso} ${mkalteriso_option} \
-w "${work_dir}/${arch}" \
-C "${work_dir}/pacman-${arch}.conf" \
-D "${install_dir}" \
- -r "/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh ${customize_airootfs_script_options}" \
+ -r "/root/customize_airootfs_$(echo ${channel_name} | sed 's/\.[^\.]*$//').sh ${airootfs_script_options}" \
run
fi
_opt_short="a:bc:dg:hjk:lo:p:t:u:w:x"
_opt_long="arch:,boot-splash,comp-type:,debug,help,lang,japanese,kernel:,cleaning,out:,password:,comp-opts:,user:,work:,bash-debug,nocolor,noconfirm,nodepend,gitversion,shmkalteriso,msgdebug,noloopmod,tarball,noiso,noaur,nochkver,channellist"
OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
-if [[ ${?} != 0 ]]; then
- exit 1
-fi
+[[ ${?} != 0 ]] && exit 1
eval set -- "${OPT}"
unset OPT _opt_short _opt_long
# Parse channels
set +eu
-if [[ -n "${1}" ]]; then
- channel_name="${1}"
-fi
+[[ -n "${1}" ]] && channel_name="${1}"
# check_channel <channel name>
check_channel() {
}
# Check for a valid channel name
-if [[ $(check_channel "${channel_name}") = false ]]; then
- _msg_error "Invalid channel ${channel_name}" "1"
-fi
+[[ $(check_channel "${channel_name}") = false ]] && _msg_error "Invalid channel ${channel_name}" "1"
# Set for special channels
if [[ -d "${script_path}"/channels/${channel_name}.add ]]; then
}
locale_line="$(get_locale_line)"
-if [[ "${locale_line}" == "failed" ]]; then
- _msg_error "${language} is not a valid language." "1"
-fi
+[[ "${locale_line}" == "failed" ]] && _msg_error "${language} is not a valid language." "1"
locale_config_line="$(cat "${locale_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${locale_line}" | tail -n 1)"