FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

LinkBack Thread Tools
Old 02-08-2009, 04:07 AM
Douglas Anderson
Default equery: deprecate --category filtering in belongs

Hi, does anyone use --category filtering in equery belongs? I want to
get rid of it, or at least deprecate it. My reasoning:

* We use 'equery belongs' when don't know to what package a file
belongs. Even if we have a suspicion, most users would have to look up
the category of the package before typing it in.
* Even if you happen to know the exact category of the package that
installed the file (why are you using belongs?), typing
--category=app-portage takes more time than is saved by filtering by
category (about 5 seconds more by my unscientific test).

Even in a script setting, I see no use for this. The time saved is minuscule:

$ time equery belongs /usr/bin/equery --category app-portage
[ Searching for file(s) /usr/bin/equery in app-portage... ]
app-portage/gentoolkit- (/usr/bin/equery)

real 0m4.002s
user 0m3.680s
sys 0m0.076s
$ time equery belongs /usr/bin/equery
[ Searching for file(s) /usr/bin/equery in *... ]
app-portage/gentoolkit- (/usr/bin/equery)

real 0m4.205s
user 0m3.738s
sys 0m0.102s

* Lastly, it's confusing. belongs takes a filename as input, but you
can filter by category? All other modules that take can filter by
category take a pkgspec.

Old 02-08-2009, 06:05 AM
Douglas Anderson
Default equery: deprecate --category filtering in belongs

On Sun, Feb 8, 2009 at 3:30 PM, Brian Harring <ferringb@gmail.com> wrote:
> patch attached against; rough stats follow;
> Mind you this isn't multiple runs, so the numbers are rough
> approximations- that said they're fairly representative.
> Strongly suggest y'all keep category support (although I'll keep on
> using pquery instead .
> Cheers,
> ~harring

Heh, OK I was looking at my local version of equery where category
filtering IS enabled while I was running tests with old equery, which
doesn't have it enabled. Thanks for pointing out my stupid mistake,

We can in fact even make it go faster by filtering only cat/pkg before
it goes through cp_list:

- matches = portage.db["/"]["vartree"].dbapi.cpv_all()
+ matches = gentoolkit.find_all_installed_packages(lambda x: x.startswith(cat))

But still... why? When is it useful? Clearly it has never been used up
until now.

So I'm still in favor of just dumping it. Seems like complete
superfluous fluff to me. If anyone would have any real-world use for
this, I'll clean it up and keep it in. Otherwise I really don't think
anyone will miss it (especially not Brian )


P.S. I'm strictly talking about belongs here, category filtering in
all other modules (where it's actually useful and makes sense) is not
only safe but has been upgraded to take multiple categories, so you
can now do:

$ ./equery.py l --category=app-portage,sys-apps port
[ Searching for port in app-portage, sys-apps ... ]
* installed packages
[I--] [ ] app-portage/portage-utils-0.1.29 (0)
[I--] [ ~] sys-apps/portage-2.2_rc23 (0)
Old 02-09-2009, 01:26 AM
Douglas Anderson
Default equery: deprecate --category filtering in belongs

On Mon, Feb 9, 2009 at 1:11 AM, Michael A. Smith <michael@smith-li.com> wrote:
> Hash: SHA1
> If you do drop it, Douglas, I think you should keep it around as a "Warning:
> Deprecated" feature for a while before dropping it outright.
> That way the users can give feedback via bugzie and their scripts don't break.

Of course, but I think since it's never actually been turned on in the
first place, I'll make it a "not implemented" warning:

$ ./equery.py b -c app-portage /usr/bin/equery
!!! Module option -c, --category not implemented

[ Searching for /usr/bin/equery ... ]
app-portage/gentoolkit- (/usr/bin/equery)


BTW, for anyone interested, I've uploaded a summary of changes in the
refactored equery. Nothing is set in stone and if you have any
comments or criticisms whatsoever, let me know.


Thread Tools

All times are GMT. The time now is 06:54 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org