#!/bin/sh
set -e

if [ -L usr/share/man ]; then
  echoc YELLOW "/usr/share/man e' un link simbolico, lo rimuovo"
  rm -f usr/share/man
fi

if [ ! -L usr/man ]; then
  echoc YELLOW "/usr/man non e' un link simbolico, sposto i file in usr/share/man"
  echo "- Creo /usr/share/man"
  mkdir -p usr/share/man
  if [ -d usr/man ]; then
    echo "- Copio le manpages in /usr/share/man"  
    cp -a usr/man/ usr/share/
    echo "- Rimuovo la vecchia /usr/man"  
    rm -fR usr/man
  fi
  echo "fatto."
fi
