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

When to call update-alternatives?



Well, I know that in postinst and prerm, but when which argument is
passed?

I thought that "cd /var/lib/dpkg/info && grep -10 update-alternatives *postinst|less -S"
would help me, but it did quite the contrary. There is a total mess!
A quick summary of how it is called in different packages:
 - always ($1 is not tested at all),
 - if [ "$1"  = "configure" ]
 - if [ "$1" != "upgrade" ]
 - if [ "$1"  = "configure" -o "$1" = "abort-upgrade" ]
 - if [ "$1"  = "configure" -o "$1" = "upgrade" ]

They can't all be right?

After rereading section 6 of the policy, I think that the right way is
to call it in postinst if [ "$1"  = "configure" ], and in postrm,
if [ "$1"  = "remove" ]

Is this correct?

regards,

Marcin
-- 
Marcin Owsiany <porridge@debian.org>             http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216



Reply to: