OSDN Git Service

[fix] : Use = and Not use ==
authorhayao <shun819.mail@gmail.com>
Sat, 26 Sep 2020 07:32:26 +0000 (16:32 +0900)
committerhayao <shun819.mail@gmail.com>
Sat, 26 Sep 2020 07:32:26 +0000 (16:32 +0900)
allarch.sh
build.sh
channels/cinnamon/airootfs.any/usr/local/bin/alterlinux-welcome-page
channels/releng/airootfs.any/root/.automated_script.sh
channels/share/airootfs.any/root/.automated_script.sh
channels/share/airootfs.any/root/customize_airootfs.sh
system/mkalteriso.sh
tools/channel.sh
tools/fullbuild.sh
tools/run_archiso.sh

index d91c885..6336b4e 100755 (executable)
@@ -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))
index 13fe814..8ba7ecc 100755 (executable)
--- 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"
index 8102b92..807d1f2 100755 (executable)
@@ -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
index 81a98a1..d99cb5b 100755 (executable)
@@ -29,6 +29,6 @@ automated_script ()
     fi
 }
 
-if [[ $(tty) == "/dev/tty1" ]]; then
+if [[ "$(tty)" = "/dev/tty1" ]]; then
     automated_script
 fi
index 72c93e0..6cbbe01 100755 (executable)
@@ -36,6 +36,6 @@ automated_script ()
     fi
 }
 
-if [[ $(tty) == "/dev/tty1" ]]; then
+if [[ "$(tty)" = "/dev/tty1" ]]; then
     automated_script
 fi
index 0198b8a..7fa6e62 100755 (executable)
@@ -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
index 1e53453..3b5b94e 100755 (executable)
@@ -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
index cc7dd6c..0aa0625 100755 (executable)
@@ -60,7 +60,7 @@ gen_channel_list() {
 
 check() {
     gen_channel_list
-    if [[ ! "${#}" == "1" ]]; then
+    if [[ ! "${#}" = "1" ]]; then
         _help
         exit 1
     fi
index 76747e7..f6f5064 100755 (executable)
@@ -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."
index 2f78f16..8aadcd1 100644 (file)
@@ -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() {