mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
check that replication URL points to a repo of OSM diffs
Also check that pyosmium does not return None to work around a bad return code in the current release of pyosmium-get-changes. Fixes #784.
This commit is contained in:
@@ -59,6 +59,13 @@ if (!is_null(CONST_Osm2pgsql_Flatnode_File)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($aResult['init-updates']) {
|
if ($aResult['init-updates']) {
|
||||||
|
// sanity check that the replication URL is correct
|
||||||
|
$sBaseState = file_get_contents(CONST_Replication_Url.'/state.txt');
|
||||||
|
if ($sBaseState === false) {
|
||||||
|
echo "\nCannot find state.txt file at the configured replication URL.\n";
|
||||||
|
echo "Does the URL point to a directory containing OSM update data?\n\n";
|
||||||
|
fail("replication URL not reachable.");
|
||||||
|
}
|
||||||
$sSetup = CONST_InstallPath.'/utils/setup.php';
|
$sSetup = CONST_InstallPath.'/utils/setup.php';
|
||||||
$iRet = -1;
|
$iRet = -1;
|
||||||
passthru($sSetup.' --create-functions --enable-diff-updates', $iRet);
|
passthru($sSetup.' --create-functions --enable-diff-updates', $iRet);
|
||||||
@@ -75,9 +82,9 @@ if ($aResult['init-updates']) {
|
|||||||
|
|
||||||
// get the appropriate state id
|
// get the appropriate state id
|
||||||
$aOutput = 0;
|
$aOutput = 0;
|
||||||
exec(CONST_Pyosmium_Binary.' -D '.$sWindBack.' --server '.CONST_Replication_Url,
|
$sCmd = CONST_Pyosmium_Binary.' -D '.$sWindBack.' --server '.CONST_Replication_Url;
|
||||||
$aOutput, $iRet);
|
exec($sCmd, $aOutput, $iRet);
|
||||||
if ($iRet != 0) {
|
if ($iRet != 0 || $aOutput[0] == 'None') {
|
||||||
fail('Error running pyosmium tools');
|
fail('Error running pyosmium tools');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user