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

( cd usr/bin ; rm -rf hp-makeuri )
( cd usr/bin ; ln -sf ../share/hplip/makeuri.py hp-makeuri )
( cd usr/bin ; rm -rf hp-systray )
( cd usr/bin ; ln -sf ../share/hplip/systray.py hp-systray )
( cd usr/bin ; rm -rf hp-toolbox )
( cd usr/bin ; ln -sf ../share/hplip/toolbox.py hp-toolbox )
( cd usr/bin ; rm -rf hp-levels )
( cd usr/bin ; ln -sf ../share/hplip/levels.py hp-levels )
( cd usr/bin ; rm -rf hp-testpage )
( cd usr/bin ; ln -sf ../share/hplip/testpage.py hp-testpage )
( cd usr/bin ; rm -rf hp-unload )
( cd usr/bin ; ln -sf ../share/hplip/unload.py hp-unload )
( cd usr/bin ; rm -rf hp-firmware )
( cd usr/bin ; ln -sf ../share/hplip/firmware.py hp-firmware )
( cd usr/bin ; rm -rf hp-colorcal )
( cd usr/bin ; ln -sf ../share/hplip/colorcal.py hp-colorcal )
( cd usr/bin ; rm -rf hp-fab )
( cd usr/bin ; ln -sf ../share/hplip/fab.py hp-fab )
( cd usr/bin ; rm -rf hp-info )
( cd usr/bin ; ln -sf ../share/hplip/info.py hp-info )
( cd usr/bin ; rm -rf hp-scan )
( cd usr/bin ; ln -sf ../share/hplip/scan.py hp-scan )
( cd usr/bin ; rm -rf hp-align )
( cd usr/bin ; ln -sf ../share/hplip/align.py hp-align )
( cd usr/bin ; rm -rf hp-check )
( cd usr/bin ; ln -sf ../share/hplip/check.py hp-check )
( cd usr/bin ; rm -rf hp-clean )
( cd usr/bin ; ln -sf ../share/hplip/clean.py hp-clean )
( cd usr/bin ; rm -rf hp-print )
( cd usr/bin ; ln -sf ../share/hplip/print.py hp-print )
( cd usr/bin ; rm -rf hp-probe )
( cd usr/bin ; ln -sf ../share/hplip/probe.py hp-probe )
( cd usr/bin ; rm -rf hp-setup )
( cd usr/bin ; ln -sf ../share/hplip/setup.py hp-setup )
( cd usr/bin ; rm -rf hp-timedate )
( cd usr/bin ; ln -sf ../share/hplip/timedate.py hp-timedate )
( cd usr/bin ; rm -rf hp-makecopies )
( cd usr/bin ; ln -sf ../share/hplip/makecopies.py hp-makecopies )
( cd usr/bin ; rm -rf hp-sendfax )
( cd usr/bin ; ln -sf ../share/hplip/sendfax.py hp-sendfax )
( cd usr/lib64/sane ; rm -rf libsane-hpaio.so )
( cd usr/lib64/sane ; ln -sf libsane-hpaio.so.1.0.0 libsane-hpaio.so )
( cd usr/lib64/sane ; rm -rf libsane-hpaio.so.1 )
( cd usr/lib64/sane ; ln -sf libsane-hpaio.so.1.0.0 libsane-hpaio.so.1 )
( cd usr/lib64 ; rm -rf libhpmud.so.0 )
( cd usr/lib64 ; ln -sf libhpmud.so.0.0.2 libhpmud.so.0 )
( cd usr/lib64 ; rm -rf libhpmud.so )
( cd usr/lib64 ; ln -sf libhpmud.so.0.0.2 libhpmud.so )
( cd usr/lib64 ; rm -rf libhpip.so )
( cd usr/lib64 ; ln -sf libhpip.so.0.0.1 libhpip.so )
( cd usr/lib64 ; rm -rf libhpip.so.0 )
( cd usr/lib64 ; ln -sf libhpip.so.0.0.1 libhpip.so.0 )
