Tollef Fog Heen, 2012-07-02 22:52+0200:
That's quite odd.

I think I have clues about that. In the postinst, you call dpkg-divert this way:
    dpkg-divert --remove --package systemd --rename \
        --divert /lib/lsb/init-functions.systemd /lib/lsb/init-functions

Well, according to dpkg-divert(8) manpage, it should rather be something like:
    dpkg-divert --package systemd --rename \
        --remove /lib/lsb/init-functions

Indeed:
    --package is an option with one argument;
    --rename is an option with zero argument;
    --remove is the action with one argument.

The order matters (options first, action last), and there should be not additionnal argument. Contrary to the way you are calling dpkg-divers:
    --remove takes one argument (not zero);
    --divert is not needed for removal;
* the additionnal argument /lib/lsb/init-functions, which I guess was taken from the command introducing the diversion, is an implicit --add action, which is certainly not wanted here.

I did not test it, but correcting that call may be enough to solve that bug. In addition, for more reliability, I suggest that, instead of testing the version from which one is upgrading systemd, you rather test whether or not a diversion is present. In other words, test the situation you intend to change, not the version that is supposed to provide that situation:
    if [ "$1" = "configure" ] && \
        LC_ALL=C dpkg-divert --list /lib/lsb/init-functions | \
        grep -q 'by systemd$'; then
        dpkg-divert --package systemd --rename \
            --remove /lib/lsb/init-functions
    fi

Librement,

--
 ,--.
: /` )   Tanguy Ortolo      <xmpp:tan...@ortolo.eu>
| `-'    Debian Developer   <irc://irc.oftc.net/Tanguy>
 \_

Attachment: signature.asc
Description: Digital signature

Reply via email to