1#!/bin/sh 2 3# Abort on error. 4set -e 5 6symlink_match() 7{ 8 local SYMLINK="$1" 9 local SYMLINK_TARGET="$2" 10 11 [ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \ 12 [ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ] 13} 14 15SYMLINK=/usr/share/doc/e2fslibs-dev 16SYMLINK_TARGET=e2fslibs 17 18if [ "$1" = "purge" ] && [ -h "${SYMLINK}.dpkg-backup" ] 19then 20 rm -f "${SYMLINK}.dpkg-backup" 21fi 22if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] && 23 [ -n "$2" ] && [ ! -e "$SYMLINK" ] && [ -h "${SYMLINK}.dpkg-backup" ] && 24 symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET" 25then 26 echo "Restoring backup of $SYMLINK ..." 27 mv "${SYMLINK}.dpkg-backup" "$SYMLINK" 28fi 29 30#DEBHELPER# 31 32exit 0 33