Edd Barrett wrote on Mon, Feb 04, 2008 at 12:24:22AM +0000:
> On Feb 4, 2008 12:03 AM, Ingo Schwarze <[EMAIL PROTECTED]> wrote:
>> When you request a non-existant package,
>> printing an error message and exiting is OK imho.
>
> Agree, but it did not exit directly after the error,
> it continued to query me.
It looks like this is done on purpose,
see /usr/src/usr.sbin/pkg_add/pkg_add:
my $bad = 0;
[...]
[ inside some loop ]
my $result = OpenBSD::Interactive::choose1(
$pkgname, $state->{interactive}, sort @l);
if (defined $result) { [...] } else { $bad = 1; }
[...]
if ($bad) { exit(1); }
The error message is printed in OpenBSD::Interactive::choose1.
Thus, the design of pkg_add apparently is:
"In interactive mode, first figure out everything you can.
In case some question still remains unsolved at the end,
bail out just before you would otherwise start the real work."
This might even be useful.
When you see the fatal message, decide yourself
either to interrupt (in order to save time)
or to continue (in order to see all the questions).
--
my $bad = 0; # Marc Espie in /usr/src/usr.sbin/pkg_add/pkg_add
# This ^^^^^ is bold, but not too far from truth. :)