preinst is in mouseemu 0.16-0ubuntu10.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/sh -e
prepare_move_conffile () {
SOURCE="$1"
TARGET="$2"
[ -e "$SOURCE" ] || return 0
md5sum="$(md5sum "$SOURCE" | sed -e 's/ .*//')"
old_md5sum="$(dpkg -s mouseemu | sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $SOURCE'{s/^ [^ ]* //;s/ .*//;p}}")"
if [ "$md5sum" = "$old_md5sum" ]; then
echo >&2 "Moving unmodified conffile $SOURCE to $TARGET ..."
mv -f "$SOURCE" "$SOURCE.moved-by-preinst"
else
echo >&2 "Moving modified conffile $SOURCE to $TARGET ..."
mv -f "$SOURCE" "$TARGET"
fi
return 0
}
# if upgrading from version below 0.15-3
# give mouseemu some time to terminate
if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" le 0.15-3 ; then
sleep 5
fi
case $1 in
install|upgrade)
if dpkg --compare-versions "$2" lt 0.15-6ubuntu2; then
prepare_move_conffile /etc/udev/mouseemu.rules \
/etc/udev/rules.d/85-mouseemu.rules
fi
;;
esac
|