( cd usr/doc/glib-2.68.4 ; rm -rf NetworkManager )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/NetworkManager NetworkManager )
( cd usr/doc/glib-2.68.4 ; rm -rf atk )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/atk atk )
( cd usr/doc/glib-2.68.4 ; rm -rf cairo )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/cairo cairo )
( cd usr/doc/glib-2.68.4 ; rm -rf dbus-glib )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/dbus-glib dbus-glib )
( cd usr/doc/glib-2.68.4 ; rm -rf dconf )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/dconf dconf )
( cd usr/doc/glib-2.68.4 ; rm -rf exo-2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/exo-2 exo-2 )
( cd usr/doc/glib-2.68.4 ; rm -rf farstream-libs-0.2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/farstream-libs-0.2 farstream-libs-0.2 )
( cd usr/doc/glib-2.68.4 ; rm -rf farstream-plugins-0.2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/farstream-plugins-0.2 farstream-plugins-0.2 )
( cd usr/doc/glib-2.68.4 ; rm -rf gail-libgail-util )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gail-libgail-util gail-libgail-util )
( cd usr/doc/glib-2.68.4 ; rm -rf gail-libgail-util3 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gail-libgail-util3 gail-libgail-util3 )
( cd usr/doc/glib-2.68.4 ; rm -rf garcon )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/garcon garcon )
( cd usr/doc/glib-2.68.4 ; rm -rf gck )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gck gck )
( cd usr/doc/glib-2.68.4 ; rm -rf gconf )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gconf gconf )
( cd usr/doc/glib-2.68.4 ; rm -rf gcr )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gcr gcr )
( cd usr/doc/glib-2.68.4 ; rm -rf gdk2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gdk2 gdk2 )
( cd usr/doc/glib-2.68.4 ; rm -rf gdk3 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gdk3 gdk3 )
( cd usr/doc/glib-2.68.4 ; rm -rf gi )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gi gi )
( cd usr/doc/glib-2.68.4 ; rm -rf gio )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gio gio )
( cd usr/doc/glib-2.68.4 ; rm -rf glib )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/glib glib )
( cd usr/doc/glib-2.68.4 ; rm -rf gmime-3.2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gmime-3.2 gmime-3.2 )
( cd usr/doc/glib-2.68.4 ; rm -rf gnome-keyring )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gnome-keyring gnome-keyring )
( cd usr/doc/glib-2.68.4 ; rm -rf gobject )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gobject gobject )
( cd usr/doc/glib-2.68.4 ; rm -rf gsf )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gsf gsf )
( cd usr/doc/glib-2.68.4 ; rm -rf gtk2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gtk2 gtk2 )
( cd usr/doc/glib-2.68.4 ; rm -rf gtk3 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gtk3 gtk3 )
( cd usr/doc/glib-2.68.4 ; rm -rf gtksourceview-3.0 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gtksourceview-3.0 gtksourceview-3.0 )
( cd usr/doc/glib-2.68.4 ; rm -rf gtkspell )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/gtkspell gtkspell )
( cd usr/doc/glib-2.68.4 ; rm -rf harfbuzz )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/harfbuzz harfbuzz )
( cd usr/doc/glib-2.68.4 ; rm -rf ibus )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/ibus ibus )
( cd usr/doc/glib-2.68.4 ; rm -rf keybinder-3.0 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/keybinder-3.0 keybinder-3.0 )
( cd usr/doc/glib-2.68.4 ; rm -rf libaccountsservice )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libaccountsservice libaccountsservice )
( cd usr/doc/glib-2.68.4 ; rm -rf libappindicator )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libappindicator libappindicator )
( cd usr/doc/glib-2.68.4 ; rm -rf libblockdev )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libblockdev libblockdev )
( cd usr/doc/glib-2.68.4 ; rm -rf libbytesize )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libbytesize libbytesize )
( cd usr/doc/glib-2.68.4 ; rm -rf libcanberra )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libcanberra libcanberra )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimp )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimp libgimp )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpbase )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpbase libgimpbase )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpcolor )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpcolor libgimpcolor )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpconfig )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpconfig libgimpconfig )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpmath )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpmath libgimpmath )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpmodule )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpmodule libgimpmodule )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpthumb )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpthumb libgimpthumb )
( cd usr/doc/glib-2.68.4 ; rm -rf libgimpwidgets )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgimpwidgets libgimpwidgets )
( cd usr/doc/glib-2.68.4 ; rm -rf libglade )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libglade libglade )
( cd usr/doc/glib-2.68.4 ; rm -rf libgnt )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgnt libgnt )
( cd usr/doc/glib-2.68.4 ; rm -rf libgpod )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgpod libgpod )
( cd usr/doc/glib-2.68.4 ; rm -rf libgtop )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libgtop libgtop )
( cd usr/doc/glib-2.68.4 ; rm -rf libical-glib )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libical-glib libical-glib )
( cd usr/doc/glib-2.68.4 ; rm -rf libnm )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libnm libnm )
( cd usr/doc/glib-2.68.4 ; rm -rf libnma )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libnma libnma )
( cd usr/doc/glib-2.68.4 ; rm -rf libnotify )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libnotify libnotify )
( cd usr/doc/glib-2.68.4 ; rm -rf liboil )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/liboil liboil )
( cd usr/doc/glib-2.68.4 ; rm -rf libpsl )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libpsl libpsl )
( cd usr/doc/glib-2.68.4 ; rm -rf libsecret-1 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libsecret-1 libsecret-1 )
( cd usr/doc/glib-2.68.4 ; rm -rf libwnck )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libwnck libwnck )
( cd usr/doc/glib-2.68.4 ; rm -rf libwnck-3.0 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libwnck-3.0 libwnck-3.0 )
( cd usr/doc/glib-2.68.4 ; rm -rf libxfce4panel-2.0 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libxfce4panel-2.0 libxfce4panel-2.0 )
( cd usr/doc/glib-2.68.4 ; rm -rf libxfce4ui )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libxfce4ui libxfce4ui )
( cd usr/doc/glib-2.68.4 ; rm -rf libxfce4util )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libxfce4util libxfce4util )
( cd usr/doc/glib-2.68.4 ; rm -rf libxklavier )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libxklavier libxklavier )
( cd usr/doc/glib-2.68.4 ; rm -rf libxml2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/libxml2 libxml2 )
( cd usr/doc/glib-2.68.4 ; rm -rf orc )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/orc orc )
( cd usr/doc/glib-2.68.4 ; rm -rf p11-kit )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/p11-kit p11-kit )
( cd usr/doc/glib-2.68.4 ; rm -rf polkit-1 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/polkit-1 polkit-1 )
( cd usr/doc/glib-2.68.4 ; rm -rf poppler )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/poppler poppler )
( cd usr/doc/glib-2.68.4 ; rm -rf pygobject )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/pygobject pygobject )
( cd usr/doc/glib-2.68.4 ; rm -rf pygtk )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/pygtk pygtk )
( cd usr/doc/glib-2.68.4 ; rm -rf rsvg-2.0 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/rsvg-2.0 rsvg-2.0 )
( cd usr/doc/glib-2.68.4 ; rm -rf thunarx )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/thunarx thunarx )
( cd usr/doc/glib-2.68.4 ; rm -rf tumbler )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/tumbler tumbler )
( cd usr/doc/glib-2.68.4 ; rm -rf udisks2 )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/udisks2 udisks2 )
( cd usr/doc/glib-2.68.4 ; rm -rf xfconf )
( cd usr/doc/glib-2.68.4 ; ln -sf /usr/share/gtk-doc/html/xfconf xfconf )
( cd usr/lib ; rm -rf libgio-2.0.so )
( cd usr/lib ; ln -sf libgio-2.0.so.0 libgio-2.0.so )
( cd usr/lib ; rm -rf libgio-2.0.so.0 )
( cd usr/lib ; ln -sf libgio-2.0.so.0.6800.4 libgio-2.0.so.0 )
( cd usr/lib ; rm -rf libglib-2.0.so )
( cd usr/lib ; ln -sf libglib-2.0.so.0 libglib-2.0.so )
( cd usr/lib ; rm -rf libglib-2.0.so.0 )
( cd usr/lib ; ln -sf libglib-2.0.so.0.6800.4 libglib-2.0.so.0 )
( cd usr/lib ; rm -rf libgmodule-2.0.so )
( cd usr/lib ; ln -sf libgmodule-2.0.so.0 libgmodule-2.0.so )
( cd usr/lib ; rm -rf libgmodule-2.0.so.0 )
( cd usr/lib ; ln -sf libgmodule-2.0.so.0.6800.4 libgmodule-2.0.so.0 )
( cd usr/lib ; rm -rf libgobject-2.0.so )
( cd usr/lib ; ln -sf libgobject-2.0.so.0 libgobject-2.0.so )
( cd usr/lib ; rm -rf libgobject-2.0.so.0 )
( cd usr/lib ; ln -sf libgobject-2.0.so.0.6800.4 libgobject-2.0.so.0 )
( cd usr/lib ; rm -rf libgthread-2.0.so )
( cd usr/lib ; ln -sf libgthread-2.0.so.0 libgthread-2.0.so )
( cd usr/lib ; rm -rf libgthread-2.0.so.0 )
( cd usr/lib ; ln -sf libgthread-2.0.so.0.6800.4 libgthread-2.0.so.0 )

# 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
}

# Prepare the new configuration files
for file in etc/profile.d/libglib2.csh.new etc/profile.d/libglib2.sh.new ; do
  if test -e $(dirname $file)/$(basename $file .new) ; then
    if [ ! -x $(dirname $file)/$(basename $file .new) ]; then
      chmod 644 $file
     else
      chmod 755 $file
    fi
  fi
  config $file
done

# Try to run these.  If they fail, no biggie.
chroot . /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas/ 1> /dev/null 2> /dev/null
chroot . /usr/bin/gio-querymodules /usr/lib/gio/modules/ 1> /dev/null 2> /dev/null

