Gentoo Archives: gentoo-portage-dev

From: Gustavo Barbieri <barbieri@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Current portage well designed, but badly used
Date: Sun, 28 Nov 2004 17:08:39
Message-Id: 9ef20ef3041128090844573b74@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] Current portage well designed, but badly used by Michael Tindal
1 On Sat, 27 Nov 2004 17:48:54 -0600, Michael Tindal <urilith@g.o> wrote:
2 > Gustavo Barbieri wrote:
3 >
4 >
5 >
6 > >Hello,
7 > >
8 > >I'm playing with portage and noticed it's well designed, but there are
9 > >some mistakes in its usage at the moment. For example:
10 > >
11 > >Categories are mixed: there is a net-www/apache and net-www/mod_*
12 > >(apache modules), but there is a more convenient category www-apache/
13 > >for them. This is one example, there are more mistakes. There is any
14 > >plan to fix them in next portage releases?
15 > >
16 > >Some packages use numbering version padded with zero, that's good to
17 > >list with shell functions, but it's bad because you can't change them
18 > >to numbers and them back to string. For example:
19 > >mail-mta/nullmailer-1.00_rc7-r4. If you Convert it to integers, it
20 > >becomes 1.0 and you can't map back to the ebuild.
21 > >
22 > >Portage provides metadata.xml, cool. But it's hardly used :(
23 > >metadata.xml seems to provide tags for maintainers, changelogs and
24 > >long description, many (most?) packages don't use them.
25 > >
26 > >
27 > All of this you mentioned is really irrelevant to sys-apps/portage, but
28 > more relevant to the tree.
29 > The categories you mentioned are held resposible by individual
30 > maintainers, not the portage team.
31 > To see who is responsible for the category/package/ebuild, you use the
32 > metadata.xml. Packages dont
33 > need to use the metadata.xml directly because it is just that,
34 > metadata. It is used to provide the information
35 > you just stated, and it serves its purpose well.
36
37 I just think that if metadata.xml was filled with long description and
38 maintainers emails, it would help people over there. Ok, packages
39 don't need to use it directly, but tools might want to show to users
40 more info about something.
41
42 Talking about metadata, why does HOMEPAGE and DESCRIPTION are in
43 ebuilds and not in metadata.xml, IMHO they're not used to build the
44 package in any way. Maybe if we move those (always filled)
45 information to metadata.xml, people would fill other fields there.
46
47 Also, you said that this is irrelevant to the portage application, but
48 to the portage tree. Where can I talk to portage tree maintainers? If
49 I need to patch the entire portage with metadata.xml and stuff like
50 that, it will be an huge work, but if portage maintainers ask the
51 package maintainers to do it for next releases, many people would do
52 small jobs, easier than small group doing many jobs.
53
54
55 > >The portage library is too heavy, complicated and make things slow.
56 > >Heavy and complicated I noticed from (trying to) look at the source,
57 > >slow by usage. For example:
58 > >
59 > >time emerge # without parameters
60 > >real 0m0.614s
61 > >user 0m0.487s
62 > >sys 0m0.046s
63 > >
64 > >time emerge -pv world # 16 packages to be upgraded
65 > >real 0m22.664s
66 > >user 0m12.423s
67 > >sys 0m1.130s
68 > >
69 > >It's too much, look at debian apt, it's fast. And I can't see why
70 > >portage is slow.
71 > >Forgive me if I'm wrong, but portage just need to parse
72 > >/var/lib/portage/world (237 entries in my case), them for each check
73 > >if there is any other version greater than and if so check for
74 > >dependencies. Why 22seconds? A hand made take less than 1.
75 > >
76 > >
77 > >
78 > You can't compare apt to portage, dont even try to go down this route.
79 > Its like comparing apples to lemons.
80 > Portage is slow, but it is being fixed. CVS portage for one is a whole
81 > lot faster.
82
83 I'll look at CVS, but I don't see why portage need to be slow. As you
84 said, it's being fixed.
85
86 and I can't see that difference between portage and apt in the area
87 portage is slow, ok apt uses a db and don't need to check use flags,
88 but they're orders of magnitude different. Even lemons and apples are
89 that different ;)
90
91
92 > >Also, a brief explanation on why I was playing with portage and some
93 > >requests: I'm coding (for fun, no plan to get in a production state)
94 > >yet another graphical package manager atop portage with the newbie in
95 > >mind. But to achieve my goal I need:
96 > >
97 > > - a fast portage. Now I'm doing a module to do this for me (see
98 > >more above), at least the basics, like get package information,
99 > >versions, ... and if possible resolve primary dependencies (just to
100 > >show to user in a tab "Dependencies", hidden by default).
101 > >
102 > > - more meta data, if possible a list of urls to screenshots (most
103 > >packages have a screenshots section), if the url links to an html,
104 > >provide a threshold of images size to get, so it connects and
105 > >downloads every image bigger than it... cached of course.
106 > >
107 > >
108 > This is uncessary and would add extra bloat to the tree, and adds more
109 > complexity to our dev team.
110 > If you want something like this your best bet would be to provide a
111 > patch for its functionality on
112 > bugs.gentoo.org, but I wouldnt be surprised if it wasnt accepted.
113
114 I mean I want this in metadata.xml, not in ebuilds or so... how can
115 this add complexity to dev team? You mean writing the xml parser, it's
116 easy and I can send the patches. Also, I can provide tools that check
117 urls to see if they still exists, like the homepage and screenshots.
118
119
120 > > - portage to act as a daemon, queue requests and fetch packages.
121 > >If portage could be a daemon with 3 threads: one that download
122 > >packages, one that compiles and one to manage the other and accept
123 > >requests; then it could schedule download to maximize download
124 > >throughput, downloading smaller packages first while respecting
125 > >dependencies, compile while download and wait until packages are there
126 > >and the "emerge" command just send commands to it. It would be handy
127 > >since compiling times are huge.
128 > >
129 > >
130 > There is a daemonized ebuild.sh (correct me if I'm wrong ferringb) in
131 > portage CVS, although it
132 > doesnt use threads, because there is no way to kill processes (wget,
133 > etc.) spawned from within
134 > a thread, so youd have stale processes after Ctrl+C'ing portage.
135
136 Great!
137 BTW, with threads I meant the concept of more than one thing running
138 in parallel, don't need to be posix threads, can be process or even
139 one process using select()
140
141
142 > >About the fast portage: I know portage is a complex monster and is the
143 > >heart of gentoo, if it breaks, everything breaks. But how about a
144 > >python module to be used by other packages that just want to view the
145 > >portage and its packages. If eventually this module works as expected
146 > >and have every current portage feature, it could replace the old one.
147 > >
148 > >
149 > Jstubbs is working on an api that will make its way into a later
150 > revision of portage. As far as parsing
151 > ebuilds, they are sourced directly from bash.
152
153 There is any explanation/roadmap/design I can look at? Jstubbs reads
154 this list? What's his goals, how he want to achieve it?
155
156 About parsing of ebuilds, what do I need to source before the ebuild
157 itself? I mean, to get things like "inherit" working.
158
159 --
160 Gustavo Sverzut Barbieri
161 ---------------------------------------
162 Computer Engineer 2001 - UNICAMP
163 GPSL - Grupo Pro Software Livre
164 Cell..: +55 (19) 9165 8010
165 Jabber: gsbarbieri@××××××.org
166 ICQ#: 17249123
167 GPG: 0xB640E1A2 @ wwwkeys.pgp.net
168
169 --
170 gentoo-portage-dev@g.o mailing list

Replies