|
21 | 21 | # by default start in dashboard mode |
22 | 22 | [ -z "${DASHBOARD_MODE}" ] && DASHBOARD_MODE="yes" |
23 | 23 |
|
| 24 | +# trap CTRL+C in dashboard mode, as the build job runs in background, we have to tell the user to wait |
| 25 | +[ "${DASHBOARD_MODE}" = "yes" ] && trap control_c_pressed INT |
| 26 | + |
| 27 | +CONTROL_C_PRESSED=0 |
| 28 | + |
| 29 | +control_c_pressed() { |
| 30 | + CONTROL_C_PRESSED=1 |
| 31 | +} |
| 32 | + |
24 | 33 | # by default do not bail out after failed build |
25 | 34 | [ -z "${BAILOUT_FAILED}" ] && BAILOUT_FAILED="no" |
26 | 35 |
|
@@ -100,6 +109,7 @@ declare -i current=0 |
100 | 109 | failed_targets="" |
101 | 110 | declare -i failed_jobs=0 |
102 | 111 | declare -i good_jobs=0 |
| 112 | +SKIP_ANNOUNCED=0 |
103 | 113 |
|
104 | 114 | for target in ${targets} |
105 | 115 | do |
|
113 | 123 | out=${build[3]} |
114 | 124 | target_name=${device:-$project}.${arch} |
115 | 125 |
|
| 126 | + if [ ${SKIP_ANNOUNCED} -eq 1 ] |
| 127 | + then |
| 128 | + echo -e "\t${target_name}" |
| 129 | + continue |
| 130 | + fi |
| 131 | + |
116 | 132 | # initialize return value of the non-dashboard job |
117 | 133 | ret_nondb=0 |
118 | 134 |
|
|
164 | 180 | then |
165 | 181 | echo "" |
166 | 182 | echo "${statusline}" |
| 183 | + [ ${CONTROL_C_PRESSED} -eq 1 ] && echo "*** Control-C was pressed, please wait until current build finishes ***" |
167 | 184 | fi |
168 | 185 | # check if all packages have been built |
169 | 186 | pkgs_stat=$(head -n 1 ${statusfile} | cut -d" " -f5,7) |
|
178 | 195 | cat ${statusfile} |
179 | 196 | echo "" |
180 | 197 | echo "${statusline}" |
| 198 | + [ ${CONTROL_C_PRESSED} -eq 1 ] && echo "*** Control-C was pressed, please wait until current build finishes ***" |
181 | 199 | else |
182 | 200 | sleep ${rr} |
183 | 201 | fi |
|
194 | 212 | cat ${statusfile} |
195 | 213 | echo "" |
196 | 214 | echo "${statusline}" |
| 215 | + [ ${CONTROL_C_PRESSED} -eq 1 ] && echo "*** Control-C was pressed, please wait until current build finishes ***" |
197 | 216 | # check if there are any failed jobs in the dashboard |
198 | 217 | failed_count=$(cat ${statusfile} | grep "^\[" | cut -d' ' -f 2 | grep FAILED | wc -l) |
199 | 218 | if [ ${failed_count} -gt 0 ] |
|
239 | 258 | if [ ${count} -eq 0 ] |
240 | 259 | then |
241 | 260 | echo "failed - no release files found!" |
242 | | - echo -e "\nWARNING: No releaase files / images were found, skipping md5 checksum / mv to release folder!" |
| 261 | + echo -e "\nWARNING: No release files / images were found, skipping md5 checksum / mv to release folder!" |
243 | 262 | else |
244 | 263 | echo "failed - some release files were not created!" |
245 | | - echo -e "\nWARNING: Some releaase files / images may be missing!" |
| 264 | + echo -e "\nWARNING: Some release files / images may be missing!" |
246 | 265 | fi |
247 | 266 | fi |
248 | 267 | fi |
|
316 | 335 | failed_jobs+=1 |
317 | 336 | failed_targets+="${target_name} - no release files!\n" |
318 | 337 | fi |
| 338 | + if [ ${CONTROL_C_PRESSED} -eq 1 -a ${SKIP_ANNOUNCED} -eq 0 ] |
| 339 | + then |
| 340 | + echo "Skipping remaining builds:" |
| 341 | + SKIP_ANNOUNCED=1 |
| 342 | + fi |
319 | 343 | done |
320 | 344 |
|
321 | 345 | if [ $failed_jobs -gt 0 ] |
|
0 commit comments