Package: dpkg
Version: 1.16.3
Severity: normal

Dear Maintainer,

To use update-alternatives --install <master link> <name> <path> <pri> ..., one 
needs an option
in update-alternatives to find the master link if <name> has just one 
alternative installed.
This is the symbolic link that points to the /etc/alternatives/<name>

For example, suppose one wants to install a new alternative to 'rename':
    jack@berkeley:tmp =>  ls -lt /etc/alternatives/rename
    0 lrwxrwxrwx 1 root root 16 Jan 15 17:04 /etc/alternatives/rename -> 
/usr/bin/prename

There is no option in update-alternatives to find the master link that points 
to /etc/alternatives/rename:

    jack@berkeley:tmp => update-alternatives --config rename
    There is only one alternative in link group rename: /usr/bin/prename
    Nothing to configure.

    jack@berkeley:tmp => update-alternatives --display rename
    rename - auto mode
      link currently points to /usr/bin/prename
    /usr/bin/prename - priority 60
      slave rename.1.gz: /usr/share/man/man1/prename.1.gz
    Current 'best' version is '/usr/bin/prename'.

The only workaround is to look at the /var/lib/dpkg/alternatives file:
    jack@berkeley:tmp => cat /var/lib/dpkg/alternatives/rename
    auto
    /usr/bin/rename                              <<<<<<<< this is needed for 
new install <<<<<<
    rename.1.gz
    /usr/share/man/man1/rename.1.gz

    /usr/bin/prename
    60
    /usr/share/man/man1/prename.1.gz

    jack@berkeley:tmp => ls -lt /usr/bin/rename
    0 lrwxrwxrwx 1 root root 24 Jan 15 17:04 /usr/bin/rename -> 
/etc/alternatives/rename*

If update-alternatives is the interface to the alternatives system, it should 
provide the all information
needed to install a new alternative in all cases.

This fails if there is exactly one alternative installed but works if multiple 
alternatives are installed:
    jack@berkeley:tmp => update-alternatives --config java
    There are 5 choices for the alternative java (providing /usr/bin/java).   
<<<<<<<< this is needed for new install <<<<<<

      Selection    Path                                           Priority   
Status
    ------------------------------------------------------------
      0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      
auto mode
      1            /usr/bin/gij-4.6                                1046      
manual mode
      2            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      
manual mode
      3            /usr/lib/jvm/java-6-sun/jre/bin/java            63        
manual mode
      4            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      
manual mode
    * 5            /usr/local/sun-java/jre1.7.0_05/bin/java        64        
manual mode






-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/6 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg depends on:
ii  libbz2-1.0   1.0.6-1
ii  libc6        2.13-24
ii  libselinux1  2.1.0-4
ii  tar          1.26-4
ii  xz-utils     5.1.1alpha+20110809-3
ii  zlib1g       1:1.2.3.4.dfsg-3

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt  0.9.6

-- Configuration Files:
/etc/dpkg/dpkg.cfg changed:
refuse-downgrade
no-debsig
log /var/log/dpkg.log


-- no debconf information



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

Reply via email to