1 # SPDX-License-Identifier: GPL-3.0-or-later
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2024 by the Nominatim developer community.
6 # For a full list of authors see the git log.
10 def osm2pgsql_options(temp_db, tmp_path):
11 """ A standard set of options for osm2pgsql
12 together with a osm2pgsql mock that just reflects the command line.
14 osm2pgsql_exec = tmp_path / 'osm2pgsql_mock'
16 osm2pgsql_exec.write_text("""#!/bin/sh
18 if [ "$*" = "--version" ]; then
19 >&2 echo "2024-08-09 11:16:23 osm2pgsql version 11.7.2 (11.7.2)"
24 osm2pgsql_exec.chmod(0o777)
26 return dict(osm2pgsql=str(osm2pgsql_exec),
28 osm2pgsql_style='style.file',
30 dsn='dbname=' + temp_db,
32 tablespaces=dict(slim_data='', slim_index='',
33 main_data='', main_index=''))