[Bug 189375] Re: "Use of uninitialized value" with "--remove" and non-existent link in /usr/bin
Bug Watch Updater
189375 at bugs.launchpad.net
Thu Aug 11 05:52:53 UTC 2011
** Changed in: dpkg (Debian)
Status: Unknown => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dpkg in Ubuntu.
https://bugs.launchpad.net/bugs/189375
Title:
"Use of uninitialized value" with "--remove" and non-existent link in
/usr/bin
Status in “dpkg” package in Ubuntu:
Fix Released
Status in “dpkg” package in Debian:
Fix Released
Bug description:
Binary package hint: dpkg
While removing epiphany-gecko (and others):
Removing epiphany-gecko ...
Use of uninitialized value in string eq at /usr/sbin/update-alternatives line 488.
The code in update-alternatives is as follows (line 488 marked with "_" at the beginning):
if ($action eq 'remove') {
my $hits = 0;
_ if ($mode eq "manual" and $state ne "expected" and (map { $hits += $apath eq $_ } @versions) and $hits and $linkname eq $apath) {
&pr(_g("Removing manually selected alternative - switching to auto mode"));
$mode = "auto";
}
The code in epiphany-gecko's prerm looks as follows:
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
for alt in epiphany-browser x-www-browser gnome-www-browser; do
update-alternatives --remove $alt /usr/bin/epiphany-gecko
done
fi
This was not reproducible by installing and purging epiphany-gecko
again.
It boils down to:
sudo update-alternatives --remove gnome-www-browser /usr/bin/epiphany-gecko
where then $linkname is the uninitialized variable.
$ LANG=C sudo update-alternatives --display gnome-www-browser
gnome-www-browser - status is manual.
link currently absent
/usr/bin/firefox - priority 70
slave gnome-www-browser.1.gz: /usr/share/man/man1/firefox.1.gz
Current `best' version is /usr/bin/firefox.
I'll attach a patch which checks if $linkname is defined when testing
for it in the code block quoted above.
This is with dpkg 1.14.15ubuntu1 in Ubuntu Hardy. If I remember
correctly, I have configured firefox as the default browser in Gnome.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/189375/+subscriptions
More information about the foundations-bugs
mailing list