1 |
On Sun, 2011-05-22 at 06:28 +0000, Александр Берсенев wrote: |
2 |
> > What about writing the logging portion in cython so that it can have the |
3 |
> > speed of c with the ease of integrating with python code. |
4 |
> Interesting idea. I'll use it. |
5 |
> |
6 |
> > Alex, if you have any need to obtain info about the package using the |
7 |
> > portage api, or gentoolkit api's I can help you with that. |
8 |
> Ok, I will ask you If I will be having a problem with api. |
9 |
> I wonder why depgraph command produce such huge output for any |
10 |
> packages: equery g --depth=0 grub. |
11 |
> |
12 |
> Best, |
13 |
> Alexander Bersenev |
14 |
> |
15 |
|
16 |
Because nearly every pkg will depend on something else, so the list will |
17 |
keep growing till nearly everything installed is listed. So use |
18 |
reasonable limits. |
19 |
|
20 |
anyway for your use you will probably want to use the python api |
21 |
directly. |
22 |
|
23 |
brian@big_daddy $ python |
24 |
Python 2.6.6 (r266:84292, Mar 5 2011, 10:27:05) |
25 |
[GCC 4.5.2] on linux2 |
26 |
Type "help", "copyright", "credits" or "license" for more information. |
27 |
>>> from gentoolkit.dependencies import Dependencies |
28 |
>>> D=Dependencies('sys-boot/grub-0.97-r10') |
29 |
>>> deps = D.graph_depends(max_depth=4) |
30 |
>>> len(deps) |
31 |
12 |
32 |
>>> deps |
33 |
[(2, None), (3, <Package u'app-misc/pax-utils-0.2.3'>), (3, <Package |
34 |
u'sys-apps/checkpolicy-2.0.21'>), |
35 |
(2, <Package u'sec-policy/selinux-base-policy-20080525-r1'>), (1, |
36 |
<Package u'sec-policy/selinux-gpm-20080525'>), |
37 |
(0, <Package u'sys-libs/gpm-1.20.6'>), (3, <Package |
38 |
u'app-xemacs/ruby-modes-1.04'>), |
39 |
(3, <Package u'dev-libs/libpcre-8.12'>), (2, <Package |
40 |
u'dev-lang/swig-2.0.4_pre12643'>), |
41 |
(2, None), (1, <Package u'virtual/libintl-0'>), (0, <Package |
42 |
u'sys-apps/findutils-4.5.10'>)] |
43 |
>>> def printout(deps): |
44 |
... for depth, pkg in deps: |
45 |
... if pkg: |
46 |
... print pkg.cpv, " depth =", depth |
47 |
... |
48 |
>>> printout(deps) |
49 |
app-misc/pax-utils-0.2.3 depth = 3 |
50 |
sys-apps/checkpolicy-2.0.21 depth = 3 |
51 |
sec-policy/selinux-base-policy-20080525-r1 depth = 2 |
52 |
sec-policy/selinux-gpm-20080525 depth = 1 |
53 |
sys-libs/gpm-1.20.6 depth = 0 |
54 |
app-xemacs/ruby-modes-1.04 depth = 3 |
55 |
dev-libs/libpcre-8.12 depth = 3 |
56 |
dev-lang/swig-2.0.4_pre12643 depth = 2 |
57 |
virtual/libintl-0 depth = 1 |
58 |
sys-apps/findutils-4.5.10 depth = 0 |
59 |
>>> deps = D.graph_depends(max_depth=1) |
60 |
>>> printout(deps) |
61 |
sys-libs/gpm-1.20.6 depth = 0 |
62 |
sys-apps/findutils-4.5.10 depth = 0 |
63 |
sys-apps/help2man-1.39.1 depth = 0 |
64 |
sys-devel/autoconf-wrapper-10-r1 depth = 0 |
65 |
app-arch/xz-utils-5.0.2 depth = 0 |
66 |
>>> deps = D.graph_depends(max_depth=6) |
67 |
>>> printout(deps) |
68 |
app-xemacs/ruby-modes-1.04 depth = 5 |
69 |
dev-libs/libpcre-8.12 depth = 5 |
70 |
sys-devel/gcc-4.5.2 depth = 5 |
71 |
dev-python/python-docs-2.7.1 depth = 5 |
72 |
dev-lang/python-2.7.1-r2 depth = 4 |
73 |
sys-apps/sed-4.2.1-r1 depth = 5 |
74 |
sys-devel/flex-2.5.35_p10 depth = 5 |
75 |
sys-libs/libcap-2.20 depth = 5 |
76 |
sys-freebsd/freebsd-lib-8.0 depth = 5 |
77 |
app-misc/pax-utils-0.2.3 depth = 5 |
78 |
sys-libs/timezone-data-2011g depth = 4 |
79 |
sec-policy/selinux-openldap-20080525 depth = 5 |
80 |
sys-kernel/linux-headers-2.6.38 depth = 4 |
81 |
sys-auth/openpam-20071221 depth = 5 |
82 |
sys-kernel/linux-headers-2.6.38 depth = 4 |
83 |
dev-python/setuptools-0.6.16 depth = 5 |
84 |
sys-devel/binutils-2.21 depth = 5 |
85 |
sys-auth/pam_krb5-4.4 depth = 5 |
86 |
app-editors/gvim-7.3.189 depth = 5 |
87 |
app-vim/pam-syntax-20060424 depth = 4 |
88 |
dev-python/python-docs-3.2 depth = 5 |
89 |
dev-lang/python-3.2 depth = 4 |
90 |
dev-python/python-docs-2.6.6 depth = 5 |
91 |
dev-python/python-docs-2.5.4-r1 depth = 5 |
92 |
dev-lang/python-2.5.4-r4 depth = 4 |
93 |
app-misc/pax-utils-0.2.3 depth = 3 |
94 |
sys-devel/bison-2.5 depth = 4 |
95 |
sys-apps/checkpolicy-2.0.21 depth = 3 |
96 |
sec-policy/selinux-base-policy-20080525-r1 depth = 2 |
97 |
sec-policy/selinux-gpm-20080525 depth = 1 |
98 |
sys-libs/gpm-1.20.6 depth = 0 |
99 |
sys-apps/findutils-4.5.10 depth = 0 |
100 |
>>> |
101 |
|
102 |
-- |
103 |
Brian Dolbec <brian.dolbec@×××××.com> |