Le lundi 17 mars 2008 à 17:32 +0100, Rémi Cardona a écrit : [snip] > 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: $ # 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 $ # 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 $ # wheeeeeeee $ for x in $(cat gnome-inherit.list); do for y in \ $(cat export-preinst.list); do egrep --color -H "inherit.*${y}" $x; \ done; egrep --color -H "^pkg_preinst" $x; done | \ tee output-unformated.list $ cat output-unformated.list |cut -f1 -d:|sort|uniq of course YMMV and there might be simpler/faster solutions but oh well... it gave me an output of 62 packages. -- Gilles Dartiguelongue <[EMAIL PROTECTED]> Gentoo
signature.asc
Description: Ceci est une partie de message numériquement signée