# Handle the incoming configuration files:
config() {
  for infile in $1; do
    NEW="$infile"
    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...
  done
}

# An example of how you handle your '.new' config files:
#config etc/steamclient.conf.new

# Update the desktop database:
if [ -x usr/bin/update-desktop-database ]; then
  chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1
fi

# Update hicolor theme cache:
if [ -d usr/share/icons/hicolor ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null
  fi
fi

# Update the mime database:
if [ -x usr/bin/update-mime-database ]; then
  chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
( cd usr/bin ; rm -rf steam )
( cd usr/bin ; ln -sf /usr/lib/steam/bin_steam.sh steam )
( cd usr/doc/steamclient-1.0.0.76 ; rm -rf COPYING )
( cd usr/doc/steamclient-1.0.0.76 ; ln -sf steam_subscriber_agreement.txt COPYING )
( cd usr/lib/steam ; rm -rf bin_steamdeps.py )
( cd usr/lib/steam ; ln -sf /usr/bin/steamdeps bin_steamdeps.py )
( cd usr/lib/steam/local ; rm -rf lspci )
( cd usr/lib/steam/local ; ln -sf /sbin/lspci lspci )
( cd usr/lib/steam/local ; rm -rf pidof )
( cd usr/lib/steam/local ; ln -sf /sbin/pidof pidof )
( cd usr/lib/steam ; rm -rf steam.desktop )
( cd usr/lib/steam ; ln -sf /usr/share/applications/steam.desktop steam.desktop )
