Merge pull request #1099 from lonvia/sanity-check-pyosmium

More sanity checks for pyosmium tools
This commit is contained in:
Sarah Hoffmann 2018-07-20 21:37:27 +02:00 committed by GitHub
commit 271c23f459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -53,7 +53,7 @@ link_directories(${PostgreSQL_LIBRARY_DIRS})
find_program(PYOSMIUM pyosmium-get-changes)
if (NOT EXISTS "${PYOSMIUM}")
set(PYOSMIUM_PATH "/nonexistent")
set(PYOSMIUM_PATH "")
message(WARNING "pyosmium-get-changes not found (required for updates)")
else()
set(PYOSMIUM_PATH "${PYOSMIUM}")

View File

@ -68,6 +68,22 @@ if ($aResult['init-updates']) {
echo "Does the URL point to a directory containing OSM update data?\n\n";
fail('replication URL not reachable.');
}
// sanity check for pyosmium-get-changes
if (!CONST_Pyosmium_Binary) {
echo "\nCONST_Pyosmium_Binary not configured.\n";
echo "You need to install pyosmium and set up the path to pyosmium-get-changes\n";
echo "in your local settings file.\n\n";
fail('CONST_Pyosmium_Binary not configured');
}
$aOutput = 0;
$sCmd = CONST_Pyosmium_Binary.' --help';
exec($sCmd, $aOutput, $iRet);
if ($iRet != 0) {
echo "Cannot execute pyosmium-get-changes.\n";
echo "Make sure you have pyosmium installed correctly\n";
echo "and have set up CONST_Pyosmium_Binary to point to pyosmium-get-changes.\n";
fail('pyosmium-get-changes not found or not usable');
}
$sSetup = CONST_InstallPath.'/utils/setup.php';
$iRet = -1;
passthru($sSetup.' --create-functions --enable-diff-updates', $iRet);