Gentoo Archives: gentoo-dev

From: Terje Kvernes <terjekv@××××××××.no>
To: Patrick Lauer <gentoo@×××××××××××××.de>
Cc: gentoo-dev@g.o
Subject: Re: [gentoo-dev] using Portage with other distributions.
Date: Thu, 17 Jul 2003 23:11:07
Message-Id: wxxznjc696h.fsf@nommo.uio.no
1 (I noticed the lack of gentoo-dev@g.o on the CC list, since I
2 cannot know if this was intentional I'm leaving it off also for this
3 reply. feel free to add the gentoo list again if you so desire. :-)
4
5 Patrick Lauer <gentoo@×××××××××××××.de> writes:
6
7 > On Thu, 2003-07-17 at 17:09, Terje Kvernes wrote:
8 >
9 > > I've started trying to clean up emerge, and work my way through
10 > > Portage from there. in my opinion, /usr/bin/emerge should look
11 > > something like this:
12 >
13 > I like it :-)
14
15 thank you.
16
17 > It is easy to understand and should be quite modular.
18
19 the concept is "encapsulation". these days Portage has no
20 understanding of the concept itself -- something which is _very_
21 scary. it feels a lot like Portage was developed as a
22 proof-of-concept that grew into a "solution".
23
24 > > pretty please, if one is going to do something about the backend
25 > > layer, make it layered and pluggable. with "layered" I mean that
26 > > we as an example should seek to make a database interface that you
27 > > can specialize for MySQL, PostgreSQL, Oracle or whatever.
28 >
29 > Yes, I know. but if you implement an SQL-layer it will be easy to
30 > plug a database into the backend. MySQL is just one specific target
31 > because it is available on almost all machines.
32
33 fair enough. just avoid making any assumptions about that backend.
34 "assumptions is the mother of all fuckups".[1]
35
36 [ ... ]
37
38 > > thank you, but I'm somewhat familiar with Python. :-)
39 >
40 > I hope you can forgive my ignorance ;-)
41
42 it's no biggie. I'm rather used to people on gentoo-dev telling me
43 to learn my python since I don't like the way portage looks today.
44
45 I spent about a year and a half developing an XML database server
46 and publishing solution in python, with four other people. this was
47 a few years ago though. I have since dropped working with XML or
48 python.
49
50 > > heh. not quite. I do "emerge sync && emerge -U --fetchonly" in
51 > > cron.daily. merging I do manually, for several reasons.
52 >
53 > Maybe FEATURE="autofetch" should be implemented :-)
54
55 heh. seriously though, 'FEATURES="autofetch"' might be feature
56 creep. then again, if things are properly modular, it should be
57 trivial to apply to the context you're in. although we might want
58 to disable it for searches. :-p
59
60 > > stability is rarely a problem, most things can be fixed and
61 > > debugged. I generally have the attitude that it's better that it
62 > > hits me than anyone actually expecting stability. besides,
63 > > debugging is (occasionally) fun.
64 >
65 > Oh my, you have too much time on your hands ;-)
66
67 actually, no. time is by far my worth valuable asset. the time it
68 takes to observe, track and fix the bug varies. ;-)
69
70 > But I agree, stability is rarely a problem with gentoo.
71
72 life, generally, is good.
73
74 [ ... ]
75
76 > Since there is almost no official documentation about
77 > portage-internals this will be mostly deductive work in the
78 > beginning. There is a documentation effort, but it has not yet
79 > produced public documentation. *sigh*
80
81 I'm aware of this. how you can produce a backbone in a distribution
82 like what Portage is and _not_ have any formal documentation is
83 rather scary.
84
85 > > yup. now, if I could only thump some sense into Python, I'd be
86 > > happy.
87 >
88 > Why that?
89
90 package and object management in Python can be annoying. 'from
91 Emerge import Emerge'? seriously, I don't care what _file_ the
92 Emerge class is in, I just want to load the class / namespace /
93 scope / whatever you want to call it.
94
95 also, the requirement that all labels should be declared before
96 they're used is highly annoying. I'd like /usr/bin/emerge to look
97 more like:
98
99 import sys
100
101 from Emerge import Emerge
102
103 processor = Emerge()
104 command, arguments = get_command( sys.argv )
105
106 # execute throws an exception on errors.
107 try:
108 processor.execute( command, arguments )
109 except Exception, e:
110 print e
111
112
113 def get_command( arglist ):
114 # ...
115
116 in effect I'd like to not have the main call at the bottom. I read
117 text and code from the top downwards. I don't much like having to
118 skip up and down to be able to follow the control flow.
119
120 > Python has some limitations, but in my experience it is more useful
121 > for rapid development and test implementations than most other
122 > languages.
123
124 personally, I'd write the implementation in perl. and no, perl
125 isn't ugly if it's done properly. if you want some examples, I can
126 always dump them your way. my current work is a "process
127 processor", to enforce rules with consequences on the process table.
128 <url: http://www.math.uio.no/~terjekv/flapp.html > is the current
129 documentation for the main module.
130
131 > Portage in C would be brutal and even more obfuscated.
132
133 Portage in C would be _bad_, that much we can agree on. C++ would
134 be even worse. sadly enough, this is what Zynot are looking at
135 doing.
136
137 it doesn't help if you want to clean up Portage when your target is
138 C. we have almost 10K lines of python code with a lot of libraries
139 used. how many lines of code would a similar C application consist
140 of?
141
142
143
144 [1] spot the reference.
145
146 --
147 Terje
148
149 --
150 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] using Portage with other distributions. Terje Kvernes <terjekv@××××××××.no>
Re: [gentoo-dev] using Portage with other distributions. Chris Smith <chris.rs@×××××××.nz>