update-alternatives gives "argument isn't numeric"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dpkg (Ubuntu) |
Invalid
|
Low
|
Unassigned |
Bug Description
Binary package hint: dpkg
On Hardy with dpkg 1.14.16.6ubuntu4, I ran "update-
The second problem was that I got a Perl warning as a result:
Press enter to keep the default[*], or type selection number: ?
Argument "?" isn't numeric in numeric ge (>=) at /usr/sbin/
I got the same result when I tried to use "q" to quit without changing anything.
Looking at the code it's obvious someone WANTED to test for this, but just did it wrong. I've attached a trivial diff that solves the warning, but doesn't try to do anything fancier like support "q", "h/?" etc. options or even give a reasonable error message if the user enters an invalid value. But since the old code didn't do any of this either I guess it's just about right :-).
I tested this bug report using dpkg version 1.15.3.1ubuntu1 on Karmic Koala and was unable to recreate the original bug and the lines of code mentioned in your patch are no longer in update- alternatives.