[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#659822: RFS: mpd-sima/0.9.0-1 (New upstream version)



Hi Jakub,

Jakub Wilk wrote:
> * Geoffroy Youri Berret <efrim@azylum.org>, 2012-02-17, 00:41:
> >>- In debian/mpd-sima.postrm, you use awk but you don't Depend on it.
> >Right, I replaced it with a “grep | cut” alternative.
> 
> While I personally don't like awk :P, but if you like it, you _can_
> use it in maintainer scripts without depending on it. awk is (in a
> way) an essential package:
> http://lists.debian.org/debian-mentors/2005/11/msg00193.html
> 
> I believe that lintian would yell at you if you had unversioned
> dependency on awk. (And versioned dependency on awk would render
> your package uninstallable. :P)

Interesting. In my package (minidlna), I'm depending on (gawk | mawk),
because I'm using awk in one of the maintainers scripts too; I take it I
should remove it, right? (Yes, I'm trying to get second-hand review for
my package; one of the good things about reviewing other people's
packages :) )

> >>You're also checking if /usr/sbin/deluser is executable and
> >>silently not removing the user if it's not (same thing for
> >>delgroup). Since you Depend on adduser, you should assume these
> >>commands exist, and it should be an error visible to the user if
> >>they don't.
> >Corrected as well.
> 
> Err. What Policy §6.5 says: “[…] all ‘postrm’ actions may only rely
> on essential packages and must gracefully skip any actions that
> require the package's dependencies if those dependencies are
> unavailable.”
> 
> So checking for existence of /usr/sbin/deluser _is_ the right thing
> if you want to use it. See this however:
> http://lists.debian.org/debian-devel/2012/02/msg00094.html

Yes, I realize now my advice was misleading at best. What I meant is
that you should try running the command anyway, so that the error
becomes visible to the user, but then catch the exit status; something
like:

  deluser ${USER} || echo "Removing ${USER} failed."

This way, if the user is watching the output, they will know they need
to remove the user by hand afterwards. Does it make sense? (Again, I'm
doing this in my package, so I'd like to know if that's wrong.)

Of course, as you pointed out, the right thing here might be not
removing the user at all, but I'm interested in the more general
question of showing the failures in maintainers scripts to the user or
not.

Cheers,

-- 
Benoît Knecht



Reply to: