Package: dpkg
Version: 1.13.22

See the following example:

# create an alternative with 2 slaves
| [EMAIL PROTECTED]:/# update-alternatives --install /bin/atest atest /bin/true 
10 \
|       --slave /bin/atest-slave1 atest-slave1 /bin/true \
|       --slave /bin/atest-slave2 atest-slave2 /bin/true
# check that the links are there
| [EMAIL PROTECTED]:/# ls -l /etc/alternatives/atest*
| lrwxrwxrwx 1 root root 9 Sep 19 13:37 /etc/alternatives/atest -> /bin/true
| lrwxrwxrwx 1 root root 9 Sep 19 13:37 /etc/alternatives/atest-slave1 -> 
/bin/true
| lrwxrwxrwx 1 root root 9 Sep 19 13:37 /etc/alternatives/atest-slave2 -> 
/bin/true
| [EMAIL PROTECTED]:/# ls -l /bin/atest*
| lrwxrwxrwx 1 root root 23 Sep 19 13:37 /bin/atest -> /etc/alternatives/atest
| lrwxrwxrwx 1 root root 30 Sep 19 13:37 /bin/atest-slave1 -> 
/etc/alternatives/atest-slave1
| lrwxrwxrwx 1 root root 30 Sep 19 13:37 /bin/atest-slave2 -> 
/etc/alternatives/atest-slave2
# now create a higher-priority alternative with just one slave:
| [EMAIL PROTECTED]:/# update-alternatives --install /bin/atest atest 
/bin/false 20 \
|       --slave /bin/atest-slave1 atest-slave1 /bin/false
# check, that slave2 got removed:
| [EMAIL PROTECTED]:/# ls -l /etc/alternatives/atest*
| lrwxrwxrwx 1 root root 10 Sep 19 13:38 /etc/alternatives/atest -> /bin/false
| lrwxrwxrwx 1 root root 10 Sep 19 13:38 /etc/alternatives/atest-slave1 -> 
/bin/false
| [EMAIL PROTECTED]:/# ls -l /bin/atest*
| lrwxrwxrwx 1 root root 23 Sep 19 13:37 /bin/atest -> /etc/alternatives/atest
| lrwxrwxrwx 1 root root 30 Sep 19 13:37 /bin/atest-slave1 -> 
/etc/alternatives/atest-slave1
# now create a low-priority alternative with no slaves:
| [EMAIL PROTECTED]:/# update-alternatives --install /bin/atest atest 
/bin/sleep 5
# switch to the 2-slave alternative
| [EMAIL PROTECTED]:/# update-alternatives --config atest
|
| There are 3 alternatives which provide `atest'.
|
|   Selection    Alternative
| -----------------------------------------------
|           1    /bin/true
| *+        2    /bin/false
|           3    /bin/sleep
|
| Press enter to keep the default[*], or type selection number: 1
| Using `/bin/true' to provide `atest'.
# see the slaves are restored
| [EMAIL PROTECTED]:/# ls -l /etc/alternatives/atest*
| lrwxrwxrwx 1 root root 9 Sep 19 13:41 /etc/alternatives/atest -> /bin/true
| lrwxrwxrwx 1 root root 9 Sep 19 13:41 /etc/alternatives/atest-slave1 -> 
/bin/true
| lrwxrwxrwx 1 root root 9 Sep 19 13:41 /etc/alternatives/atest-slave2 -> 
/bin/true
| [EMAIL PROTECTED]:/# ls -l /bin/atest*
| lrwxrwxrwx 1 root root 23 Sep 19 13:37 /bin/atest -> /etc/alternatives/atest
| lrwxrwxrwx 1 root root 30 Sep 19 13:37 /bin/atest-slave1 -> 
/etc/alternatives/atest-slave1
# switch to the no-slaves one:
| [EMAIL PROTECTED]:/# update-alternatives --config atest
|
| There are 3 alternatives which provide `atest'.
|
|   Selection    Alternative
| -----------------------------------------------
| *         1    /bin/true
|  +        2    /bin/false
|           3    /bin/sleep
|
| Press enter to keep the default[*], or type selection number: 3
| Using `/bin/sleep' to provide `atest'.
# this is weird: only _one_ slave gets removed from /bin, but _both_
# from /etc/alternatives:
| [EMAIL PROTECTED]:/# ls -l /bin/atest*
| lrwxrwxrwx 1 root root 23 Sep 19 13:37 /bin/atest -> /etc/alternatives/atest
| lrwxrwxrwx 1 root root 30 Sep 19 13:37 /bin/atest-slave1 -> 
/etc/alternatives/atest-slave1
| [EMAIL PROTECTED]:/# ls -l /etc/alternatives/atest*
| lrwxrwxrwx 1 root root 10 Sep 19 13:42 /etc/alternatives/atest -> /bin/sleep

Something is clearly wrong. I am happy to write a patch, but I need to
know which way to go:
 - should only the links for the currently (auto-)selected alternative
   exist (i.e. all other slave links removed at every change)
or
 - should only the links be updated, and the existing slave links left
   as they were?

Marcin
-- 
Marcin Owsiany <[EMAIL PROTECTED]>             http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216


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

Reply via email to