# HG changeset patch # User Matti Hamalainen # Date 1586571804 -10800 # Node ID 068ea2f447ccc7790c83f475579d1b9718897a5f # Parent 372ae2fd1db090a7ae3b3fdd4b32cecd481f6039 Add simple check for existence of the utility executables. diff -r 372ae2fd1db0 -r 068ea2f447cc tools/makegmaps.php --- a/tools/makegmaps.php Sat Apr 11 05:11:53 2020 +0300 +++ b/tools/makegmaps.php Sat Apr 11 05:23:24 2020 +0300 @@ -201,7 +201,7 @@ else if (preg_match("/^https?:\/\/[a-zA-Z0-9]+[a-zA-Z0-9\/\.\:\-]*?\//", $sprefix) === FALSE) { - echo "Malformed URL (or atleast this silly regexp does not want it.\n"; + echo "Malformed URL (or atleast this silly regexp does not accept it.\n"; return FALSE; } else @@ -229,7 +229,28 @@ if ($cdata[0] == $level) { $def = ($cdata[1] !== FALSE) ? $cdata[1] : $cfg[$citem]; - $cfg[$citem] = stInputPrompt($cdata[2], $def, "stValidateNotEmpty"); + + $sdone = FALSE; + while (!$sdone) + { + $tmp = $cfg[$citem] = stInputPrompt($cdata[2], $def, "stValidateNotEmpty"); + + switch ($cdata[0]) + { + case 1: + exec("which ".escapeshellarg($tmp), $tmpOut, $res); + if ($res != 0) + { + echo "ERROR: Could not find '".$tmp."'. Perhaps it is not in path, or path is wrong.\n"; + } + else + $sdone = TRUE; + break; + + default: + $sdone = TRUE; + } + } } } }