Re: Defer postinst after a given package

2022-09-10 Thread Fab Stz
Thank you Eberhard and Andrey for your help.

So I added default-jre-headless (which permits to install the correct jdk 
version) to the depends. But even if default-jre-headless was installed before 
B, openjdk-11-jre-headless still got installed at the end after B. This is 
probably because it waits for some reason (triggers?) the end of the setup 
phase.

I finally added openjdk-11-jre-headless instead, what fixed my issue. However I 
don't find this nice because with each Debian release, the openjdk version must 
be set to the one that is really shipped while it is the job of 
default-jre-headless to manage this.

Does that seem an expected behaviour to you or is it a bug? Would there be a 
better way to do this?

Thanks.
Fab

Re: Defer postinst after a given package

2022-09-09 Thread Andrey Rahmatullin
On Fri, Sep 09, 2022 at 10:32:18AM +0200, Fab Stz wrote:
> Hi,
> 
> I have a package B that depends on gradle, which depends on Java.
> B doesn't have a dependency to Java set in d/control.
> 
> B runs a postinst script which requires Java.
"The Depends field should also be used if the postinst or prerm scripts
require the depended-on package to be unpacked or configured in order to
run."
https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends

-- 
WBR, wRAR


signature.asc
Description: PGP signature


Re: Defer postinst after a given package

2022-09-09 Thread Eberhard Beilharz
If B runs a postinst script which requires Java, then I'd think it needs 
a dependency on Java in d/control.


That also solves the problem with ensuring that B is setup after Java.

Fab Stz wrote on 2022-09-09 10:32:

Hi,

I have a package B that depends on gradle, which depends on Java.
B doesn't have a dependency to Java set in d/control.

B runs a postinst script which requires Java.

At times, during installation Java is set up before B, at times after.

How can I be sure that B is always setup after Java?

By Java I mean: openjdk-11-jre-headless:amd64 which is the one that 
creates the alternatives to have/usr/bin/java.


Thanks


OpenPGP_0xE9140597606020D3.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Defer postinst after a given package

2022-09-09 Thread Fab Stz
Hi,

I have a package B that depends on gradle, which depends on Java.
B doesn't have a dependency to Java set in d/control.

B runs a postinst script which requires Java.

At times, during installation Java is set up before B, at times after.

How can I be sure that B is always setup after Java?

By Java I mean:  openjdk-11-jre-headless:amd64 which is the one that creates 
the alternatives to have/usr/bin/java.

Thanks