starttime=`date +%s`
-<% if node[:nominatim][:enable_git_updates] -%>
-if /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-source; then
- pushd <%= @builddir %>
- make install
-<% if node[:nominatim][:api_flavour] == "python" -%>
- systemctl reload nominatim
-<% end -%>
+EXTRA_PIP='--extra-index-url <%= node[:nominatim][:pip_index] %>'
+# First update the importer and run the migrations.
+if <%= @venvprefix %>pip list $EXTRA_PIP --outdated | fgrep -q nominatim-db; then
+ <%= @venvprefix %>pip install $EXTRA_PIP -U nominatim-db
if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-refresh-db; then
date "+%c === Database refresh failed. Stopping updates."
exit 1
fi
fi
-<% end -%>
+# Then only attempt to update the frontend.
+if <%= @venvprefix %>pip list $EXTRA_PIP --outdated | fgrep -q nominatim-api; then
+ <%= @venvprefix %>pip install $EXTRA_PIP -U nominatim-api
+ systemctl reload nominatim
+fi
if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-data; then
date "+%c === Data update failed. Stopping updates."