From 9a6e44c40be3268e54d53399312ffe797e078503 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Wed, 22 Dec 2010 18:55:46 +0100 Subject: [PATCH] debian/nut.postrm: Do not try to remove nut user is deluser is not installed anymore --- debian/changelog | 4 +++- debian/nut.postrm | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index d95568b..6afa8ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,10 @@ nut (2.4.3-2) UNRELEASED; urgency=low * debian/watch: Bump version to 3 * Add debian/patches/0002-fix_udev_action.patch: Also set permission for "change" udev ACTION (Closes: #557178) + * debian/nut.postrm: Do not try to remove nut user is deluser is not + installed anymore - -- Laurent Bigonville Wed, 22 Dec 2010 18:28:42 +0100 + -- Laurent Bigonville Wed, 22 Dec 2010 18:53:16 +0100 nut (2.4.3-1.1) unstable; urgency=low diff --git a/debian/nut.postrm b/debian/nut.postrm index 385c39f..38b8d52 100644 --- a/debian/nut.postrm +++ b/debian/nut.postrm @@ -15,9 +15,11 @@ case "$1" in rm -f /etc/udev/rules.d/52_nut-usbups.rules rm -f /etc/udev/rules.d/52-nut-usbups.rules # remove the nut user - if getent passwd nut >/dev/null; then - deluser --quiet nut - fi + if [ -x "$(command -v deluser)" ]; then + deluser --quiet --system nut > /dev/null || true + else + echo >&2 "not removing nut system account because deluser command was not found" + fi # handle a dpkg bug [ -d /etc/nut ] && rmdir --ignore-fail-on-non-empty /etc/nut >/dev/null 2>&1 ;;