#!/bin/sh -e

case "$1"
in
  configure)
		;;
  abort-upgrade|abort-remove|abort-deconfigure)
		exit 0
		;;
  *)
		echo "ERROR: postinst called with unknown argument \"$1\"."
		echo "Aborting configuration of kernel-patch package."
  		exit 1
		;;
esac

echo
echo " 1. Amiga/Atari"
echo " 2. Macintosh"
echo " 3. VME"
echo

while test "$extrapatch" == ""
do
	echo -n "Select default patch for kernel-package to use (1-3) : "
	read answer
	case $answer
	in
		1)	extrapatch="none"
			;;
		2)	extrapatch=2.0.36-mac.diff.gz
			;;
		3)	extrapatch=2.0.36-vme.diff.gz
			;;
	esac
done

symlink="/usr/src/kernel-patches/m68k/2.0.36-extra.diff.gz"

if test "$extrapatch" != "none" ; then
	echo "Adding extra patch symlink to $extrapatch ..."
	ln -sf $extrapatch $symlink
else
	if [ -L $symlink ]; then
		echo "Removing symlink $symlink ..."
		rm -f $symlink >/dev/null
	fi
fi

#exit 0
