]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tools/refresh.py
cannot use capture_output in subprocess.run
[nominatim.git] / nominatim / tools / refresh.py
index 805bd6348543de46b4ca8bf3f7dc0643e3389397..25a97127896076c08242cafac7a5365a7b5c520e 100644 (file)
@@ -155,7 +155,7 @@ def recompute_importance(conn):
     conn.commit()
 
 
     conn.commit()
 
 
-def setup_website(basedir, config):
+def setup_website(basedir, config, conn):
     """ Create the website script stubs.
     """
     if not basedir.exists():
     """ Create the website script stubs.
     """
     if not basedir.exists():
@@ -187,5 +187,10 @@ def setup_website(basedir, config):
 
     template += "\nrequire_once('{}/website/{{}}');\n".format(config.lib_dir.php)
 
 
     template += "\nrequire_once('{}/website/{{}}');\n".format(config.lib_dir.php)
 
+    search_name_table_exists = bool(conn and conn.table_exists('search_name'))
+
     for script in WEBSITE_SCRIPTS:
     for script in WEBSITE_SCRIPTS:
-        (basedir / script).write_text(template.format(script), 'utf-8')
+        if not search_name_table_exists and script == 'search.php':
+            (basedir / script).write_text(template.format('reverse-only-search.php'), 'utf-8')
+        else:
+            (basedir / script).write_text(template.format(script), 'utf-8')