tests: update expect file for u_direct_io
[e2fsprogs.git] / debian / comerr-dev.preinst
blob5d8090aa94af5a7788f0dad7c8213dae99d6ecfb
1 #!/bin/sh
3 # Abort on error.
4 set -e
6 symlink_match()
8 local SYMLINK="$1"
9 local SYMLINK_TARGET="$2"
11 [ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
12 [ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
15 SYMLINK=/usr/share/doc/comerr-dev
16 SYMLINK_TARGET=libcomerr2
17 SYMLINK_TARGET2=libcom-err2
19 if [ "$1" = "install" -o "$1" = "upgrade" ] &&
20 [ -n "$2" ] && [ -h "$SYMLINK" ]
21 then
22 if symlink_match "$SYMLINK" "$SYMLINK_TARGET" ||
23 symlink_match "$SYMLINK" "$SYMLINK_TARGET2"
24 then
25 mv -f "$SYMLINK" "${SYMLINK}.dpkg-backup"
29 #DEBHELPER#
31 exit 0