From: hayao Date: Sat, 26 Sep 2020 07:32:26 +0000 (+0900) Subject: [fix] : Use = and Not use == X-Git-Tag: rc3-alpha1~165^2~32 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7090d587ccc5ea37a2de95475d9f2ae2c0d099c6;p=alterlinux%2Falterlinux.git [fix] : Use = and Not use == --- diff --git a/allarch.sh b/allarch.sh index d91c8857..6336b4e1 100755 --- a/allarch.sh +++ b/allarch.sh @@ -262,7 +262,7 @@ _usage () { fi echo -ne " ${_channel}" for _b in $( seq 1 $(( ${blank} - 4 - ${#_channel} )) ); do echo -ne " "; done - if [[ ! "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" == "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then + if [[ ! "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then echo -ne "$( echo_color -t '31' 'ERROR:') Not compatible with AlterISO3\n" elif [[ -f "${script_path}/channels/${_dirname}/description.txt" ]]; then echo -ne "$(cat "${script_path}/channels/${_dirname}/description.txt")\n" @@ -1235,14 +1235,14 @@ parse_files() { local _lang _count=0 for _lang in ${_locale_name_list[@]}; do _count=$(( _count + 1 )) - if [[ "${_lang}" == "${locale_name}" ]]; then echo "${_count}"; return 0; fi + if [[ "${_lang}" = "${locale_name}" ]]; then echo "${_count}"; return 0; fi done echo -n "failed" } _locale_line_number="$(_get_locale_line_number)" # 不正なロケール名なら終了する - [[ "${_locale_line_number}" == "failed" ]] && msg_error "${locale_name} is not a valid language." "1" + [[ "${_locale_line_number}" = "failed" ]] && msg_error "${locale_name} is not a valid language." "1" # ロケール設定ファイルから該当の行を抽出 _locale_config_line=($(cat "${_locale_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${_locale_line_number}" | tail -n 1)) @@ -1266,7 +1266,7 @@ parse_files() { local _kernel _count=0 for _kernel in ${_kernel_name_list[@]}; do _count=$(( _count + 1 )) - if [[ "${_kernel}" == "${kernel}" ]]; then echo "${_count}"; return 0; fi + if [[ "${_kernel}" = "${kernel}" ]]; then echo "${_count}"; return 0; fi done echo -n "failed" return 0 @@ -1274,7 +1274,7 @@ parse_files() { _kernel_line="$(_get_kernel_line)" # 不正なカーネル名なら終了する - [[ "${_kernel_line}" == "failed" ]] && msg_error "Invalid kernel ${kernel}" "1" + [[ "${_kernel_line}" = "failed" ]] && msg_error "Invalid kernel ${kernel}" "1" # カーネル設定ファイルから該当の行を抽出 _kernel_config_line=($(cat "${_kernel_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${_kernel_line}" | tail -n 1)) diff --git a/build.sh b/build.sh index 13fe8149..8ba7ecca 100755 --- a/build.sh +++ b/build.sh @@ -80,7 +80,7 @@ echo_color() { n) echo_opts="-n -e" ;; esac done - shift $((OPTIND - 1)) + shift "$((OPTIND - 1))" if [[ "${nocolor}" = false ]]; then echo ${echo_opts} "\e[$([[ -v backcolor ]] && echo -n "${backcolor}"; [[ -v textcolor ]] && echo -n ";${textcolor}"; [[ -v decotypes ]] && echo -n ";${decotypes}")m${*}\e[m" else @@ -103,7 +103,7 @@ msg_info() { n) echo_opts="${echo_opts} -n" ;; esac done - shift $((OPTIND - 1)) + shift "$((OPTIND - 1))" echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '32' 'Info') ${*}" if [[ "${bash_debug}" = true ]]; then set -xv @@ -127,7 +127,7 @@ msg_warn() { n) echo_opts="${echo_opts} -n" ;; esac done - shift $((OPTIND - 1)) + shift "$((OPTIND - 1))" echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '33' 'Warning') ${*}" >&2 if [[ "${bash_debug}" = true ]]; then set -xv @@ -151,7 +151,7 @@ msg_debug() { n) echo_opts="${echo_opts} -n" ;; esac done - shift $((OPTIND - 1)) + shift "$((OPTIND - 1))" if [[ ${debug} = true ]]; then echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '35' 'Debug') ${*}" fi @@ -178,7 +178,7 @@ msg_error() { n) echo_opts="${echo_opts} -n" ;; esac done - shift $((OPTIND - 1)) + shift "$((OPTIND - 1))" echo ${echo_opts} "$( echo_color -t '36' '[build.sh]') $( echo_color -t '31' 'Error') ${1}" >&2 if [[ -n "${2:-}" ]]; then exit ${2} @@ -261,7 +261,7 @@ _usage () { fi echo -ne " ${_channel}" for _b in $( seq 1 $(( ${blank} - 4 - ${#_channel} )) ); do echo -ne " "; done - if [[ ! "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" == "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then + if [[ ! "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then echo -ne "$( echo_color -t '31' 'ERROR:') Not compatible with AlterISO3\n" elif [[ -f "${script_path}/channels/${_dirname}/description.txt" ]]; then echo -ne "$(cat "${script_path}/channels/${_dirname}/description.txt")\n" @@ -403,7 +403,7 @@ prepare_build() { } trap '_trap_remove_work' 1 2 3 15 - if [[ "${rebuild}" == false ]]; then + if [[ "${rebuild}" = false ]]; then # If there is pacman.conf for each channel, use that for building if [[ -f "${script_path}/channels/${channel_name}/pacman-${arch}.conf" ]]; then build_pacman_conf="${script_path}/channels/${channel_name}/pacman-${arch}.conf" @@ -1150,7 +1150,7 @@ make_efi() { # edk2-shell based UEFI shell # shellx64.efi is picked up automatically when on / - if [[ "${arch}" == "x86_64" ]]; then + if [[ "${arch}" = "x86_64" ]]; then cp "${work_dir}/${arch}/airootfs/usr/share/edk2-shell/x64/Shell_Full.efi" "${work_dir}/iso/shellx64.efi" fi } @@ -1191,7 +1191,7 @@ make_efiboot() { "${script_path}/efiboot/loader/entries/archiso-cd.conf" > "${work_dir}/efiboot/loader/entries/archiso-${arch}.conf" # shellx64.efi is picked up automatically when on / - if [[ "${arch}" == "x86_64" ]]; then + if [[ "${arch}" = "x86_64" ]]; then cp "${work_dir}/iso/shellx64.efi" "${work_dir}/efiboot/" fi @@ -1276,14 +1276,14 @@ parse_files() { local _lang _count=0 for _lang in ${_locale_name_list[@]}; do _count=$(( _count + 1 )) - if [[ "${_lang}" == "${locale_name}" ]]; then echo "${_count}"; return 0; fi + if [[ "${_lang}" = "${locale_name}" ]]; then echo "${_count}"; return 0; fi done echo -n "failed" } _locale_line_number="$(_get_locale_line_number)" # 不正なロケール名なら終了する - [[ "${_locale_line_number}" == "failed" ]] && msg_error "${locale_name} is not a valid language." "1" + [[ "${_locale_line_number}" = "failed" ]] && msg_error "${locale_name} is not a valid language." "1" # ロケール設定ファイルから該当の行を抽出 _locale_config_line=($(cat "${_locale_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${_locale_line_number}" | tail -n 1)) @@ -1307,7 +1307,7 @@ parse_files() { local _kernel _count=0 for _kernel in ${_kernel_name_list[@]}; do _count=$(( _count + 1 )) - if [[ "${_kernel}" == "${kernel}" ]]; then echo "${_count}"; return 0; fi + if [[ "${_kernel}" = "${kernel}" ]]; then echo "${_count}"; return 0; fi done echo -n "failed" return 0 @@ -1315,7 +1315,7 @@ parse_files() { _kernel_line="$(_get_kernel_line)" # 不正なカーネル名なら終了する - [[ "${_kernel_line}" == "failed" ]] && msg_error "Invalid kernel ${kernel}" "1" + [[ "${_kernel_line}" = "failed" ]] && msg_error "Invalid kernel ${kernel}" "1" # カーネル設定ファイルから該当の行を抽出 _kernel_config_line=($(cat "${_kernel_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${_kernel_line}" | tail -n 1)) @@ -1531,7 +1531,7 @@ elif [[ "${channel_name}" = "clean" ]]; then fi # Check channel version -if [[ ! "${channel_name}" == "rebuild" ]]; then +if [[ ! "${channel_name}" = "rebuild" ]]; then msg_debug "channel path is ${script_path}/channels/${channel_name}" if [[ ! "$(cat "${script_path}/channels/${channel_name}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then msg_error "This channel does not support AlterISO 3." "1" diff --git a/channels/cinnamon/airootfs.any/usr/local/bin/alterlinux-welcome-page b/channels/cinnamon/airootfs.any/usr/local/bin/alterlinux-welcome-page index 8102b926..807d1f2c 100755 --- a/channels/cinnamon/airootfs.any/usr/local/bin/alterlinux-welcome-page +++ b/channels/cinnamon/airootfs.any/usr/local/bin/alterlinux-welcome-page @@ -116,7 +116,7 @@ if [[ "${custombrowser}" = false ]]; then if [[ -f $(type -P "$(echo ${_browser} | awk '{print $1}')") ]]; then browser="${_browser}" break - elif [[ "${_browser}" == "END_OF_LIST" ]]; then + elif [[ "${_browser}" = "END_OF_LIST" ]]; then _msg_error "No available browser is installed." exit 1 fi diff --git a/channels/releng/airootfs.any/root/.automated_script.sh b/channels/releng/airootfs.any/root/.automated_script.sh index 81a98a1a..d99cb5b5 100755 --- a/channels/releng/airootfs.any/root/.automated_script.sh +++ b/channels/releng/airootfs.any/root/.automated_script.sh @@ -29,6 +29,6 @@ automated_script () fi } -if [[ $(tty) == "/dev/tty1" ]]; then +if [[ "$(tty)" = "/dev/tty1" ]]; then automated_script fi diff --git a/channels/share/airootfs.any/root/.automated_script.sh b/channels/share/airootfs.any/root/.automated_script.sh index 72c93e0b..6cbbe01e 100755 --- a/channels/share/airootfs.any/root/.automated_script.sh +++ b/channels/share/airootfs.any/root/.automated_script.sh @@ -36,6 +36,6 @@ automated_script () fi } -if [[ $(tty) == "/dev/tty1" ]]; then +if [[ "$(tty)" = "/dev/tty1" ]]; then automated_script fi diff --git a/channels/share/airootfs.any/root/customize_airootfs.sh b/channels/share/airootfs.any/root/customize_airootfs.sh index 0198b8ab..7fa6e627 100755 --- a/channels/share/airootfs.any/root/customize_airootfs.sh +++ b/channels/share/airootfs.any/root/customize_airootfs.sh @@ -89,7 +89,7 @@ function remove () { # Enable and generate languages. sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen -if [[ ! "${localegen}" == "en_US\\.UTF-8\\" ]]; then +if [[ ! "${localegen}" = "en_US\\.UTF-8\\" ]]; then sed -i "s/#\(${localegen})/\1/" /etc/locale.gen fi locale-gen diff --git a/system/mkalteriso.sh b/system/mkalteriso.sh index 1e53453a..3b5b94ec 100755 --- a/system/mkalteriso.sh +++ b/system/mkalteriso.sh @@ -269,7 +269,7 @@ _mkairootfs_img () { _msg_info "Creating ext4 image of 32GiB..." truncate -s 32G "${work_dir}/airootfs.img" local _qflag="" - if [[ ${quiet} == "y" ]]; then + if [[ ${quiet} = "y" ]]; then _qflag="-q" fi mkfs.ext4 ${_qflag} -O ^has_journal,^resize_inode -E lazy_itable_init=0 -m 0 -F "${work_dir}/airootfs.img" @@ -382,7 +382,7 @@ command_iso () { mkdir -p "${out_dir}" _msg_info "Creating ISO image..." local _qflag="" - if [[ ${quiet} == "y" ]]; then + if [[ ${quiet}"y" ]]; then _qflag="-quiet" fi xorriso -as mkisofs ${_qflag} \ @@ -415,7 +415,7 @@ command_tarball () { _msg_info "Creating tarball..." local _vflag="" - if [[ ${quiet} == "n" ]]; then + if [[ "${quiet}" = "n" ]]; then _vflag="-v" fi @@ -436,7 +436,7 @@ command_prepare () { _show_config prepare _cleanup - if [[ ${sfs_mode} == "sfs" ]]; then + if [[ "${sfs_mode}" = "sfs" ]]; then _mkairootfs_sfs else _mkairootfs_img diff --git a/tools/channel.sh b/tools/channel.sh index cc7dd6c5..0aa06252 100755 --- a/tools/channel.sh +++ b/tools/channel.sh @@ -60,7 +60,7 @@ gen_channel_list() { check() { gen_channel_list - if [[ ! "${#}" == "1" ]]; then + if [[ ! "${#}" = "1" ]]; then _help exit 1 fi diff --git a/tools/fullbuild.sh b/tools/fullbuild.sh index 76747e76..f6f5064a 100755 --- a/tools/fullbuild.sh +++ b/tools/fullbuild.sh @@ -182,7 +182,7 @@ build() { _msg_info "Build the ${lang} version of ${cha} on the ${arch} architecture." sudo bash ${script_path}/build.sh ${options} _exit_code="${?}" - if [[ "${_exit_code}" == 0 ]]; then + if [[ "${_exit_code}" = 0 ]]; then touch "${work_dir}/fullbuild.${cha}_${arch}_${lang}" else _msg_error "build.sh finished with exit code ${_exit_code}. Will try again." diff --git a/tools/run_archiso.sh b/tools/run_archiso.sh index 2f78f161..8aadcd10 100644 --- a/tools/run_archiso.sh +++ b/tools/run_archiso.sh @@ -56,8 +56,8 @@ check_image() { } run_image() { - [ "$boot_type" == "bios" ] && run_image_using_bios - [ "$boot_type" == "uefi" ] && run_image_using_uefi + [ "$boot_type" = "bios" ] && run_image_using_bios + [ "$boot_type" = "uefi" ] && run_image_using_uefi } run_image_using_bios() {