config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    rm $NEW
  fi
}

config etc/pki/fwupd/GPG-KEY-Hughski-Limited.new
config etc/pki/fwupd/GPG-KEY-Linux-Foundation-Firmware.new
config etc/pki/fwupd/GPG-KEY-Linux-Vendor-Firmware-Service.new
config etc/pki/fwupd/LVFS-CA.pem.new
config etc/pki/fwupd-metadata/GPG-KEY-Linux-Foundation-Metadata.new
config etc/pki/fwupd-metadata/GPG-KEY-Linux-Vendor-Firmware-Service.new
config etc/pki/fwupd-metadata/LVFS-CA.pem.new
config etc/fwupd/remotes.d/lvfs.conf.new
config etc/fwupd/remotes.d/lvfs-testing.conf.new
config etc/fwupd/remotes.d/vendor.conf.new
config etc/fwupd/remotes.d/vendor-directory.conf.new
config etc/fwupd/remotes.d/fwupd-tests.conf.new
config etc/fwupd/daemon.conf.new
config etc/fwupd/redfish.conf.new
config etc/fwupd/thunderbolt.conf.new
config etc/fwupd/upower.conf.new

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi
( cd usr/bin ; rm -rf fwupdagent )
( cd usr/bin ; ln -sf fwupdmgr fwupdagent )
( cd usr/lib64 ; rm -rf libfwupd.so )
( cd usr/lib64 ; ln -sf libfwupd.so.2 libfwupd.so )
( cd usr/lib64 ; rm -rf libfwupd.so.2 )
( cd usr/lib64 ; ln -sf libfwupd.so.2.0.0 libfwupd.so.2 )
( cd usr/lib64 ; rm -rf libfwupdplugin.so )
( cd usr/lib64 ; ln -sf libfwupdplugin.so.5 libfwupdplugin.so )
( cd usr/lib64 ; rm -rf libfwupdplugin.so.5 )
( cd usr/lib64 ; ln -sf libfwupdplugin.so.5.0.0 libfwupdplugin.so.5 )
( cd usr/lib64 ; rm -rf libjcat.so )
( cd usr/lib64 ; ln -sf libjcat.so.1 libjcat.so )
( cd usr/lib64 ; rm -rf libjcat.so.1 )
( cd usr/lib64 ; ln -sf libjcat.so.1.0.0 libjcat.so.1 )
( cd usr/lib64 ; rm -rf libxmlb.so )
( cd usr/lib64 ; ln -sf libxmlb.so.2 libxmlb.so )
( cd usr/lib64 ; rm -rf libxmlb.so.2 )
( cd usr/lib64 ; ln -sf libxmlb.so.2.0.0 libxmlb.so.2 )
