From 378983ff5245acbf8236941f10b5e3090ca9d4dd Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 10 Oct 2016 00:02:25 +0300 Subject: bugfix The infamous nounset & ${xs[@]+"${xs[@]}"} thing. --- %HOME%/.bash_utils/cxx.sh | 16 ++++++++-------- %HOME%/.bash_utils/distr.sh | 4 ++-- %HOME%/.bash_utils/git.sh | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to '%HOME%/.bash_utils') diff --git a/%HOME%/.bash_utils/cxx.sh b/%HOME%/.bash_utils/cxx.sh index 527c120..92113d1 100644 --- a/%HOME%/.bash_utils/cxx.sh +++ b/%HOME%/.bash_utils/cxx.sh @@ -10,7 +10,7 @@ runc_flags=('-Wall' '-Wextra') runc() ( set -o errexit -o nounset -o pipefail - local -a c_flags=("${runc_flags[@]+"${runc_flags[@]}"}") + local -a c_flags=(${runc_flags[@]+"${runc_flags[@]}"}) local -a src_files local -a prog_flags @@ -55,10 +55,10 @@ runc() ( output_name="$( mktemp --tmpdir=. "${FUNCNAME[0]}XXX.exe" )" gcc -o "$output_name" \ - "${c_flags[@]+"${c_flags[@]}"}" \ - "${src_files[@]+"${src_files[@]}"}" + ${c_flags[@]+"${c_flags[@]}"} \ + ${src_files[@]+"${src_files[@]}"} - "$output_name" "${prog_flags[@]+"${prog_flags[@]}"}" + "$output_name" ${prog_flags[@]+"${prog_flags[@]}"} ) runcxx_flags=('-Wall' '-Wextra' '-std=c++14') @@ -66,7 +66,7 @@ runcxx_flags=('-Wall' '-Wextra' '-std=c++14') runcxx() ( set -o errexit -o nounset -o pipefail - local -a cxx_flags=("${runcxx_flags[@]+"${runcxx_flags[@]}"}") + local -a cxx_flags=(${runcxx_flags[@]+"${runcxx_flags[@]}"}) local -a src_files local -a prog_flags @@ -111,8 +111,8 @@ runcxx() ( output_name="$( mktemp --tmpdir=. "${FUNCNAME[0]}XXX.exe" )" g++ -o "$output_name" \ - "${cxx_flags[@]+"${cxx_flags[@]}"}" \ - "${src_files[@]+"${src_files[@]}"}" + ${cxx_flags[@]+"${cxx_flags[@]}"} \ + ${src_files[@]+"${src_files[@]}"} - "$output_name" "${prog_flags[@]+"${prog_flags[@]}"}" + "$output_name" ${prog_flags[@]+"${prog_flags[@]}"} ) diff --git a/%HOME%/.bash_utils/distr.sh b/%HOME%/.bash_utils/distr.sh index 58e088a..25407fb 100644 --- a/%HOME%/.bash_utils/distr.sh +++ b/%HOME%/.bash_utils/distr.sh @@ -35,7 +35,7 @@ update_checksums() ( fi done - sha1sum -- "${missing[@]+"${missing[@]}"}" >> "$checksums_path" + sha1sum -- ${missing[@]+"${missing[@]}"} >> "$checksums_path" ) update_checksums_distr() ( @@ -48,7 +48,7 @@ update_checksums_distr() ( paths+=("$path") done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -printf '%P\0' ) - update_checksums "${paths[@]+"${paths[@]}"}" + update_checksums ${paths[@]+"${paths[@]}"} ) verify_checksums() { diff --git a/%HOME%/.bash_utils/git.sh b/%HOME%/.bash_utils/git.sh index 54e50f6..ad7c6ee 100644 --- a/%HOME%/.bash_utils/git.sh +++ b/%HOME%/.bash_utils/git.sh @@ -29,7 +29,7 @@ list_repo_files() ( esac done - eval "${cmd[@]+"${cmd[@]}"}" + eval ${cmd[@]+"${cmd[@]}"} ) list_repo_dirs() ( @@ -58,7 +58,7 @@ list_repo_dirs() ( cmd+=(--name-only HEAD) - eval "${cmd[@]+"${cmd[@]}"}" + eval ${cmd[@]+"${cmd[@]}"} ) tighten_repo_security() ( -- cgit v1.2.3