Bug 554801

Summary: command-not-found won't provide package if command is "similar" to installed command
Product: [Fedora] Fedora Reporter: Edward Rudd <urkle>
Component: PackageKitAssignee: Richard Hughes <richard>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: jonathan, rhughes, richard, smparrish
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-22 16:45:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Edward Rudd 2010-01-12 17:44:43 UTC
Description of problem:
I am trying to run "kompare" (the KDE compare/diff GUI) but pk-command-not-found suggests I should run "compare" instead.

Version-Release number of selected component (if applicable):
PackageKit-0.5.5-1.fc12@x86_64

How reproducible:
with similar names, every time.
ie.
kompare vs compare
htop vs top

Steps to Reproduce:
1. open a shell and have PackageKit-command-not-found installed
2. run a "similar" but uninstalled known command to something installed (ie.. htop)
  
Actual results:
Command not found. Similar command is: 'top'

Expected results:
asking me to install htop.

Comment 1 Steven M. Parrish 2010-01-17 15:52:49 UTC
This bug has been triaged

Steven M. Parrish
KDE & Packagekit Triager 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 2 Richard Hughes 2010-01-19 17:58:32 UTC
(In reply to comment #0)
> 1. open a shell and have PackageKit-command-not-found installed
> 2. run a "similar" but uninstalled known command to something installed (ie..
> htop)

Isn't that what it's meant to do? Can't you edit /etc/PackageKit/CommandNotFound.conf and make it how you like it?

Comment 3 Edward Rudd 2010-01-19 22:51:14 UTC
ahh.. didn't notice that config file there..  However it doesn't really resolve the issue.  If I set the configuration option SingleMatch to ignore instead of warn it simple states "command not found" and doesn't offer "htop" as a possible package (or kdesdk for kompare).

If I set SingleMatch to ask it asks "do you want to run top?".

This is really a "complex" issue unfortunately.. As which should take precedence.. the available packages in the repository OR the typo?  Right now the typo is taking precedence, and there doesn't seem to be a way to change that.

Switching the precedence will resolve the issue for me, but will it cause new issues of "I really did typo and I don't want to install a command I've never heard of before.  Can you REALLY tell me what the possible matches of installed packages are?"

Possibly options to resolve this may be
1) a new preference should be added to change the precedence of scanning
2) have a preference to show BOTH new packages and typo resolutions.

(either way this probably needs to be filed upstream)

Comment 4 Richard Hughes 2010-03-22 16:45:23 UTC
(In reply to comment #3)
> (either way this probably needs to be filed upstream)    

Agreed, with a patch please :-)