@@ -13,15 +13,15 @@ function step_summary()
1313
1414export ARDUINO_BUILD_CACHE_PATH=" $cache_dir "
1515
16- sketches=" ${cache_dir} /sketches/"
17- cores=" ${cache_dir} /cores/"
18-
1916esp8266_dir=" ${ESP8266_ARDUINO_BUILD_DIR} "
2017commonfileh=" ${esp8266_dir} /cores/esp8266/CommonHFile.h"
2118
2219tests_dir=" $root /tests/test_mkbuildoptglobals"
2320tests=$( ls -1 " $tests_dir " | sed ' s/.sh$//g' )
2421
22+ cores_dir=" ${cache_dir} /cores/"
23+ sketches_dir=" ${cache_dir} /sketches/"
24+
2525function name_size_mtime()
2626{
2727 stat --printf ' %n:%s:%Y' " $1 "
@@ -31,13 +31,21 @@ function most_recent_file()
3131{
3232 local name=" $1 "
3333 local location=" $2 "
34- echo $( readlink -f " ${location} /" $( ls -t1 " ${location} " | grep " $name " | head -1) )
34+
35+ local file
36+ file=$( ls -t1 " ${location} " | grep " $name " | head -1)
37+
38+ readlink -f " ${location} /${file} "
3539}
3640
3741function most_recent_dir()
3842{
3943 local location=" $1 "
40- echo $( readlink -f " ${location} /" $( ls -t1 " $location " | head -1) )
44+
45+ local file
46+ file=$( ls -t1 " $location " | head -1)
47+
48+ readlink -f " ${location} /${file} "
4149}
4250
4351function assert_build()
@@ -80,20 +88,25 @@ function build_esp8266_example()
8088
8189function make_commonh_stat()
8290{
83- local stat= $( name_size_mtime " $commonfileh " )
84- test -n " $stat "
91+ local stat
92+ stat= $( name_size_mtime " $commonfileh " )
8593
94+ test -n " $stat "
8695 echo " $stat "
8796}
8897
8998function make_core_stat()
9099{
91- local recent_core= $( most_recent_dir " $cores " )
92- local recent_file =$( most_recent_file " core.a " " $recent_core " )
100+ local recent_core
101+ recent_core =$( most_recent_dir " $cores_dir " )
93102
94- local stat= $( name_size_mtime " $ recent_file" )
95- test -n " $stat "
103+ local recent_file
104+ recent_file= $( most_recent_file " core.a " " $recent_core " )
96105
106+ local stat
107+ stat=$( name_size_mtime " $recent_file " )
108+
109+ test -n " $stat "
97110 echo " $stat "
98111}
99112
@@ -105,7 +118,7 @@ case "${1:-}" in
105118" run" )
106119 for test in $tests ; do
107120 printf " Checking \" %s\" \n" " $test "
108- /usr/bin/env bash $root /tests/test_mkbuildoptglobals.sh $test
121+ /usr/bin/env bash " $root " /tests/test_mkbuildoptglobals.sh " $test "
109122 done
110123 ;;
111124* )
0 commit comments