|
931 | 931 | ;;
|
932 | 932 | --maikodir)
|
933 | 933 | # for use in loadups
|
934 |
| - if [ "$2" = "-" ] || [ "$2" == "--" ] |
| 934 | + if [ "$2" = "-" ] || [ "$2" = "--" ] |
935 | 935 | then
|
936 | 936 | maikodir_arg=""
|
937 | 937 | maikodir_stage=""
|
@@ -1360,34 +1360,45 @@ check_for_maiko_exe () {
|
1360 | 1360 |
|
1361 | 1361 | if [ -z "${maikodir_arg}" ]
|
1362 | 1362 | then
|
1363 |
| - if check_for_maiko_exe "${MEDLEYDIR}/maiko" |
1364 |
| - then |
1365 |
| - maikodir_arg="${MEDLEYDIR}/maiko" |
1366 |
| - elif check_for_maiko_exe "${MEDLEYDIR}/../maiko" |
| 1363 | + # No MAIKODIR specified. But is lde (or ldeinit) on the PATH? |
| 1364 | + # If so, use it. |
| 1365 | + maiko_exe="$(command -v "${maikoprog_arg}")" |
| 1366 | + if [ -z "${maiko_exe}" ] |
1367 | 1367 | then
|
1368 |
| - maikodir_arg="$(cd "${MEDLEYDIR}/../maiko"; pwd)" |
1369 |
| - else |
1370 |
| - if ! check_if_maiko_dir "${MEDLEYDIR}/maiko" && ! check_if_maiko_dir "${MEDLEYDIR}/../maiko" |
| 1368 | + # Lde (or ledinit) is not on the PATH, check in MEDLEYDIR/maiko and in MEDLEYDIR/../maiko |
| 1369 | + if check_for_maiko_exe "${MEDLEYDIR}/maiko" |
1371 | 1370 | then
|
1372 |
| - err_msg="ERROR: Cannot find the Maiko directory at either |
1373 |
| -\"${MEDLEYDIR}/maiko\" or \"${MEDLEYDIR}/../maiko\". |
| 1371 | + maikodir_arg="${MEDLEYDIR}/maiko" |
| 1372 | + elif check_for_maiko_exe "${MEDLEYDIR}/../maiko" |
| 1373 | + then |
| 1374 | + maikodir_arg="$(cd "${MEDLEYDIR}/../maiko"; pwd)" |
| 1375 | + else |
| 1376 | + # Not in MEDLEYDIR/maiko and in MEDLEYDIR/../maiko, put out the appropriate error msg and exit |
| 1377 | + if ! check_if_maiko_dir "${MEDLEYDIR}/maiko" && ! check_if_maiko_dir "${MEDLEYDIR}/../maiko" |
| 1378 | + then |
| 1379 | + err_msg="ERROR: The maiko executable ($maikoprog_arg) is not on the PATH and cannot find |
| 1380 | +the Maiko directory at either \"${MEDLEYDIR}/maiko\" |
| 1381 | +or \"${MEDLEYDIR}/../maiko\". |
1374 | 1382 | You can use the --maikodir argument or the MAIKODIR env variable
|
1375 | 1383 | to specify the Maiko directory.
|
1376 | 1384 | Exiting."
|
1377 |
| - output_error_msg "${err_msg}" |
1378 |
| - exit 53 |
1379 |
| - else |
1380 |
| - err_msg="ERROR: Cannot find the Maiko executable (${maiko_exe_subdir}/${maikoprog_arg}) in either |
1381 |
| -\"${MEDLEYDIR}/maiko\" or \"${MEDLEYDIR}/../maiko\". |
| 1385 | + output_error_msg "${err_msg}" |
| 1386 | + exit 53 |
| 1387 | + else |
| 1388 | + err_msg="ERROR: The maiko executable ($maikoprog_arg) is not on the PATH and cannot find |
| 1389 | +the Maiko executable (${maiko_exe_subdir}/${maikoprog_arg}) in either \"${MEDLEYDIR}/maiko\" |
| 1390 | +or \"${MEDLEYDIR}/../maiko\". |
1382 | 1391 | Exiting."
|
1383 |
| - output_error_msg "${err_msg}" |
1384 |
| - exit 54 |
| 1392 | + output_error_msg "${err_msg}" |
| 1393 | + exit 54 |
| 1394 | + fi |
1385 | 1395 | fi
|
1386 | 1396 | fi
|
1387 | 1397 | elif ! check_if_maiko_dir "${maikodir_arg}" || ! check_for_maiko_exe "${maikodir_arg}"
|
1388 | 1398 | then
|
| 1399 | + # MAIKODIR is specified but lde (or ldeinit) is not in fact there. Error exit. |
1389 | 1400 | err_msg="In ${maikodir_stage}:
|
1390 |
| -ERROR: The value provided by \$MAIKODIR or by the --maikodir argument ("${maikodir_arg}") is not |
| 1401 | +ERROR: The value provided by \$MAIKODIR or by the --maikodir argument (${maikodir_arg}) is not |
1391 | 1402 | in fact a directory containing the Maiko emulator (${maiko_exe_subdir}/${maikoprog_arg}).
|
1392 | 1403 | Exiting."
|
1393 | 1404 | output_error_msg "${err_msg}"
|
|
0 commit comments