Whamcloud - gitweb
LU-8869 build: Fix building of DEB packages
[fs/lustre-release.git] / debian / postrm
diff --git a/debian/postrm b/debian/postrm
new file mode 100755 (executable)
index 0000000..2affdf0
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+DEPMOD_DIR="/etc/depmod.d"
+LUSTRE_DEPMOD_FILE="${DEPMOD_DIR}/lustre.conf"
+
+[ -e ${LUSTRE_DEPMOD_FILE} ] && { rm -f ${LUSTRE_DEPMOD_FILE}; }
+# If DEPMOD_DIR is empty, we also created it, thus remove it.
+[ ! "$(ls -A ${DEPMOD_DIR} 2>/dev/null)" ] && { rm -rf ${DEPMOD_DIR}; }
+
+depmod -a
\ No newline at end of file