| 168 | | set build.cmd "$nice_prefix${build.cmd}$jobs_suffix" |
| | 168 | set build.cmd [list] |
| | 169 | |
| | 170 | # If build.cmd can be a series of commands, we need to iterate through the |
| | 171 | # list and apply nice to commands that are not shell built-in commands. |
| | 172 | set add_nice_prefix 1 |
| | 173 | foreach word [split [join $realcmd]] { |
| | 174 | # Only the first word in build.cmd and words that follow the control |
| | 175 | # operators && and || should be commands. |
| | 176 | if {$add_nice_prefix && ![catch {findBinary $word} result]} { |
| | 177 | lappend build.cmd "$nice_prefix$word" |
| | 178 | } else { |
| | 179 | lappend build.cmd $word |
| | 180 | } |
| | 181 | set add_nice_prefix 0 |
| | 182 | |
| | 183 | if {$word eq "&&" || $word eq "||"} { |
| | 184 | set add_nice_prefix 1 |
| | 185 | } |
| | 186 | } |
| | 187 | set build.cmd "[join ${build.cmd}]$jobs_suffix" |
| | 188 | |