config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1
fi

if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

if [ -x /usr/bin/gtk-update-icon-cache ] \
  && [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
fi

config etc/ardour2/SAE-de-keypad.bindings.new
config etc/ardour2/SAE-de-nokeypad.bindings.new
config etc/ardour2/SAE-us-keypad.bindings.new
config etc/ardour2/SAE-us-nokeypad.bindings.new
config etc/ardour2/ardour-sae.menus.new
config etc/ardour2/ardour.menus.new
config etc/ardour2/ardour2_ui_dark.rc.new
config etc/ardour2/ardour2_ui_dark_sae.rc.new
config etc/ardour2/ardour2_ui_default.conf.new
config etc/ardour2/ardour2_ui_light.rc.new
config etc/ardour2/ardour2_ui_light_sae.rc.new
config etc/ardour2/ardour_system.rc.new
config etc/ardour2/ergonomic-us.bindings.new
config etc/ardour2/mnemonic-us.bindings.new
