# 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/lib64/gio/modules/ 1> /dev/null 2> /dev/null

( cd usr/doc/glib-2.79.1 ; rm -rf COPYING )
( cd usr/doc/glib-2.79.1 ; ln -sf LICENSES/LGPL-2.1-or-later.txt COPYING )
( cd usr/doc/glib-2.79.1 ; rm -rf Libosinfo )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/Libosinfo Libosinfo )
( cd usr/doc/glib-2.79.1 ; rm -rf Libvirt-gconfig )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/Libvirt-gconfig Libvirt-gconfig )
( cd usr/doc/glib-2.79.1 ; rm -rf Libvirt-glib )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/Libvirt-glib Libvirt-glib )
( cd usr/doc/glib-2.79.1 ; rm -rf Libvirt-gobject )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/Libvirt-gobject Libvirt-gobject )
( cd usr/doc/glib-2.79.1 ; rm -rf NetworkManager )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/NetworkManager NetworkManager )
( cd usr/doc/glib-2.79.1 ; rm -rf UPower )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/UPower UPower )
( cd usr/doc/glib-2.79.1 ; rm -rf atk )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/atk atk )
( cd usr/doc/glib-2.79.1 ; rm -rf clutter-gst-3.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/clutter-gst-3.0 clutter-gst-3.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf colord )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/colord colord )
( cd usr/doc/glib-2.79.1 ; rm -rf colord-gtk )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/colord-gtk colord-gtk )
( cd usr/doc/glib-2.79.1 ; rm -rf dbus-glib )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/dbus-glib dbus-glib )
( cd usr/doc/glib-2.79.1 ; rm -rf dconf )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/dconf dconf )
( cd usr/doc/glib-2.79.1 ; rm -rf farstream-libs-0.2 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/farstream-libs-0.2 farstream-libs-0.2 )
( cd usr/doc/glib-2.79.1 ; rm -rf farstream-plugins-0.2 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/farstream-plugins-0.2 farstream-plugins-0.2 )
( cd usr/doc/glib-2.79.1 ; rm -rf gail-libgail-util )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gail-libgail-util gail-libgail-util )
( cd usr/doc/glib-2.79.1 ; rm -rf gail-libgail-util3 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gail-libgail-util3 gail-libgail-util3 )
( cd usr/doc/glib-2.79.1 ; rm -rf gcab )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gcab gcab )
( cd usr/doc/glib-2.79.1 ; rm -rf gck )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gck gck )
( cd usr/doc/glib-2.79.1 ; rm -rf gconf )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gconf gconf )
( cd usr/doc/glib-2.79.1 ; rm -rf gcr )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gcr gcr )
( cd usr/doc/glib-2.79.1 ; rm -rf gdk2 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gdk2 gdk2 )
( cd usr/doc/glib-2.79.1 ; rm -rf gdk3 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gdk3 gdk3 )
( cd usr/doc/glib-2.79.1 ; rm -rf gedit )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gedit gedit )
( cd usr/doc/glib-2.79.1 ; rm -rf gnome-bluetooth-3.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gnome-bluetooth-3.0 gnome-bluetooth-3.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf gnome-keyring )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gnome-keyring gnome-keyring )
( cd usr/doc/glib-2.79.1 ; rm -rf gnome-latex )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gnome-latex gnome-latex )
( cd usr/doc/glib-2.79.1 ; rm -rf goffice-0.10 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/goffice-0.10 goffice-0.10 )
( cd usr/doc/glib-2.79.1 ; rm -rf gsf )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gsf gsf )
( cd usr/doc/glib-2.79.1 ; rm -rf gspell-1.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gspell-1.0 gspell-1.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf gtk2 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gtk2 gtk2 )
( cd usr/doc/glib-2.79.1 ; rm -rf gtk3 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gtk3 gtk3 )
( cd usr/doc/glib-2.79.1 ; rm -rf gtksourceview-3.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gtksourceview-3.0 gtksourceview-3.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf gtkspell )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gtkspell gtkspell )
( cd usr/doc/glib-2.79.1 ; rm -rf gtkspell3 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/gtkspell3 gtkspell3 )
( cd usr/doc/glib-2.79.1 ; rm -rf harfbuzz )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/harfbuzz harfbuzz )
( cd usr/doc/glib-2.79.1 ; rm -rf ibus )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/ibus ibus )
( cd usr/doc/glib-2.79.1 ; rm -rf javascriptcoregtk-6.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/javascriptcoregtk-6.0 javascriptcoregtk-6.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf keybinder-3.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/keybinder-3.0 keybinder-3.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf libaccountsservice )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libaccountsservice libaccountsservice )
( cd usr/doc/glib-2.79.1 ; rm -rf libappindicator )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libappindicator libappindicator )
( cd usr/doc/glib-2.79.1 ; rm -rf libblockdev )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libblockdev libblockdev )
( cd usr/doc/glib-2.79.1 ; rm -rf libbytesize )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libbytesize libbytesize )
( cd usr/doc/glib-2.79.1 ; rm -rf libcanberra )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libcanberra libcanberra )
( cd usr/doc/glib-2.79.1 ; rm -rf libgedit-amtk-5 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgedit-amtk-5 libgedit-amtk-5 )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimp )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimp libgimp )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpbase )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpbase libgimpbase )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpcolor )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpcolor libgimpcolor )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpconfig )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpconfig libgimpconfig )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpmath )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpmath libgimpmath )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpmodule )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpmodule libgimpmodule )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpthumb )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpthumb libgimpthumb )
( cd usr/doc/glib-2.79.1 ; rm -rf libgimpwidgets )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgimpwidgets libgimpwidgets )
( cd usr/doc/glib-2.79.1 ; rm -rf libglade )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libglade libglade )
( cd usr/doc/glib-2.79.1 ; rm -rf libgnt )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgnt libgnt )
( cd usr/doc/glib-2.79.1 ; rm -rf libgpod )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgpod libgpod )
( cd usr/doc/glib-2.79.1 ; rm -rf libgtop )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libgtop libgtop )
( cd usr/doc/glib-2.79.1 ; rm -rf libical-glib )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libical-glib libical-glib )
( cd usr/doc/glib-2.79.1 ; rm -rf libiptcdata )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libiptcdata libiptcdata )
( cd usr/doc/glib-2.79.1 ; rm -rf libnm )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libnm libnm )
( cd usr/doc/glib-2.79.1 ; rm -rf libnma )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libnma libnma )
( cd usr/doc/glib-2.79.1 ; rm -rf liboil )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/liboil liboil )
( cd usr/doc/glib-2.79.1 ; rm -rf libpsl )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libpsl libpsl )
( cd usr/doc/glib-2.79.1 ; rm -rf libwnck )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libwnck libwnck )
( cd usr/doc/glib-2.79.1 ; rm -rf libxklavier )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libxklavier libxklavier )
( cd usr/doc/glib-2.79.1 ; rm -rf libxml2 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/libxml2 libxml2 )
( cd usr/doc/glib-2.79.1 ; rm -rf orc )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/orc orc )
( cd usr/doc/glib-2.79.1 ; rm -rf p11-kit )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/p11-kit p11-kit )
( cd usr/doc/glib-2.79.1 ; rm -rf phodav-3.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/phodav-3.0 phodav-3.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf poppler )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/poppler poppler )
( cd usr/doc/glib-2.79.1 ; rm -rf pygobject )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/pygobject pygobject )
( cd usr/doc/glib-2.79.1 ; rm -rf pygtk )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/pygtk pygtk )
( cd usr/doc/glib-2.79.1 ; rm -rf udisks2 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/udisks2 udisks2 )
( cd usr/doc/glib-2.79.1 ; rm -rf webkit2gtk-4.1 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/webkit2gtk-4.1 webkit2gtk-4.1 )
( cd usr/doc/glib-2.79.1 ; rm -rf webkit2gtk-6.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/webkit2gtk-6.0 webkit2gtk-6.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf webkit2gtk-web-extension-4.1 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/webkit2gtk-web-extension-4.1 webkit2gtk-web-extension-4.1 )
( cd usr/doc/glib-2.79.1 ; rm -rf webkit2gtk-web-extension-6.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/webkit2gtk-web-extension-6.0 webkit2gtk-web-extension-6.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf webkitgtk-6.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/webkitgtk-6.0 webkitgtk-6.0 )
( cd usr/doc/glib-2.79.1 ; rm -rf webkitgtk-web-process-extension-6.0 )
( cd usr/doc/glib-2.79.1 ; ln -sf /usr/share/gtk-doc/html/webkitgtk-web-process-extension-6.0 webkitgtk-web-process-extension-6.0 )
( cd usr/lib64 ; rm -rf libgio-2.0.so )
( cd usr/lib64 ; ln -sf libgio-2.0.so.0 libgio-2.0.so )
( cd usr/lib64 ; rm -rf libgio-2.0.so.0 )
( cd usr/lib64 ; ln -sf libgio-2.0.so.0.7901.0 libgio-2.0.so.0 )
( cd usr/lib64 ; rm -rf libgirepository-2.0.so )
( cd usr/lib64 ; ln -sf libgirepository-2.0.so.0 libgirepository-2.0.so )
( cd usr/lib64 ; rm -rf libgirepository-2.0.so.0 )
( cd usr/lib64 ; ln -sf libgirepository-2.0.so.0.7901.0 libgirepository-2.0.so.0 )
( cd usr/lib64 ; rm -rf libglib-2.0.so )
( cd usr/lib64 ; ln -sf libglib-2.0.so.0 libglib-2.0.so )
( cd usr/lib64 ; rm -rf libglib-2.0.so.0 )
( cd usr/lib64 ; ln -sf libglib-2.0.so.0.7901.0 libglib-2.0.so.0 )
( cd usr/lib64 ; rm -rf libgmodule-2.0.so )
( cd usr/lib64 ; ln -sf libgmodule-2.0.so.0 libgmodule-2.0.so )
( cd usr/lib64 ; rm -rf libgmodule-2.0.so.0 )
( cd usr/lib64 ; ln -sf libgmodule-2.0.so.0.7901.0 libgmodule-2.0.so.0 )
( cd usr/lib64 ; rm -rf libgobject-2.0.so )
( cd usr/lib64 ; ln -sf libgobject-2.0.so.0 libgobject-2.0.so )
( cd usr/lib64 ; rm -rf libgobject-2.0.so.0 )
( cd usr/lib64 ; ln -sf libgobject-2.0.so.0.7901.0 libgobject-2.0.so.0 )
( cd usr/lib64 ; rm -rf libgthread-2.0.so )
( cd usr/lib64 ; ln -sf libgthread-2.0.so.0 libgthread-2.0.so )
( cd usr/lib64 ; rm -rf libgthread-2.0.so.0 )
( cd usr/lib64 ; ln -sf libgthread-2.0.so.0.7901.0 libgthread-2.0.so.0 )
