Gentoo Archives: gentoo-portage-dev

From: tvali <qtvali@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI)
Date: Wed, 15 Mar 2006 22:16:16
Message-Id: cea53e3c0603151414s665b1e89h@mail.gmail.com
In Reply to: Re: portage from C (was Re: [gentoo-portage-dev] Hello! && portage UI) by tvali
1 sorry
2 lines
3 char tt;
4 for (tt=0; tt<40; tt++)
5 fputc(tt, inputf);
6
7 /.../
8
9 fputc(EOF, inputf);
10
11 are not needed at all and do nothing -- i was just testing a thought
12 before i catched how those pipes and forks work in linux :) i have
13 mostly done things in windows and c++ and WinApi so i dont catch
14 everything immedietly yet :)
15
16 2006/3/16, tvali <qtvali@×××××.com>:
17 > So I was the last one :)
18 >
19 > My example is using python interpreter -- it's maybe simpler to use in
20 > many cases, but theoretically slower.
21 >
22 > It is, anyway, not so advanced to import portage, but you can add that line ;)
23 >
24 > 2006/3/15, solar <solar@g.o>:
25 > > On Wed, 2006-03-15 at 21:42 +0100, Kevin F. Quinn (Gentoo) wrote:
26 > > > On Wed, 15 Mar 2006 09:52:13 -0500
27 > > > solar <solar@g.o> wrote:
28 > > >
29 > > > > On Wed, 2006-03-15 at 10:51 +0100, Paul de Vrieze wrote:
30 > > > >
31 > > > > [snip]
32 > > > >
33 > > > > > Actually, C++ being strongly related to C, can just use the C
34 > > > > > python api's. As such it could directly interface with python, and
35 > > > > > use the python portage api.
36 > > > >
37 > > > > If you could demonstrate an 'import portage' and a simple
38 > > > > printf("PORTDIR=%s\n", PORTDIR); in C I'd be highly interested.
39 > > >
40 > > > Try attached :) Had a go 'coz I was curious. Compile with:
41 > > >
42 > > > gcc -o getportdir getportdir.c -lpython2.4
43 > > >
44 > > > Does the equivalent of:
45 > > >
46 > > > #!/usr/bin/portage
47 > > > import portage;
48 > > > print portage.settings["PORTDIR"];
49 > > >
50 > > > (more or less). Docs on the API itself (which comes with Python) are at
51 > > > http://docs.python.org/api/api.html
52 > >
53 > > thanks Kevin,
54 > > marienz also put 3 examples together to demonstrate it.
55 > >
56 > > /me feels like a kid in a candy store.
57 > >
58 > > thanks guys.
59 > >
60 > >
61 > > --
62 > > solar <solar@g.o>
63 > > Gentoo Linux
64 > >
65 > > --
66 > > gentoo-portage-dev@g.o mailing list
67 > >
68 > >
69 >
70 >
71 > --
72 > tvali
73 > (e-mail: "qtvali@×××××.com"; msn: "qtvali@×××××.com";
74 > icq: "317-492-912")
75 >
76 > Ühe eesti internetifirma lehel kohtasin tsitaati:
77 > If you don't do it excellently, dont do it at all. Because if it's not
78 > excellent, it won't be profitable or fun, and if you're not in
79 > business for fun or profit, what the hell are you doing here?
80 > Robert Townsend
81 >
82 >
83 >
84
85
86 --
87 tvali
88 (e-mail: "qtvali@×××××.com"; msn: "qtvali@×××××.com";
89 icq: "317-492-912")
90
91 Ühe eesti internetifirma lehel kohtasin tsitaati:
92 If you don't do it excellently, dont do it at all. Because if it's not
93 excellent, it won't be profitable or fun, and if you're not in
94 business for fun or profit, what the hell are you doing here?
95 Robert Townsend
96
97 --
98 gentoo-portage-dev@g.o mailing list