summaryrefslogtreecommitdiff
path: root/debian/util-linux.preinst
diff options
context:
space:
mode:
authorScott James Remnant <scott@ubuntu.com>2009-07-14 17:52:52 +0100
committerScott James Remnant <scott@ubuntu.com>2009-07-14 17:52:52 +0100
commit0419e06bbce052deb50f6fb2c769df9beeda6aa2 (patch)
tree95c718f9fe39cda82ff94323d99cf90c41a17ecc /debian/util-linux.preinst
parentbb34cffdd4033f7226da6487f5db5c6c71b96b40 (diff)
downloadutil-linux-old-0419e06bbce052deb50f6fb2c769df9beeda6aa2.tar.gz
rules: Install udev rules into /lib/udev/rules.d
Unconditionally install the udev rules, moving them on upgrade from /etc to /lib if necessary
Diffstat (limited to 'debian/util-linux.preinst')
-rw-r--r--debian/util-linux.preinst15
1 files changed, 15 insertions, 0 deletions
diff --git a/debian/util-linux.preinst b/debian/util-linux.preinst
new file mode 100644
index 00000000..a6a6527e
--- /dev/null
+++ b/debian/util-linux.preinst
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = install ] || [ "$1" = upgrade ]; then
+ if [ -e "/etc/udev/rules.d/85-hwclock.rules" ]; then
+ if [ "`md5sum \"/etc/udev/rules.d/85-hwclock.rules\" | sed -e \"s/ .*//\"`" = \
+ "`dpkg-query -W -f='${Conffiles}' util-linux | sed -n -e \"\\\\' /etc/udev/rules.d/85-hwclock.rules's/.* //p\"`" ]
+ then
+ rm -f "/etc/udev/rules.d/85-hwclock.rules"
+ fi
+ fi
+fi
+
+#DEBHELPER#