#!/bin/sh -e

set -e

add_sudoer ()
{
    line="$1"
    if ! grep -F -q "$line" /etc/sudoers; then
	echo "+$line"
	echo "$line" >>/etc/sudoers
    fi
}

## Add line to sudo so that "user" can run "apt-worker" as
## "root".
##
## KEEP THIS IN SYNC WITH prerm

add_sudoer 'user ALL = NOPASSWD: /usr/libexec/apt-worker'

if [ -x /usr/bin/update-mime-database ]; then
 update-mime-database /usr/share/mime
fi

if [ -x /usr/bin/osso-update-category-database ]; then
 osso-update-category-database /usr/share/mime
fi

if [ -x /usr/bin/update-desktop-database ]; then
 update-desktop-database
fi

#DEBHELPER#

exit 0
