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