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 /projects | |
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 'projects')
-rwxr-xr-x | projects/cros-ec/cros-ec | 6 | ||||
-rwxr-xr-x | projects/crossgcc/crossgcc | 6 | ||||
-rwxr-xr-x | projects/vboot/vboot | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/projects/cros-ec/cros-ec b/projects/cros-ec/cros-ec index 8fb75003..be7aa62b 100755 --- a/projects/cros-ec/cros-ec +++ b/projects/cros-ec/cros-ec @@ -73,7 +73,7 @@ build() { mkdir -p "$build_path" - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then make -C "$sources_path" out="$build_path" HOST_CROSS_COMPILE= -j$TASKS "utils" else @@ -104,7 +104,7 @@ release() { local repository=$project - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_release_install_archive "$project" "$TOOLS" "$@" else @@ -119,7 +119,7 @@ release_check() { local repository=$project - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_release_install_archive_check "$project" "$TOOLS" "$@" else diff --git a/projects/crossgcc/crossgcc b/projects/crossgcc/crossgcc index f0d7a5d1..92a46860 100755 --- a/projects/crossgcc/crossgcc +++ b/projects/crossgcc/crossgcc @@ -50,7 +50,7 @@ extract() { local tarball_install_path=$( crossgcc_tarball_install_path "$tarball" "$@" ) local tarball_install_directory_path=$( dirname "$tarball_install_path" ) - if [ -f "$tarball_sources_path" ] && ! [ -f "$tarball_install_path" ] + if [[ -f "$tarball_sources_path" ]] && ! [[ -f "$tarball_install_path" ]] then printf '%s\n' "Copying source archive $tarball for $project (with ${arguments:-no argument})" @@ -90,7 +90,7 @@ update() { local tarball_install_path=$( crossgcc_tarball_install_path "$tarball" "$@" ) local tarball_install_directory_path=$( dirname "$tarball_install_path" ) - if [ -f $tarball_sources_path ] + if [[ -f $tarball_sources_path ]] then printf '%s\n' "Copying source archive $tarball for $project (with ${arguments:-no argument})" @@ -190,7 +190,7 @@ release() { mkdir -p "$release_path" - if [ -f "$tarball_install_path" ] && ! [ -f "$tarball_release_path" ] + if [[ -f "$tarball_install_path" ]] && ! [[ -f "$tarball_release_path" ]] then printf '%s\n' "Releasing source archive $tarball for $project (with ${arguments:-no argument})" diff --git a/projects/vboot/vboot b/projects/vboot/vboot index a36791d6..55d28c87 100755 --- a/projects/vboot/vboot +++ b/projects/vboot/vboot @@ -75,7 +75,7 @@ build() { git_project_checkout "$project" "$repository" "$@" fi - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then local sources_path=$( project_sources_path "$project" "$repository" "$@" ) local build_path=$( project_build_path "$project" "$@" ) @@ -92,7 +92,7 @@ build() { build_check() { local target=$1 - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_build_check "$project" "$@" fi @@ -101,7 +101,7 @@ build_check() { install() { local target=$1 - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_install "$project" "$@" fi @@ -110,7 +110,7 @@ install() { install_check() { local target=$1 - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_install_check "$project" "$@" fi @@ -121,7 +121,7 @@ release() { local repository=$project - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_release_install_archive "$project" "$TOOLS" "$@" fi @@ -134,7 +134,7 @@ release_check() { local repository=$project - if [ "$target" = "tools" ] + if [[ "$target" = "tools" ]] then project_release_install_archive_check "$project" "$TOOLS" "$@" fi |