ncurses-base.preinst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #! /bin/sh
  2. # Make sure errors report (since we try to weed out potential spurious ones)
  3. set -e
  4. # If /etc/terminfo is a symbolic link, it will really screw up the
  5. # installation of our minimum set of terminfo entries. Therefore we
  6. # get rid of any link with impunity.
  7. if [ -L /etc/terminfo ]; then
  8. rm -f /etc/terminfo
  9. fi
  10. # /usr/lib/terminfo used to be the standard place for terminfo entries.
  11. # Now, it's /usr/share/terminfo. So if /usr/lib/terminfo _isn't_ a symbolic
  12. # link, move the whole thing to /usr/share.
  13. if [ -e /usr/lib/terminfo -a ! -L /usr/lib/terminfo ]; then
  14. cp -dR /usr/lib/terminfo /usr/share;
  15. rm -rf /usr/lib/terminfo;
  16. fi
  17. # If /usr/lib/tabset isn't a symbolic link, nuke it.
  18. if [ -e /usr/lib/tabset -a ! -L /usr/lib/tabset ]; then
  19. rm -rf /usr/lib/tabset;
  20. fi
  21. # And the final piece of kludgery...if /usr/lib/{tabset,terminfo} _are_
  22. # symbolic links, get rid of them for now. This is necessary because we
  23. # may end up in a state where the user replaces an older package and,
  24. # because debian can't tell that /usr/lib/foo and /usr/share/foo are the
  25. # same, it deletes the old package's /usr/lib files right after installing
  26. # the new /usr/share ones. This leaves the user in a state where he has
  27. # no terminfo files at all. :(
  28. if [ -L /usr/lib/terminfo ]; then
  29. rm -f /usr/lib/terminfo
  30. fi
  31. if [ -L /usr/lib/tabset ]; then
  32. rm -f /usr/lib/tabset
  33. fi
  34. #DEBHELPER#