#!/bin/sh
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...
}

config etc/profile.d/gvfs-bash-completion.sh.new

# update glib schemas
if [ -x usr/bin/glib-compile-schemas ]; then
  usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas 1> /dev/null 2> /dev/null
fi
( cd usr/lib ; rm -rf libgvfscommon.so )
( cd usr/lib ; ln -sf libgvfscommon.so.0.0.0 libgvfscommon.so )
( cd usr/lib ; rm -rf libgvfscommon.so.0 )
( cd usr/lib ; ln -sf libgvfscommon.so.0.0.0 libgvfscommon.so.0 )
( cd usr/lib ; rm -rf libgvfscommon-dnssd.so )
( cd usr/lib ; ln -sf libgvfscommon-dnssd.so.0.0.0 libgvfscommon-dnssd.so )
( cd usr/lib ; rm -rf libgvfscommon-dnssd.so.0 )
( cd usr/lib ; ln -sf libgvfscommon-dnssd.so.0.0.0 libgvfscommon-dnssd.so.0 )
