Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 56193

Summary: qpkg -f lists too many packages
Product: Portage Development Reporter: Johan Petersson <spock>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Johan Petersson 2004-07-05 19:32:36 UTC
qpkg -f lists all packages with files matching the given prefix, rather than the package containing the exact file specified.

Reproducible: Always
Steps to Reproduce:
1. emerge dev-lang/perl and sys-apps/groff if not already present on the system
2. qpkg -f /usr/bin/pic

Actual Results:  
qpkg lists

dev-lang/perl *
sys-apps/groff *


Expected Results:  
qpkg should have listed

sys-apps/groff *

because dev-lang/perl does not contain any file named /usr/bin/pic (it does
contain a file named /usr/bin/piconv)

Yes, I already know I should be using equery instead. equery does the same
thing, but it also shows files matched so prefix matching might be intended
behaviour there rather than a bug.

This is what I did to temporarily fix the problem:

--- /tmp/bin/qpkg       2004-07-05 21:18:16.000000000 -0500
+++ /usr/bin/qpkg       2004-07-05 20:55:04.000000000 -0500
@@ -309,7 +309,7 @@
                [ "${arg:0:1}" != "/" ] && arg="${PWD}/${arg}"
 
                dirs=`ls /var/db/pkg/${group}/*/CONTENTS \
-               | xargs grep -Fl " ${arg}" \
+               | xargs grep -Fl " ${arg} " \
                | xargs --no-run-if-empty -n 1 dirname`
        fi
        ipak=`(
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2004-07-06 05:50:02 UTC

*** This bug has been marked as a duplicate of 47451 ***