diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-10-26 02:32:54 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-10-28 23:30:01 -0400 |
commit | 85934d62d767a484fa560066b6edb69a18145690 (patch) | |
tree | 8136b2cdfe3bee1b8ed854d519811e953ca0e4a7 /tools/boot-keys | |
parent | c3f80f40f9e9b7bc3a57c3ed774dfdc1f46a8196 (diff) | |
download | librebootfr-85934d62d767a484fa560066b6edb69a18145690.tar.gz librebootfr-85934d62d767a484fa560066b6edb69a18145690.zip |
Replace usage of the '[' Bash builtin with '[['
There's no benefit to using the POSIX-style '[' test builtin
considering its '-a' and '-o' operators are unused in the Libreboot
build system. Plus, '[[' is safer with respect to any containing file
redirections (for example).
Prior, both '[' and '[[' were used throughout the codebase--a
disparity in usage which this change aims to eliminate.
Diffstat (limited to 'tools/boot-keys')
-rwxr-xr-x | tools/boot-keys/boot-keys | 8 | ||||
-rwxr-xr-x | tools/boot-keys/boot-keys-helper | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/boot-keys/boot-keys b/tools/boot-keys/boot-keys index a556aa41..5d133742 100755 --- a/tools/boot-keys/boot-keys +++ b/tools/boot-keys/boot-keys @@ -22,7 +22,7 @@ usage() { generate() { local type=$( boot_keys_type "$@" ) - if [ -z "$type" ] + if [[ -z "$type" ]] then printf 1>&2 '%s\n' 'Unable to determine keys type' return 1 @@ -45,7 +45,7 @@ sign() { local kernel_path local media - if [ -z "$type" ] + if [[ -z "$type" ]] then printf 1>&2 '%s\n' 'Unable to determine keys type' return 1 @@ -66,7 +66,7 @@ sign() { do kernel_path="$install_path/$KERNEL-$medium.$IMG" - if [ -f "$kernel_path" ] + if [[ -f "$kernel_path" ]] then boot_keys_cros "$type-prepare" "sign" "$kernel_path" else @@ -88,7 +88,7 @@ verify() { local kernel_path local media - if [ -z "$type" ] + if [[ -z "$type" ]] then printf 1>&2 '%s\n' 'Unable to determine keys type' return 1 diff --git a/tools/boot-keys/boot-keys-helper b/tools/boot-keys/boot-keys-helper index 5d01916a..df53ec5b 100755 --- a/tools/boot-keys/boot-keys-helper +++ b/tools/boot-keys/boot-keys-helper @@ -13,7 +13,7 @@ boot_keys_cros() { local cros_scripts_path=$( project_install_path "cros-scripts" ) local cros_script_path="$cros_scripts_path/$cros_script" - if ! [ -x "$cros_script_path" ] + if ! [[ -x "$cros_script_path" ]] then printf 1>&2 '%s' "$cros_script script missing from cros-scripts install" return 1 @@ -37,7 +37,7 @@ boot_keys_files_install_path() { helper_arguments=$( project_action_helper "arguments" "$project" "$@" ) - if [ $? -ne 0 ] || [ -z "$helper_arguments" ] + if [[ $? -ne 0 ]] || [[ -z "$helper_arguments" ]] then project_install_path "$project" "$@" else |