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/blobs-discover | |
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/blobs-discover')
-rwxr-xr-x | tools/blobs-discover/blobs-discover | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/blobs-discover/blobs-discover b/tools/blobs-discover/blobs-discover index 6d143d02..3ced106c 100755 --- a/tools/blobs-discover/blobs-discover +++ b/tools/blobs-discover/blobs-discover @@ -18,7 +18,7 @@ arguments() { local project=$1 - if [ -z "$project" ] + if [[ -z "$project" ]] then ls -A "$root/$PROJECTS/" | while read project do @@ -50,7 +50,7 @@ update() { path_wildcard_expand "$patches_path" | while read patch_path do - if ! [ -f "$patch_path" ] + if ! [[ -f "$patch_path" ]] then continue fi @@ -75,7 +75,7 @@ verify() { requirements "sort" - if ! [ -z "$project_blobs_path" ] + if ! [[ -z "$project_blobs_path" ]] then project_blobs_discover_path="$( dirname $project_blobs_path )/$BLOBS_DISCOVER" else @@ -100,7 +100,7 @@ verify() { printf '%s' "Type \"blob\" to keep or press enter to discard: " read choice - if [ "$choice" = "blob" ] + if [[ "$choice" = "blob" ]] then printf '%s\n' "$file" >> "$project_blobs_path" else @@ -136,7 +136,7 @@ execute() { local project_blobs_ignore_path=$( project_blobs_ignore_path "$project" "$@" ) local project_blobs_directory_path - if ! [ -z "$project_blobs_path" ] + if ! [[ -z "$project_blobs_path" ]] then project_blobs_discover_path="$( dirname $project_blobs_path )/$BLOBS_DISCOVER" else @@ -159,17 +159,17 @@ execute() { printf '%s\n' "$files" | while read file do - if ! [ -z "$project_blobs_ignore_path" ] + if ! [[ -z "$project_blobs_ignore_path" ]] then match=$( grep "$file" "$project_blobs_ignore_path" || true) - if [ ! -z "$match" ] + if [[ ! -z "$match" ]] then continue fi fi match=$( "$deblob_check_path" -l -i "" "$file" || true ) - if ! [ -z "$match" ] + if ! [[ -z "$match" ]] then printf '%s\n' "$match" >> "$project_blobs_discover_path" fi @@ -187,7 +187,7 @@ execute_check() { local project_blobs_ignore_path=$( project_blobs_ignore_path "$project" "$@" ) local project_blobs_discover_path - if ! [ -z "$project_blobs_path" ] + if ! [[ -z "$project_blobs_path" ]] then project_blobs_discover_path="$( dirname $project_blobs_path )/$BLOBS_DISCOVER" else |