Re: Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-08-05 Thread Bruce Cran

On 05/07/2012 10:48, Olivier Smedts wrote:

And it really annoys me too because usually, instead of an immediate
command not found, you've got a reply seconds later if on a not so
fast computer. When working on Ubuntu, after a typo or missing command
I have the time to realize that something strange is happening, to
read again what I typed and to hit ^C before any message is displayed.



That annoys me too. The openSUSE guys worked on the same problem 
(https://bugzilla.novell.com/show_bug.cgi?id=435160), going from a few 
seconds down to 700ms and got told they'd need to do better :)
In the end they added a COMMAND_NOT_FOUND_AUTO variable, disabled by 
default, to do the slow search, and the standard behaviour became to 
print a message similar to Command not found. If this isn't a typo, run 
cnf command to find the package containing it which is a solution I 
like.


--
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-08 Thread Chris Rees
On 5 July 2012 01:30, Tim Kientzle t...@kientzle.com wrote:
 On Jul 4, 2012, at 4:41 PM, Jason Hellenthal wrote:

 On Wed, Jul 04, 2012 at 03:59:29PM -0700, Doug Barton wrote:
 On 07/04/2012 15:55, Jason Hellenthal wrote:
 Seeing as sudo plays a big part of this

 No ... not only is sudo not a necessary component, it shouldn't be
 involved at all. The feature works on debian/ubuntu for regular
 userspace commands.


 What are they using to authenticate for the install ? do you know ?

 Huh?  What install?  Who's talking about install?

 The version of this I've seen looks like this:

 $ svn co https://some.url/
 svn: Command not found.
   To use this command, install one of the following packages:
   devel/subversion
   devel/subversion-freebsd
   devel/subversion16

 That's all it does:  It just prints out a more informative error message.
 It does not install anything, it requires no special permissions,
 and does not (as far as I can see) introduce any security or
 performance problems.

 The implementation is pretty simple:
  * A tool for building a database that maps command names
to package names.  (This would run against a ports tree or
package repository.  Conceptually, it's pretty similar to
how port/package indexes get built today.)
  * Some way to distribute that database (Probably as part of ISO
releases, maybe extend 'portsnap' or 'pkg_add' to update it?)
  * A program to look up command names in that database
and print out the results.
  * A shell hook to run said program whenever a command not found
error occurs.

 As a first prototype, the database could just be a text file
 and the look up program could be a shell script that uses
 grep and sed.

Anyone looking to implement something like this could also talk to
Sulev-Madis Silber (ketas on EFNet) about his code for making a
universal list of files provided by all ports-- he has written a
conflicts checker recently and may know some shortcuts.

Chris
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Olivier Smedts
2012/7/5 Mike Meyer m...@mired.org:
 My objection was not due to misunderstanding about auto-install. I
 find the feature annoying - spewing a bunch of crap at me because of a
 typo. It annoys me far more often than it actually helps me, because
 more often than not the missing command is a typo, *not* an attempt
 to run a command I don't have. I.e., if I type mmap instead of nmap, I
 get:

 mwm@IPGhosterCrawlerI:~$ mmap
 No command 'mmap' found, did you mean:
  Command 'jmap' from package 'openjdk-6-jdk' (main)
  Command 'jmap' from package 'openjdk-7-jdk' (universe)
  Command 'gmap' from package 'gmap' (multiverse)
  Command 'gmap' from package 'scotch' (universe)
  Command 'tmap' from package 'emboss' (universe)
  Command 'smap' from package 'slurm-llnl' (universe)
  Command 'pmap' from package 'procps' (main)
  Command 'moap' from package 'moap' (universe)
  Command 'umap' from package 'libunicode-map8-perl' (main)
  Command 'map' from package 'sgt-puzzles' (universe)
  Command 'amap' from package 'amap-align' (universe)
 mmap: command not found

And it really annoys me too because usually, instead of an immediate
command not found, you've got a reply seconds later if on a not so
fast computer. When working on Ubuntu, after a typo or missing command
I have the time to realize that something strange is happening, to
read again what I typed and to hit ^C before any message is displayed.

-- 
Olivier Smedts _
ASCII ribbon campaign ( )
e-mail: oliv...@gid0.org- against HTML email  vCards  X
www: http://www.gid0.org- against proprietary attachments / \

  Il y a seulement 10 sortes de gens dans le monde :
  ceux qui comprennent le binaire,
  et ceux qui ne le comprennent pas.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Wojciech Puchar

mwm@IPGhosterCrawlerI:~$ mmap
No command 'mmap' found, did you mean:
Command 'jmap' from package 'openjdk-6-jdk' (main)
Command 'jmap' from package 'openjdk-7-jdk' (universe)
Command 'gmap' from package 'gmap' (multiverse)
Command 'gmap' from package 'scotch' (universe)
Command 'tmap' from package 'emboss' (universe)
Command 'smap' from package 'slurm-llnl' (universe)
Command 'pmap' from package 'procps' (main)
Command 'moap' from package 'moap' (universe)
Command 'umap' from package 'libunicode-map8-perl' (main)
Command 'map' from package 'sgt-puzzles' (universe)
Command 'amap' from package 'amap-align' (universe)
mmap: command not found


are you serious that linux distros have such a think now?
I didn't use linux for a long time and no plan to use it, but you are 
joking isn't it?

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Garrett Cooper
On Thu, Jul 5, 2012 at 2:48 AM, Olivier Smedts oliv...@gid0.org wrote:
 2012/7/5 Mike Meyer m...@mired.org:
 My objection was not due to misunderstanding about auto-install. I
 find the feature annoying - spewing a bunch of crap at me because of a
 typo. It annoys me far more often than it actually helps me, because
 more often than not the missing command is a typo, *not* an attempt
 to run a command I don't have. I.e., if I type mmap instead of nmap, I
 get:

 mwm@IPGhosterCrawlerI:~$ mmap
 No command 'mmap' found, did you mean:
  Command 'jmap' from package 'openjdk-6-jdk' (main)
  Command 'jmap' from package 'openjdk-7-jdk' (universe)
  Command 'gmap' from package 'gmap' (multiverse)
  Command 'gmap' from package 'scotch' (universe)
  Command 'tmap' from package 'emboss' (universe)
  Command 'smap' from package 'slurm-llnl' (universe)
  Command 'pmap' from package 'procps' (main)
  Command 'moap' from package 'moap' (universe)
  Command 'umap' from package 'libunicode-map8-perl' (main)
  Command 'map' from package 'sgt-puzzles' (universe)
  Command 'amap' from package 'amap-align' (universe)
 mmap: command not found

 And it really annoys me too because usually, instead of an immediate
 command not found, you've got a reply seconds later if on a not so
 fast computer. When working on Ubuntu, after a typo or missing command
 I have the time to realize that something strange is happening, to
 read again what I typed and to hit ^C before any message is displayed.

Almost like you need a Better diagnostic message to note that a
package database is being searched ;]...
-Garrett
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Garrett Cooper
On Thu, Jul 5, 2012 at 7:36 AM, Wojciech Puchar
woj...@wojtek.tensor.gdynia.pl wrote:
 mwm@IPGhosterCrawlerI:~$ mmap
 No command 'mmap' found, did you mean:
 Command 'jmap' from package 'openjdk-6-jdk' (main)
 Command 'jmap' from package 'openjdk-7-jdk' (universe)
 Command 'gmap' from package 'gmap' (multiverse)
 Command 'gmap' from package 'scotch' (universe)
 Command 'tmap' from package 'emboss' (universe)
 Command 'smap' from package 'slurm-llnl' (universe)
 Command 'pmap' from package 'procps' (main)
 Command 'moap' from package 'moap' (universe)
 Command 'umap' from package 'libunicode-map8-perl' (main)
 Command 'map' from package 'sgt-puzzles' (universe)
 Command 'amap' from package 'amap-align' (universe)
 mmap: command not found

 are you serious that linux distros have such a think now?
 I didn't use linux for a long time and no plan to use it, but you are joking
 isn't it?

It's a Debian thing. It doesn't exist [out of the box] on Gentoo,
Redhat, Suse, etc.
-Garrett
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Jonathan Anderson
On 5 Jul 2012, at 15:36, Wojciech Puchar wrote:
 mwm@IPGhosterCrawlerI:~$ mmap
 No command 'mmap' found, did you mean:
 Command 'jmap' from package 'openjdk-6-jdk' (main)
 Command 'jmap' from package 'openjdk-7-jdk' (universe)
 Command 'gmap' from package 'gmap' (multiverse)
 Command 'gmap' from package 'scotch' (universe)
 Command 'tmap' from package 'emboss' (universe)
 Command 'smap' from package 'slurm-llnl' (universe)
 Command 'pmap' from package 'procps' (main)
 Command 'moap' from package 'moap' (universe)
 Command 'umap' from package 'libunicode-map8-perl' (main)
 Command 'map' from package 'sgt-puzzles' (universe)
 Command 'amap' from package 'amap-align' (universe)
 mmap: command not found
 
 are you serious that linux distros have such a think now?
 I didn't use linux for a long time and no plan to use it, but you are joking 
 isn't it?

They do, and it's actually very useful in two cases:
1. new users — my friend told me to try out latex, but when I type 'latex' 
nothing happens! oh wait, that's how I make it work
2. confusingly-named packages. on FreeBSD:

[nick ~]$ latex
zsh: command not found: latex
[nick ~]$ pkg search latex | awk '{print $1}'
latex-chapterfolder-2.0.20051124
latex-supertabular-1_3
ja-latex2html-2002.2.1j2.0_11
latex-beamer-3.07_4
latex-feynmf-1.08.19961202_7
pidgin-latex-1.0_5
latex-biblatex-0.9e
latex-pgf-2.10
latex-svninfo-0.7.4_3
latex-keystroke-1.0.20001109_5
latex-aastex-5.2_3
klatexformula-3.1.2_2
latex-nomencl-4.2.20050922
jlatexmath-0.9.7
latex-acm-1.1
latex-circ-1.0f_5
html2latex-0.9c
rtf2latex2e-1.0
latex-timing-1.0.19940515_6
latex-aa-6.1_3
latex-ucs-20041017_5
tomboy-plugin-latex-0.6
latex2e-2003.12_1
latex-etoolbox-2.0.a
db2latex-0.8p1_1
dblatex-0.3.2
latex2html-2008
latex2slides-1.0_5
platex-jsclasses-1.0.20110510
ja-platex-otf-1.2.4_6
ja-platex209-1.0_7
latex-mk-2.1_2
rtf2latex-1.5
latex-prettyref-3.0_4
latex-texpower-0.2_4
latex-arydshln-1.71.20040831_5
latex-logreq-1.0
cpp2latex-2.3
latex-biblist-1.4.19920113_5
platex-japanese-1.3_4
latex-caption-3.1.20100114_1
latex-auto-greek-1.0b_4
latexmk-431
latex-service-0.1_2
latex2rtf-2.0.0
latex-tipa-1.3_4
latex-mathabx-1.0.20050518_4
latex-logpap-0.6.20040201_5
htmltolatex-1_15
latex-bytefield-1.2.20050731_5
latex-resume-20010823_3
latexdiff-0.5_2
easylatex-0.080
csv2latex-0.18,1
latex-subfloat-2.14.20030821_5
latex-csquotes-5.0b
latex-ltablex-1.0_1
latex-cjk-4.8.2_5

Compare to bash on Ubuntu:

[jra40@kent ~]$ latex
The program 'latex' is currently not installed.  You can install it by typing:
sudo apt-get install texlive-latex-base

This kind of thing makes the system *very* discoverable for non-experts (even 
non-experts wrt a particular package). You don't need to check mailing lists or 
freshports or whatnot, you can just try stuff out, and when it doesn't work, 
the system sometimes helps you find the thing you're looking for. For some 
people (like me), just try stuff out is an excellent way to start playing / 
getting familiar with a new system; it makes it more likely that I will stick 
with that system.

The command line shouldn't have to be a scary place for new users.


Jon
--
Jonathan Anderson

jonat...@freebsd.org
http://freebsd.org/~jonathan/___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Wojciech Puchar


are you serious that linux distros have such a think now?
I didn't use linux for a long time and no plan to use it, but you are joking 
isn't it?


They do, and it's actually very useful in two cases:


no it isn't. unless it would be extra keypress for that.

i don't want to be treated as a moron just as when i use google search 
with javascript active.



___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Chris Rees
On Jul 5, 2012 5:37 PM, Wojciech Puchar woj...@wojtek.tensor.gdynia.pl
wrote:


 are you serious that linux distros have such a think now?
 I didn't use linux for a long time and no plan to use it, but you are
joking isn't it?


 They do, and it's actually very useful in two cases:


 no it isn't. unless it would be extra keypress for that.

 i don't want to be treated as a moron just as when i use google search
with javascript active.


You'd fall into the category of 'I would disable that feature' then.

Since that is the case, you should stop commenting, now, and simply disable
it if/when it comes out.

Chris
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Mike Meyer
On Thu, 5 Jul 2012 15:57:09 +0100
Jonathan Anderson jonathan.robert.ander...@gmail.com wrote:
 They do, and it's actually very useful in two cases:
 1. new users — my friend told me to try out latex, but when I type 'latex' 
 nothing happens! oh wait, that's how I make it work
 2. confusingly-named packages. on FreeBSD:
 
 [nick ~]$ latex
 zsh: command not found: latex
 [nick ~]$ pkg search latex | awk '{print $1}'
 latex-chapterfolder-2.0.20051124

[long list elided]

 Compare to bash on Ubuntu:
 
 [jra40@kent ~]$ latex
 The program 'latex' is currently not installed.  You can install it by typing:
 sudo apt-get install texlive-latex-base

Nobody has argued that making the ports collection easier to search
would be a bad idea. I get:

bhuda% portsearch -f 'bin/latex$'
Port:   latex2e-2003.12_1
Info:   TeX macro package
Path:   /usr/ports/print/latex
Files:  bin/latex

Port:   teTeX-base-3.0_20
Info:   Thomas Esser's distribution of TeX  friends (binaries)
Path:   /usr/ports/print/teTeX-base
Files:  bin/latex

2 ports, 2 files
bhuda% 

Hmm. Seems like we have two different versions of latex in the ports
- and probably packages - tree.

In fact, if you want this functionality in the base, providing the
search functionality as an external tool is a crucial step. I'd be
surprised if anybody object to that being added to base.

 The command line shouldn't have to be a scary place for new users.

Nor should it be an annoying place for old users. New users are
important. But old users are the ones who make contributions.

   mike
-- 
Mike Meyer m...@mired.org http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Mike Meyer
On Thu, 5 Jul 2012 18:18:10 +0100
Chris Rees utis...@gmail.com wrote:
 You'd fall into the category of 'I would disable that feature' then.
 
 Since that is the case, you should stop commenting, now, and simply disable
 it if/when it comes out.

The claim is that it needs to be on for new users if it's going to do
any good. No problem. That is *not* the same thing as on by default.

On by default implies that you're turning it on for everyone, which is
going to surprise and annoy a lot of users. I'd say that would be a
fail.

You need a way to turn it on for new users *without* turning it on for
everyone. Like, for instance, adding it to /usr/share/skel.

  mike
-- 
Mike Meyer m...@mired.org http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Jonathan Anderson
On 5 Jul 2012, at 18:21, Mike Meyer wrote:
 The command line shouldn't have to be a scary place for new users.
 
 Nor should it be an annoying place for old users. New users are
 important. But old users are the ones who make contributions.

No argument there. :)

I do like the idea (Garrett's, maybe?) of providing such a tool, leaving it off 
by default, making it very easy to turn on (if you run this command, the shell 
will be friendlier to you) and letting the PC-BSD folks turn it on by default 
for their users.


Jon
--
Jonathan Anderson

jonat...@freebsd.org
http://freebsd.org/~jonathan/___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Yuri

On 07/05/2012 09:37, Wojciech Puchar wrote:

no it isn't. unless it would be extra keypress for that.

i don't want to be treated as a moron just as when i use google search 
with javascript active.


I agree, this feature isn't useful on linux. In 100% of cases it got 
engaged for me it was a result of typo.


It would be useful to have a command that finds the port name(s) by the 
command name when needed though.
Today, for example, while searching for package that has a command 
'svlc' I do 'cd /usr/ports  make search key=svlc' and it finds nothing 
instead of finding multimedia/vlc. make search seems to search through 
package names, dependency names, but not command names for some reason.


Maybe this would be the reasonable feature to implement first instead of 
changing the missing command handlers in shells.


Yuri

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread Matthew Seaman
On 05/07/2012 19:06, Yuri wrote:
 It would be useful to have a command that finds the port name(s) by the
 command name when needed though.
 Today, for example, while searching for package that has a command
 'svlc' I do 'cd /usr/ports  make search key=svlc' and it finds nothing
 instead of finding multimedia/vlc. make search seems to search through
 package names, dependency names, but not command names for some reason.

make search uses the INDEX, and that doesn't contain any information
about the files installed by ports.

Building a file index might be possible, but it would be several times
the size of the existing INDEX and take correspondingly longer to
generate.  Also, you'ld probably want it as a sqlite database or BDB
file for performance, rather than plain text.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW





signature.asc
Description: OpenPGP digital signature


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-05 Thread David Brodbeck
On Wed, Jul 4, 2012 at 7:17 PM, Mike Meyer m...@mired.org wrote:
 Actually, that's my biggest gripe about Linux systems. They set things
 in /etc/* shell profiles that *can't* be turned off in user rc files,
 because the ones in /etc run last. (And usually more than
 once. Idiots.)

I haven't encountered that, at least on RedHat.  I routinely override
stuff in /etc/profile in my local .bash_profile.  The bash manpage is
pretty explicit that /etc/profile is read first.  Are some distros
doing something silly like sourcing /etc/profile in .bash_profile?

-- 
David Brodbeck
System Administrator, Linguistics
University of Washington
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-04 Thread Doug Barton
On 07/04/2012 17:30, Tim Kientzle wrote:
 On Jul 4, 2012, at 4:41 PM, Jason Hellenthal wrote:

 On Wed, Jul 04, 2012 at 03:59:29PM -0700, Doug Barton wrote:
 On 07/04/2012 15:55, Jason Hellenthal wrote:
 Seeing as sudo plays a big part of this

 No ... not only is sudo not a necessary component, it shouldn't be
 involved at all. The feature works on debian/ubuntu for regular
 userspace commands.


 What are they using to authenticate for the install ? do you know ?
 
 Huh?  What install?  Who's talking about install?
 
 The version of this I've seen looks like this:
 
 $ svn co https://some.url/
 svn: Command not found.
   To use this command, install one of the following packages:
   devel/subversion
   devel/subversion-freebsd
   devel/subversion16
 
 That's all it does:  It just prints out a more informative error message.
 It does not install anything, it requires no special permissions,
 and does not (as far as I can see) introduce any security or
 performance problems.
 
 The implementation is pretty simple:
  * A tool for building a database that maps command names
to package names.  (This would run against a ports tree or
package repository.  Conceptually, it's pretty similar to
how port/package indexes get built today.)
  * Some way to distribute that database (Probably as part of ISO
releases, maybe extend 'portsnap' or 'pkg_add' to update it?)
  * A program to look up command names in that database
and print out the results.
  * A shell hook to run said program whenever a command not found
error occurs.
 
 As a first prototype, the database could just be a text file
 and the look up program could be a shell script that uses
 grep and sed.

Right-O. The db should almost certainly be updated and distributed as
part of the (already automated) INDEX generation and distribution process.

Doug

-- 

This .signature sanitized for your protection


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-04 Thread Mike Meyer
On Wed, 04 Jul 2012 17:34:13 -0700
Doug Barton do...@freebsd.org wrote:
  As a first prototype, the database could just be a text file
  and the look up program could be a shell script that uses
  grep and sed.
 Right-O. The db should almost certainly be updated and distributed as
 part of the (already automated) INDEX generation and distribution process.

There are already tools in the ports tree that do the
search. Personally, I use portsearch. Tweaking them to use INDEX (or
tweaking the makefile to generate their database with INDEX) should be
straightforward.

mike
-- 
Mike Meyer m...@mired.org http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-04 Thread Tim Kientzle
On Jul 4, 2012, at 5:37 PM, Mike Meyer wrote:

 On Wed, 04 Jul 2012 17:34:13 -0700
 Doug Barton do...@freebsd.org wrote:
 As a first prototype, the database could just be a text file
 and the look up program could be a shell script that uses
 grep and sed.
 Right-O. The db should almost certainly be updated and distributed as
 part of the (already automated) INDEX generation and distribution process.
 
 There are already tools in the ports tree that do the
 search. Personally, I use portsearch.

Very close.  Unfortunately, portsearch seems to require
an installed /usr/ports tree.  A system that generated a database
and searched that database would be useful also by people who
preferred packages over ports.

 Tweaking them to use INDEX (or
 tweaking the makefile to generate their database with INDEX) should be
 straightforward.

INDEX can't be used in its current form because it doesn't have filenames
(just port names).

But yes, a lot of the key pieces already exist in various
places.  Just need someone to piece it together and make
it actually work.

I still think this would be a good addition to the base system
and would like to see it included in the standard release ISOs
so that new FreeBSD users can more quickly find the software
they expect.

I'm curious whether the earlier objections were due to
misunderstandings about auto-install.  Auto-install would
be problematic, but the feature being discussed here does not
require installation.  Just better error messages.

Tim

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-04 Thread Mike Meyer
On Wed, 4 Jul 2012 18:03:05 -0700
Tim Kientzle t...@kientzle.com wrote:
 I'm curious whether the earlier objections were due to
 misunderstandings about auto-install.  Auto-install would
 be problematic, but the feature being discussed here does not
 require installation.  Just better error messages.

My objection was not due to misunderstanding about auto-install. I
find the feature annoying - spewing a bunch of crap at me because of a
typo. It annoys me far more often than it actually helps me, because
more often than not the missing command is a typo, *not* an attempt
to run a command I don't have. I.e., if I type mmap instead of nmap, I
get:

mwm@IPGhosterCrawlerI:~$ mmap
No command 'mmap' found, did you mean:
 Command 'jmap' from package 'openjdk-6-jdk' (main)
 Command 'jmap' from package 'openjdk-7-jdk' (universe)
 Command 'gmap' from package 'gmap' (multiverse)
 Command 'gmap' from package 'scotch' (universe)
 Command 'tmap' from package 'emboss' (universe)
 Command 'smap' from package 'slurm-llnl' (universe)
 Command 'pmap' from package 'procps' (main)
 Command 'moap' from package 'moap' (universe)
 Command 'umap' from package 'libunicode-map8-perl' (main)
 Command 'map' from package 'sgt-puzzles' (universe)
 Command 'amap' from package 'amap-align' (universe)
mmap: command not found

That said, this seems to require modification to the ports system to
generate a database for it. And having a command in the base system
that I can feed a command (or better yet, file - I need libraries
almost as often as I need commands) name to and it tells me what
package/port to install would be useful.

Again, I hope a FreeBSD implementation would be a bit more
constrained, and *not* list similar commands.

bash and zsh already have command_not_found handlers. I don't really
object to that functionality to sh and tcsh. Just *don't turn it on by
default*. I don't think I'd even object to setting those handlers in
/usr/share/skel.

Of course, I might turn around and ask that we add support for command
correction ala zsh to sh  tcsh via those hooks if they get added.

mike
-- 
Mike Meyer m...@mired.org http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-04 Thread Tim Kientzle

On Jul 4, 2012, at 6:42 PM, Mike Meyer wrote:

 On Wed, 4 Jul 2012 18:03:05 -0700
 Tim Kientzle t...@kientzle.com wrote:
 I'm curious whether the earlier objections were due to
 misunderstandings about auto-install.  Auto-install would
 be problematic, but the feature being discussed here does not
 require installation.  Just better error messages.
 
 My objection was not due to misunderstanding about auto-install. I
 find the feature annoying - spewing a bunch of crap at me because of a
 typo. It annoys me far more often than it actually helps me, because
 more often than not the missing command is a typo, *not* an attempt
 to run a command I don't have. I.e., if I type mmap instead of nmap, I
 get:
 
 mwm@IPGhosterCrawlerI:~$ mmap
 No command 'mmap' found, did you mean:
 Command 'jmap' from package 'openjdk-6-jdk' (main)
 Command 'jmap' from package 'openjdk-7-jdk' (universe)
 Command 'gmap' from package 'gmap' (multiverse)
 Command 'gmap' from package 'scotch' (universe)
 Command 'tmap' from package 'emboss' (universe)
 Command 'smap' from package 'slurm-llnl' (universe)
 Command 'pmap' from package 'procps' (main)
 Command 'moap' from package 'moap' (universe)
 Command 'umap' from package 'libunicode-map8-perl' (main)
 Command 'map' from package 'sgt-puzzles' (universe)
 Command 'amap' from package 'amap-align' (universe)
 mmap: command not found

I agree this is excessive.

In this case, a better UI might be to separate the typo handling
from the package reference, so that you would see something
like this:

$ mmap
mmap: command not found
Perhaps you meant one of: jmap, gmap, tmap, smap, (8 others)

That way, if you did really mean jmap, you could try again and see

$ jmap
jmap: command not found
  Try installing one of the following packages:
  java/openjdk-6-jdk
  java/openjdk-7-jdk

I agree also about the convenience of having a tool that
can identify the port/package that would install a particular
library (or other file).  I too have run into the situation where
I need a particular library and can't figure out what the package
is called.


 bash and zsh already have command_not_found handlers. I don't really
 object to that functionality to sh and tcsh. Just *don't turn it on by
 default*. I don't think I'd even object to setting those handlers in
 /usr/share/skel.

How about if it's on by default (in the default /etc/cshrc)
but very easy to turn off?

The primary point of such a feature is to help people new
to FreeBSD.  Someone who sits down at a new FreeBSD installation
and wants to run 'nmap' can then get up to speed a lot more quickly,
since they'll be pointed at the right package right away.

 Of course, I might turn around and ask that we add support for command
 correction ala zsh to sh  tcsh via those hooks if they get added.
 

grin

Tim

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-07-04 Thread Mike Meyer
On Wed, 4 Jul 2012 19:02:11 -0700
Tim Kientzle t...@kientzle.com wrote:
 On Jul 4, 2012, at 6:42 PM, Mike Meyer wrote:
  bash and zsh already have command_not_found handlers. I don't really
  object to that functionality to sh and tcsh. Just *don't turn it on by
  default*. I don't think I'd even object to setting those handlers in
  /usr/share/skel.
 
 How about if it's on by default (in the default /etc/cshrc)
 but very easy to turn off?

Actually, that's my biggest gripe about Linux systems. They set things
in /etc/* shell profiles that *can't* be turned off in user rc files,
because the ones in /etc run last. (And usually more than
once. Idiots.) If you don't have root, the best way to deal with them
is to install a shell that won't run things in /etc. If you have root
and turn them off in /etc, you turn them off for everyone, which may
well piss someone off.

Which makes me think that setting user preferences via things in /etc
instead of /usr/share/skel is a dangerous path to start down. That
means users can *always* fix it, and it will also work for shells that
the Linux way won't work for.

Is there something wrong with using /usr/share/skel? Doesn't it get
used when the install scripts create users?

How appropriate. There are explosives going off outside my window.

 mike
-- 
Mike Meyer m...@mired.org http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org