- small typo for then
[kernel-cn.git] / debian / preinst
index b680d9a..d13bffc 100755 (executable)
@@ -32,6 +32,12 @@ case "$1" in
     ;;
 esac
 
+# check if the config script fixed the grub diverts
+if [ -e /usr/sbin/grub.real -o -e /usr/sbin/grub-probe.real ]; then
+    echo "CN: Please install this package using apt-get."
+    exit 1
+fi
+
 # make GRUB template directory
 if [ ! -d /boot/grub ]; then
     echo "CN: Made /boot/grub directory."
@@ -49,18 +55,6 @@ fi
 
 ################################################################################
 
-DIVERT_TO="grub grub-probe"
-
-echo -n "CN: Undiverting binaries:"
-for i in $DIVERT_TO; do
-    if [ -e /usr/sbin/$i.real ]; then
-        dpkg-divert --remove --rename --package 'kernel-2.6-cn' \
-            --divert /usr/sbin/$i.real /usr/sbin/$i >/dev/null
-    fi
-    echo -n " $i"
-done
-echo "."
-
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.