update-alternatives warnings

Bug #118246 reported by Fabien Tassin
18
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Fix Released
Medium
Ian Jackson

Bug Description

Binary package hint: dpkg

update-alternatives shows warnings during "install":

I just remove and reinstall a package (fakeroot):

# apt-get remove fakeroot
Reading package lists... Done
...
The following packages will be REMOVED:
  fakeroot
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
Need to get 0B of archives.
After unpacking 442kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 185671 files and directories currently installed.)
Removing fakeroot ...

===================

# apt-get install fakeroot
Reading package lists... Done
...

The following NEW packages will be installed:
  fakeroot
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0B/111kB of archives.
After unpacking 442kB of additional disk space will be used.
Selecting previously deselected package fakeroot.
(Reading database ... 185632 files and directories currently installed.)
Unpacking fakeroot (from .../fakeroot_1.7.1ubuntu1_i386.deb) ...
Setting up fakeroot (1.7.1ubuntu1) ...
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.

#

This is on Gutsy with dpkg 1.14.4ubuntu2 (and fakeroot 1.7.1ubuntu1)

Line 602 reads:

            if (!defined($linkname= readlink($slink)) && $! != &ENOENT) {

In my case, $slink is sometimes not defined.
I increased verbosity in update-alternatives and apt-get install now says:

Setting up fakeroot (1.7.1ubuntu1) ...
Checking available versions of fakeroot, updating links in /etc/alternatives ...
(You may modify the symlinks there yourself if desired - see `man ln'.)
Updating fakeroot (/usr/bin/fakeroot) to point to /usr/bin/fakeroot-sysv.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating fakeroot.1.gz (/usr/share/man/man1/fakeroot.1.gz) to point to /usr/share/man/man1/fakeroot-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating faked.es.1.gz (/usr/share/man/es/man1/faked.1.gz) to point to /usr/share/man/es/man1/faked-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating faked.sv.1.gz (/usr/share/man/sv/man1/faked.1.gz) to point to /usr/share/man/sv/man1/faked-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating fakeroot.sv.1.gz (/usr/share/man/sv/man1/fakeroot.1.gz) to point to /usr/share/man/sv/man1/fakeroot-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating fakeroot.es.1.gz (/usr/share/man/es/man1/fakeroot.1.gz) to point to /usr/share/man/es/man1/fakeroot-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating fakeroot.fr.1.gz (/usr/share/man/fr/man1/fakeroot.1.gz) to point to /usr/share/man/fr/man1/fakeroot-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating faked.1.gz (/usr/share/man/man1/faked.1.gz) to point to /usr/share/man/man1/faked-sysv.1.gz.
Use of uninitialized value in string ne at /usr/sbin/update-alternatives line 602.
Updating faked.fr.1.gz (/usr/share/man/fr/man1/faked.1.gz) to point to /usr/share/man/fr/man1/faked-sysv.1.gz.
Checking available versions of fakeroot, updating links in /etc/alternatives ...
(You may modify the symlinks there yourself if desired - see `man ln'.)
Leaving fakeroot (/usr/bin/fakeroot) pointing to /usr/bin/fakeroot-sysv.
Leaving fakeroot.1.gz (/usr/share/man/man1/fakeroot.1.gz) pointing to /usr/share/man/man1/fakeroot-sysv.1.gz.
Leaving faked.es.1.gz (/usr/share/man/es/man1/faked.1.gz) pointing to /usr/share/man/es/man1/faked-sysv.1.gz.
Leaving faked.sv.1.gz (/usr/share/man/sv/man1/faked.1.gz) pointing to /usr/share/man/sv/man1/faked-sysv.1.gz.
Leaving fakeroot.sv.1.gz (/usr/share/man/sv/man1/fakeroot.1.gz) pointing to /usr/share/man/sv/man1/fakeroot-sysv.1.gz.
Leaving fakeroot.es.1.gz (/usr/share/man/es/man1/fakeroot.1.gz) pointing to /usr/share/man/es/man1/fakeroot-sysv.1.gz.
Leaving fakeroot.fr.1.gz (/usr/share/man/fr/man1/fakeroot.1.gz) pointing to /usr/share/man/fr/man1/fakeroot-sysv.1.gz.
Leaving faked.1.gz (/usr/share/man/man1/faked.1.gz) pointing to /usr/share/man/man1/faked-sysv.1.gz.
Leaving faked.fr.1.gz (/usr/share/man/fr/man1/faked.1.gz) pointing to /usr/share/man/fr/man1/faked-sysv.1.gz.

# update-alternatives --list fakeroot
/usr/bin/fakeroot-sysv
/usr/bin/fakeroot-tcp

problem is these two alternatives are from the same package.

# dlocate /usr/bin/fakeroot
fakeroot: /usr/bin/fakeroot-tcp
fakeroot: /usr/bin/fakeroot-sysv

Maybe it's a bug in fakeroot but in any case, update-alternatives should handle it more cleanly.

Related branches

Revision history for this message
Tormod Volden (tormodvolden) wrote :

It happens with many other packages as well. The bug is in dpkg itself.

Changed in dpkg:
status: Unconfirmed → Confirmed
Ian Jackson (ijackson)
Changed in dpkg:
assignee: nobody → ijackson
importance: Undecided → Medium
Revision history for this message
Fabien Tassin (fta) wrote :

I was sick of seeing this so I fixed it.
Patch attached (tested on Gusty).

Revision history for this message
Sarah Kowalik (hobbsee-deactivatedaccount) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 23 Jun 2007 02:35:25 +1000
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source
Version: 1.14.4+svn20070602r802-0ubuntu2
Distribution: gutsy
Urgency: low
Maintainer: Ubuntu Core Developers <email address hidden>
Changed-By: Sarah Hobbs <email address hidden>
Description:
 dpkg - package maintenance system for Debian
 dpkg-dev - package building tools for Debian
 dselect - user tool to manage Debian packages
Launchpad-Bugs-Fixed: 118246
Changes:
 dpkg (1.14.4+svn20070602r802-0ubuntu2) gutsy; urgency=low
 .
   * Fix the uninitialized value in string ne at /usr/sbin/update-alternatives
     line 602. Thanks to Ubulette for this patch. (LP: #118246)
   * Modify Maintainer value to match Debian-Maintainer-Field Spec
Files:
 b8957b6f4072253d46692e4247c29c46 985 admin required dpkg_1.14.4+svn20070602r802-0ubuntu2.dsc
 118a951ed4e41bab07ac50696f70450c 5741483 admin required dpkg_1.14.4+svn20070602r802-0ubuntu2.tar.gz
Original-Maintainer: Dpkg Developers <email address hidden>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGe/yZ7/o1b30rzoURAjXpAKDqIBUYLquDNoDIO91ljGVuiq8q6QCgyl9j
Dcc+ruosQ55iyifGAcanD3I=
=ELgk
-----END PGP SIGNATURE-----

pitti said this looked sane, too.

Changed in dpkg:
status: Confirmed → Fix Released
Revision history for this message
Sarah Kowalik (hobbsee-deactivatedaccount) wrote :

dpkg (1.14.4+svn20070602r802-0ubuntu2) gutsy; urgency=low

  * Fix the uninitialized value in string ne at /usr/sbin/update-alternatives
    line 602. Thanks to Ubulette for this patch. (LP: #118246)
  * Modify Maintainer value to match Debian-Maintainer-Field Spec

 -- Sarah Hobbs <email address hidden> Sat, 23 Jun 2007 02:35:25 +1000

Revision history for this message
Ian Jackson (ijackson) wrote :
Download full text (4.5 KiB)

dpkg (1.14.5ubuntu1) gutsy; urgency=low

  Merge from debian unstable, remaining changes follow:

  Miscellaneous fixes:
  * Don't consider it a file conflict if the package contains
    a symlink to a directory where another package already contains the
    same symlink/directory and the existing and new symlinks point to the
    same place. (Launchpad 22340, Debian #377682.)
  * mlib contains m_strdup (part of the fix for Debian #379028).
  * Fix formatting of these files:
       lib/showpkg.c
       lib/tarfn.c
       src/configure.c
       src/archives.c (function quote_filename only)
    to conform to the rest of dpkg by running them through
    expand -t2 (and in the last case using M-x indent-rigidly once).
    As discussed on debian-dpkg. Submitted upstream as Debian #375711.
  * scripts/update-alternatives.pl: in the case where the slave is
    inapplicable do not attempt to create the slave link before removing
    it again. This will help alleviate LP #84906 (vim upgrade problems)
    and will generally make things slightly less fragile. Debian #411699.
  * mlib contains m_strdup (part of the fix for Debian #379028).
  * Fix the uninitialized value in string ne at /usr/sbin/update-alternatives
    line 602. Thanks to Ubulette for this patch. (LP: #118246)
    Patch modified by iwj not to ignore lstat failures.
  * Use i686 for lpia in cputable and triplettable.

  Launchpad integration:
  * Implement changelog-closes-bugs for Ubuntu (see
    https://wiki.ubuntu.com/ClosingBugsFromChangelog).
  * Add Launchpad-Bugs-Fixed to dpkg-genchanges too, to make it not
    complain about unknown fields.

  DebianMaintainerField:
  * scripts/dpkg-source.pl: Check that debian/control complies to
    https://wiki.ubuntu.com/DebianMaintainerField: Refuse to build a source
    package if we have an Ubuntu version number, but Maintainer: is not an
    Ubuntu address. Output a warning if there is no XSBC-Original-Maintainer:
    field for packages with an Ubuntu version number.
  * scripts/dpkg-source.pl: Only fail to build the source package if $DEBEMAIL
    contains 'ubuntu'. If not, only print a warning.
  * debian/control: Change Maintainer/XSBC-Original-Maintainer field.

  Implementation of Breaks:
  * References:
     http://lists.debian.org/debian-devel/1997/10/msg00643.html
     https://wiki.ubuntu.com/PackageDependencyFieldBreaks
     Debian #379140.
  * Manpages mention Breaks: deb-control.5, dpkg-query.1, dpkg.1.
  * Support for Breaks in dpkg-source, dpkg-gencontrol et al.
  * Support for Breaks in the code in dpkg.
  * Breaks is ignored by dselect.
  * Fix for Debian #378003 (multiple deconfigurations) is
    mixed in with Breaks implementation.
  * Declare Breaks against older dpkg-dev rather than Conflicts.
  * Decisions made:
    * Specifying Breaks: <virtual package> is fairly meaningless
      without versioned Provides but to make versioned Provides easier
      in the future we support it fully.
    * We do not transitively deconfigure things when we deconfigure
      due to Breaks, just as we don't do so when we deconfigure due
      to removal due to Conflicts (see also Debian #378009).
    * Just as for deconfiguration ...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.