debian: Apply Ubuntu patch to add DKMS support.
[sliver-openvswitch.git] / debian / openvswitch-datapath-dkms.prerm
diff --git a/debian/openvswitch-datapath-dkms.prerm b/debian/openvswitch-datapath-dkms.prerm
new file mode 100644 (file)
index 0000000..5c8ad31
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+package=openvswitch-datapath-dkms
+name=openvswitch
+
+version=`dpkg-query -W -f='${Version}' "$package" \
+        |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
+
+dkms remove -m "$name" -v "$version" --all || true
+
+#DEBHELPER#
+
+exit 0