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

Re: Bug#919543: apt: when installing with deb file, prerm maintainer script doesn't pass new-package-name before it's replaced due to conflict

On Thu, Jan 17, 2019 at 11:03:01AM +0800, Allen wrote:
> Package: apt
> Version: 1.2.19
> Severity: normal
> Dear Maintainer,
> I am creating a deb packages which will replace another package. And before the
> old package are removed, I want to check whether the package is remove due to
> **replace** operation or a simple **uninstall** operation.
> In man page of `deb-prerm`, I found that when a package is replaced due to
> conflict, the prerm script of old package can be called in the following way:
> `prerm remove in-favour new-package new-version`.
> Therefore, I add some script in prerm of old package and opreate with the shell
> script variables. If I use `dpkg` to install these .deb packages, it will work
> perfectly. However, it does not pass any new package information if I use `apt`
> to install these packages.
> Is it an existing bug? I have searched for a while and have not found any
> relevant content.

So, I don't think this ever worked. It's best to ignore this exists. While it
is documented, it cannot really happen in practice, as apt first does the remove
and then the install; in two separate invocations of dpkg.

It's unlikely that this will change in the near future, either.

It's also completely unreliable in case you have multiple conflicts across
packages, so I think we should just get rid of it completely.

debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

Reply to: