#!/bin/bash
#
# Modular X.Org X11R7 filesystem upgrade script.
#
# If any of the following dirs are symlinks, remove them and create a dir
# in its place.  This is required, so that modular X packages get installed
# into a real directory, and do not follow old compatibility symlinks
# provided in previous releases of the operating system.
#
# NOTE: Do not replace these with _libdir or _includedir macros, they are
#       intentionally explicit.
for dir in /usr/include/X11 /usr/lib/X11 ; do
    [ -L "$dir" ] && rm -f -- "$dir" &> /dev/null
done
for dir in /usr/include/X11 /usr/lib/X11 ; do
    [ ! -d "$dir" ] && mkdir -p "$dir" &> /dev/null
done
exit 0