#!/bin/sh

case "$1" in
  configure)
    if [ -d /usr/bin/X11 ]; then
      # We need this, because in the past, we accidentally created this link:
      rm -f /usr/bin/X11/bin
      if ! rmdir /usr/bin/X11 2>/dev/null; then
        echo "/usr/bin/X11 still contains files (are they locally installed?)"
        echo ""
        echo "Please examine the following list and either delete these"
        echo "files, or relocate them to /usr/bin, then reinstall x-common:"
        echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
        ls -1 /usr/bin/X11/*
        echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
      else
        ln -s ../bin /usr/bin/X11
      fi
    fi
  ;;
esac

#DEBHELPER#
