mirror_spl-debian/debian/spl.preinst
Aron Xu c932eac93e Handle the case /etc/hostid is being wrongly marked as conffile
There are packages distributed with /etc/hostid file installed as conffile,
which is going to cause problem when the package is purged. Here we detect
such case and migrate it to an ordinary file that preserves during purge.

Also replace the endianness detection code to use od(1) from coreutils
instead of requiring gcc
2016-09-28 04:47:41 +08:00

11 lines
314 B
Bash

#!/bin/sh
set -e
# Detect if /etc/hostid is a conffile of previous spl package, migrate if yes
# hostid file should preserve even when package is purged
if $(dpkg-query --showformat='${Conffiles}\n' --show spl >/dev/null 2>&1); then
dpkg-maintscript-helper rm_conffile /etc/hostid -- "$@"
fi
#DEBHELPER#