On Tuesday 18 March 2008 00:42:02 Gilles Dartiguelongue wrote: > > Now, basically, if the portage metadata or QA people could tell me a way > > to figure *all* the ebuilds that inherit gnome2 *and* have a > > pkg_preinst() function somewhere (either in the ebuild or in an eclass > > somewhere) I'd really appreciate it, as I really don't want to read > > through thousands of ebuilds to figure it out. > > Here is my brute force method:
Wow.. :p
> $ # extract the list of package defining custom pkg_preinst()
> $ egrep -r "^.*?_pkg_preinst" /usr/portage/eclass/* |cut -f1 -d: |sed \
> "s:/usr/portage/eclass/::g;s:.eclass::g" |sort|uniq| tee \
> export-preinst.list
$ grep -l 'EXPORT_FUNCTIONS.*pkg_preinst' $(portageq portdir)/eclass/*.eclass |
\
while read eclass; do
basename "$eclass" .eclass
done | tee export-preinst.list
> $ # extract the list of ebuilds inheriting gnome2 eclass
> $ find /usr/portage/ -name "*.ebuild" -exec egrep -H "gnome2" {} \; | \
> cut -f1 -d: |uniq| tee gnome-inherit.list
$ inquisitio --repository gentoo --all-versions --compact --keys INHERITED \
--matcher exact gnome2 | cut -d' ' -f2 | tee gnome2-inherited.list
[...]
> of course YMMV and there might be simpler/faster solutions but oh
> well... it gave me an output of 62 packages.
While inquisitio may not be faster it is certainly more reliable. Another option
is to rely on the metadata cache in an rsync tree where INHERITED is the tenth
line in each entry.
--
Bo Andresen
Gentoo KDE Dev
signature.asc
Description: This is a digitally signed message part.
