Hello!

On Fri, Jul 11, 2008 at 11:05:10AM +0200, Matthias Klose wrote:
> no, afaik this doesn't work. new programs and man pages are added in new
> versions, so you have to make this for each master alternative depending on 
> the
> version you upgrade from. plus this approach doesn't work if new slaves are
> added or removed to an alternative.

The patch only makes the "update-alternative --remove" in the *.preinst
scripts conditional, not the installs in in *.postinst scripts.
update-alternative is idempotent, so adding the same alternatives
multiple times does not break anything. You can even add additional
slaves and those get added, IFF you're in auto-mode. They won't
automatically be added, if you changed to manual-mode.

> It would make much more sense to handle all binaries currently handled by
> separate alternatives in one alternative, but again, dpkg cannot handle
> adding/removing slaves without changing the currently selected alternative.
> 
> see #342566 for the problems handling master/slave alternatives.

Personally I don't care much about slaves: If I manually changed java to
sun-java6, and java didn't had a German manual page than, I don't care if
it gets added in some future verson. (I make the decision now, not based
on some future possibility). If I want that new feature, I thinks it's
reasonable to redo the "update-alternative --config java".

But what's really anoying is the current behaviour of java to repeatly
trash my configuration: I need sun-java6, so I did the
"update-alternative --config"-thing. And each time a (security-)update
happens, that configuration gets trashed: Suddenly Eclipse, Batik,
Tomcat and a lot of other application stop working. This has bitten me
several times on multiple machines, and it really sucks badly.

Some template files
        # ls
        1  11  2  22  3  33
Install the fire alternative without slave
        # update-alternatives --install $PWD/alt alt $PWD/1 1
        # readlink /etc/alternatives/alt
        /tmp/alt/1

Add a slave
        # update-alternatives --install $PWD/alt alt $PWD/1 1 --slave $PWD/alt_ 
alt_ $PWD/11
        # readlink /etc/alternatives/alt
        /tmp/alt/1
        # readlink /etc/alternatives/alt_
        /tmp/alt/11
The slace gets added, since we are still in automatic mode

Add second alternative without slace
        # update-alternatives --install $PWD/alt alt $PWD/3 3
        # readlink /etc/alternatives/alt
        /tmp/alt/3
        # readlink /etc/alternatives/alt_
No slave as expected

Change to manual mode
        # update-alternatives --config alt
                  1    /tmp/alt/1
        *+        2    /tmp/alt/3
        # readlink /etc/alternatives/alt_
Add a slave
        # update-alternatives --install $PWD/alt alt $PWD/3 3 --slave $PWD/alt_ 
alt_ $PWD/33
        # readlink /etc/alternatives/alt_
Still no slave

Redo manual mode:
        # update-alternatives --config alt
                  1    /tmp/alt/1
        *+        2    /tmp/alt/3
        # readlink /etc/alternatives/alt_
        /tmp/alt/33
Now slave exists


Please reconsider applying the patch, since IMHO breaking other applications is
more anoying than some missing manual pages (IMHO the only things
slave-alternatives are used for.)

BYtE
Philipp
-- 
Philipp Matthias Hahn <[EMAIL PROTECTED]>
 GPG/PGP: 9A540E39 @ keyrings.debian.org



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to