1 |
On Tuesday 18 March 2008 00:42:02 Gilles Dartiguelongue wrote: |
2 |
> > Now, basically, if the portage metadata or QA people could tell me a way |
3 |
> > to figure *all* the ebuilds that inherit gnome2 *and* have a |
4 |
> > pkg_preinst() function somewhere (either in the ebuild or in an eclass |
5 |
> > somewhere) I'd really appreciate it, as I really don't want to read |
6 |
> > through thousands of ebuilds to figure it out. |
7 |
> |
8 |
> Here is my brute force method: |
9 |
|
10 |
Wow.. :p |
11 |
|
12 |
> $ # extract the list of package defining custom pkg_preinst() |
13 |
> $ egrep -r "^.*?_pkg_preinst" /usr/portage/eclass/* |cut -f1 -d: |sed \ |
14 |
> "s:/usr/portage/eclass/::g;s:.eclass::g" |sort|uniq| tee \ |
15 |
> export-preinst.list |
16 |
|
17 |
$ grep -l 'EXPORT_FUNCTIONS.*pkg_preinst' $(portageq portdir)/eclass/*.eclass | \ |
18 |
while read eclass; do |
19 |
basename "$eclass" .eclass |
20 |
done | tee export-preinst.list |
21 |
|
22 |
> $ # extract the list of ebuilds inheriting gnome2 eclass |
23 |
> $ find /usr/portage/ -name "*.ebuild" -exec egrep -H "gnome2" {} \; | \ |
24 |
> cut -f1 -d: |uniq| tee gnome-inherit.list |
25 |
|
26 |
$ inquisitio --repository gentoo --all-versions --compact --keys INHERITED \ |
27 |
--matcher exact gnome2 | cut -d' ' -f2 | tee gnome2-inherited.list |
28 |
|
29 |
[...] |
30 |
> of course YMMV and there might be simpler/faster solutions but oh |
31 |
> well... it gave me an output of 62 packages. |
32 |
|
33 |
While inquisitio may not be faster it is certainly more reliable. Another option |
34 |
is to rely on the metadata cache in an rsync tree where INHERITED is the tenth |
35 |
line in each entry. |
36 |
|
37 |
-- |
38 |
Bo Andresen |
39 |
Gentoo KDE Dev |