Bug#249251: Broken prompt: "Install these packages without verification? [y/N]"
On Sun, May 16, 2004 at 12:15:43PM +0200, Thomas Luzat wrote:
> I just noticed that, when installing a package which can't be
> authenticated, the prompt whether one wants to really install it is
> somewhat broken. The line is:
>
> Install these packages without verification? [y/N]
>
> I do not press Y here, just RETURN. It works as expected when entering Y
> or N, but with only RETURN it installs instead of aborting as [y/N]
> indicates.
Thanks for catching this.
> Attached are two small patches which fix that:
>
> 1) apt-get.cc-YnPrompt-oldbehaviour.diff just fixes it.
>
> 2) apt-get.cc-YnPrompt.diff additionally accepts strings consisting only
> of white-space to trigger the default action in YnPrompt. I find that
> somewhat nicer.
When submitting patches, please use 'diff -u' (or 'cvs diff -u'), as this
produces patches which are both human-readable and more flexible when
applied.
What version of apt are these patches relative to? They seem to duplicate
some changes that I made in 0.6.23, or else they are reversed.
...argh. It looks like the release didn't get tagged properly. I did fix
this, and in much the same way that you did.
Working revision: 1.150.2.11
Repository revision: 1.150.2.11 /cvs/deity/apt/cmdline/apt-get.cc,v
Sticky Tag: v0_6 (branch: 1.150.2)
Sticky Date: (none)
Sticky Options: (none)
Existing Tags:
v0_6_23 (revision: 1.150.2.10)
> Another suggestion would be adding a check for NOEXPR and return Default
> if neither YESEXPR nor NOEXPR match, but on the other hand YnPrompt is
> hardly ever used anyway... factoring those out from other tools might
> make it more worthwhile :-)
This is getting far more complex than I ever thought it needed to be...here
is how I think it should work:
- if the user enters a blank line, it should use the default
- if the user enters a recognizable yes response, it should use that
- otherwise, (i.e., a negative response, or garbage), it should do the safe
thing (which should always be false, meaning do not continue)
That is what the current code does, as I changed it to fix #248211. It just
got left out of the 0.6.23 release.
I'm uploading a fixed version now.
--
- mdz
Reply to: