Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234584 - gentoolkit:equery does not operate when query has more then 1 leading "/"
Summary: gentoolkit:equery does not operate when query has more then 1 leading "/"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Portage Tools Team
URL: http://www.gentoo.org/proj/en/portage...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 170220
  Show dependency tree
 
Reported: 2008-08-13 01:03 UTC by jon R-B
Modified: 2008-08-27 16:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
edited equery with leading "/" check on belongs (equery,53.87 KB, text/plain)
2008-08-13 01:06 UTC, jon R-B
Details
updated equery file (equery,53.77 KB, text/plain)
2008-08-13 01:30 UTC, jon R-B
Details
Patchfile for equery (equery.patch,383 bytes, patch)
2008-08-13 09:15 UTC, jon R-B
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jon R-B 2008-08-13 01:03:43 UTC
emerge gentoolkil -p
[ebuild   R   ] app-portage/gentoolkit-0.2.4_rc5

equery belongs $(readlink /usr/lib/libGL.so) 
returns: nothing

readlink /usr/lib/libGL.so 
returns: //usr/lib64/opengl/nvidia/lib/libGL.so

equery belongs //usr/lib64/opengl/nvidia/lib/libGL.so
returns: nothing

equery belongs /usr/lib64/opengl/nvidia/lib/libGL.so
returns: [ Searching for file(s) /usr/lib64/opengl/nvidia/lib/libGL.so in *... ]
x11-drivers/nvidia-drivers-177.13 (/usr/lib64/opengl/nvidia/lib/libGL.so -> libGL.so.177.13)

Obviously this is returning nvidia since an nvidia-based system (just an example)

Looking over /usr/bin/equery there is some python-foo to take care of trailing  "/" but nothing for leading double "/"
Also added a an extra check just incase no leading '/' is provided


373a374,378
> 				leading_slash = query[i].split('/').count('') - 1
> 				if leading_slash < 0:
> 					leading_slash = 0
> 				query[i] = query[i][leading_slash:]
> 





Reproducible: Always
Comment 1 jon R-B 2008-08-13 01:06:35 UTC
Created attachment 162801 [details]
edited equery with leading "/" check on belongs
Comment 2 jon R-B 2008-08-13 01:30:05 UTC
Actually:

query[i] = '/' + query[i].lstrip('/')

is probably simpler be it overkill with the lstrip for 99% of the time


373a374
> 				query[i] = '/' + query[i].lstrip('/')
Comment 3 jon R-B 2008-08-13 01:30:54 UTC
Created attachment 162803 [details]
updated equery file
Comment 4 jon R-B 2008-08-13 09:15:29 UTC
Created attachment 162806 [details, diff]
Patchfile for equery

Sorry here is a patch file, not the whole src
Comment 5 Paul Varner (RETIRED) gentoo-dev 2008-08-22 20:19:09 UTC
Thanks,  I changed it to be more generic and it now strips multiple slashes found anywhere in the path name.

$ svn commit -m " Fix equery belongs to strip multiple slashes from path names. (Bug #234584)" ChangeLog src/equery/equery
Sending        ChangeLog
Sending        src/equery/equery
Transmitting file data ..
Committed revision 505.
Comment 6 Paul Varner (RETIRED) gentoo-dev 2008-08-27 16:07:14 UTC
Released in gentoolkit-0.2.4_rc6