#!/bin/sh
set -e

# work around "#700670 - 'old-postrm upgrade' removes /usr/share/doc/cltl/*
#   after the new package was unpacked"
# by disabling the offending line
if dpkg --compare-versions "$2" lt-nl "1.0.27" ; then
	if [ -f /var/lib/dpkg/info/cltl.postrm ]; then
		echo "Disabling buggy code in old postrm script..."
		sed -ir '8{\%^rm -rf /usr/share/doc/cltl/\*\s*$%{s/^/#/}}' /var/lib/dpkg/info/cltl.postrm
	fi
fi

#DEBHELPER#
