add alias hook for word "systemtap" pointing to systemtap package

Bug #413591 reported by Martin Olsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Triaged
Low
Unassigned
Nominated for Karmic by Martin Olsson

Bug Description

Apparently "stap" is registered in command-not-found but the word "systemtap" is not.
It's hard to beginners to know that the binary for systemtap is called "stap" so it would be worth adding the word "systemtap" to command-not-found in such a way so that it recommends the systemtap package.

molsson@molsson:~$ systemtap
bash: systemtap: command not found
molsson@molsson:~$ stap
The program 'stap' is currently not installed. You can install it by typing:
sudo apt-get install systemtap
bash: stap: command not found

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

This would require something like a "suggestion" feature. Just adding systemtap as a binary
to the database would not be enough. Otherwise the user installs systemtap, but still has
no binary systemtap and needs to guess what the name is. One solution is to provide a
symlink in the systemtap package itself, then it will be automatically picked up by c-n-f.

The other is something like:

molsson@molsson:~$ systemtap
Systemtap is provided by the systemtap package and the binary is called "stap".
bash: systemtap: command not found

Yet another solution would be to look not only at binaries but also at package names.
Something like:

molsson@molsson:~$ systemtap
There is no binary systemtap, but a package called systemtap that contains the
following binaries: "stap"

Changed in command-not-found (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Michael Vogt (mvo) wrote :

The attached patch implemens solution three:

$ ./command-not-found systemtap
No command 'systemtap' found.
But there is a package 'systemtap' that contains the binaries:
stap

Now the problem with that is that it needs to read all of the database (because the database
maps binary->package and provides no reverse mapping).

Now it appears that this does not make a difference (at least on my relatively fast system):

# echo 3 > /proc/sys/vm/drop_caches
# time ./command-not-found systemtap
No command 'systemtap' found.
But there is a package 'systemtap' that contains the binaries:
stap

real 0m3.330s
user 0m0.416s
sys 0m0.156s

# echo 3 > /proc/sys/vm/drop_caches
# time command-not-found systemtap
bash: command-not-found: command not found

real 0m3.350s
user 0m0.324s
sys 0m0.160s

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.