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

Re: one package altering other package's postrm



Alexandre Detiste <alexandre.detiste@gmail.com> writes:

>> : Russ Allbery <rra@debian.org>
>> Well, ideally this is something that should be coordinated with the cron package.
>
> I've sent a one-liner patch, as this put the least work on cron maintainers:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773095
>
> I guess they can apply it right away, even during the freeze;
> if there were a new RC bug popping up;
> this could even be included in Jessie.
>
>>  How do the other cron replacements, like bcron, handle this?
> It seems not to implement this feature.
>
>> It feels cleaner to me
> To me too, I guess I could check in preinst
> [1] that /etc/cron.allow or /etc/cron.deny even exists (by default no)
> [2] that some version of cron without this patch is installed
> before deleting cron.postrm as last resort.

If this is something you're expecting to come up during the upgrade,
then one coud solve it by (assuming that you find that the files exist)
simply hard-linking them to another name then you can hapilly let the
untouched postrm do whatever it likes.

Then in your postinst, check for the presence of the backup files, and
move them back into place if they exist.

On the other hand, if the problem is that the upgrade causes a remove,
and then some time later the user is going to tidy up by purging cron,
then rather than simply removing the postrm, you could edit it, thus:

  sed -e 's#rm .*/etc/cron.allow#: &#' /var/lib/dpkg/info/cron.postrm

although that still seems like a bad thing to be doing, but as long as
you discuss it with the cron maintainer, and ensure that the pattern is
going to match all versions, then you'll at least only be breaking
things for downstreams that have decided to change that line for some
reason.

A comment in the cron postrm about this might be helpful to try and
avoid that (not that it seems like a major risk really).

Making the files be conffiles of a common package seems like a better
way to go to me.

Cheers, Phil.
-- 
|)|  Philip Hands  [+44 (0)20 8530 9560]  HANDS.COM Ltd.
|-|  http://www.hands.com/    http://ftp.uk.debian.org/
|(|  Hugo-Klemm-Strasse 34,   21075 Hamburg,    GERMANY

Attachment: pgpy2ZlekdeqW.pgp
Description: PGP signature


Reply to: