Revision 57cbd1cd tools/ide/QtCreator/QtCreatorSetup.sh
| tools/ide/QtCreator/QtCreatorSetup.sh | ||
|---|---|---|
| 263 | 263 |
return 0 |
| 264 | 264 |
} |
| 265 | 265 |
|
| 266 |
### check whether commands are available ####################################### |
|
| 267 |
# Checks whether the specified commands are available and can be executed. |
|
| 268 |
# |
|
| 269 |
# usage: checkCommand [<command> <command> ...] |
|
| 270 |
# arguments: <command> |
|
| 271 |
# Name of the command to check. |
|
| 272 |
# return: 0 |
|
| 273 |
# All requested commands are available. |
|
| 274 |
# >0 |
|
| 275 |
# Number of requested commands that were not found. |
|
| 276 |
# -1 |
|
| 277 |
# No argument given. |
|
| 278 |
# |
|
| 279 |
function checkCommands {
|
|
| 280 |
local status=0 |
|
| 281 |
|
|
| 282 |
# return if no argument was specified |
|
| 283 |
if [ $# -eq 0 ]; then |
|
| 284 |
return -1 |
|
| 285 |
fi |
|
| 286 |
|
|
| 287 |
# check all specified commands |
|
| 288 |
while [ $# -gt 0 ]; do |
|
| 289 |
command -v $1 &>/dev/null |
|
| 290 |
if [ $? -ne 0 ]; then |
|
| 291 |
printWarning "Command '$1' not available.\n" |
|
| 292 |
status=$((status + 1)) |
|
| 293 |
fi |
|
| 294 |
shift 1 |
|
| 295 |
done |
|
| 296 |
|
|
| 297 |
return $status |
|
| 298 |
} |
|
| 299 |
|
|
| 266 | 300 |
################################################################################ |
| 267 | 301 |
# SPECIFIC FUNCTIONS # |
| 268 | 302 |
################################################################################ |
| ... | ... | |
| 418 | 452 |
# The specified <module> could not be found. |
| 419 | 453 |
# -3 |
| 420 | 454 |
# Parsing the project for the specified module failed. |
| 455 |
# -4 |
|
| 456 |
# Missing dependencies. |
|
| 421 | 457 |
# |
| 422 | 458 |
function createModuleProject {
|
| 423 | 459 |
local userdir=$(pwd) |
| ... | ... | |
| 430 | 466 |
local outvar="" |
| 431 | 467 |
local gccoutvar="" |
| 432 | 468 |
|
| 469 |
# check dependencies |
|
| 470 |
checkCommands make |
|
| 471 |
if [ $? -ne 0 ]; then |
|
| 472 |
printError "Missing dependencies detected.\n" |
|
| 473 |
return -4 |
|
| 474 |
fi |
|
| 475 |
|
|
| 433 | 476 |
# parse arguments |
| 434 | 477 |
local otherargs=() |
| 435 | 478 |
while [ $# -gt 0 ]; do |
Also available in: Unified diff