Gentoo Archives: gentoo-guis

From: "René 'Necoro' Neumann" <lists@××××××.eu>
To: ciaran.mccreesh@××××××××××.com
Cc: gentoo-guis@l.g.o
Subject: Re: [gentoo-guis] Why I don't like catapult
Date: Sun, 30 Mar 2008 17:30:36
Message-Id: 47EFCE30.8030800@necoro.eu
In Reply to: [gentoo-guis] Why I don't like catapult by Ciaran McCreesh
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 My replies ;)
5
6 One important remark: I always see the things from the API-user view. I
7 have to use this API in a package manager GUI and thus want to have the
8 API to specify certain functionality.
9
10 Ciaran McCreesh schrieb:
11 > * use of cpv throughout. cpv isn't enough to uniquely identify an ID,
12 > especially if there're overlays. cpvr is closer, but still doesn't
13 > work if you need to deal with virtuals directly (rather than the thing
14 > provided by the virtual)
15
16 CPVR sounds reasonable ... and what about using virtual/* for virtuals?
17 Btw: There was the idea of providing a "get_virtuals" function....
18
19 > * use of regexes throughout. Every language defines its own, different
20 > regex dialect. There's no portability between languages.
21
22 True - I thought of using some kind of globbing - thus only allowing "*"
23 and "?" (and perhaps "^" and "$")
24
25 > * No mention of EAPI anywhere.
26
27 Why would this be needed? This is only true if "catapult API" == "EAPI".
28
29 > * No mention of error handling anywhere.
30
31 True. Currently exceptions are only passed to the caller - but this
32 should definitly be specified somewhere.
33
34 > * Generally lots of hard-coded ebuildy things that don't map well onto
35 > future EAPIs or handling of non-ebuilds (e.g. native CRAN support).
36
37 For me - gentoo package management is all about ebuilds. So I can't see,
38 what should changed there.
39 The only thing that should be provided is a feature similar to EAPI (the
40 "catapult API"), so that additional stuff can be specified later on. I
41 don't see a point in thinking about things, that may come somewhere in
42 the future.
43
44 > * It's tied onto a single user configuration setup, and has no sane way
45 > of handling multiple configurations or unconfigured operation.
46
47 I don't understand this ...
48
49 > * sets don't map on to package manager sets.
50
51 This can easily be changed. But nevertheless, some catapult-wide sets
52 should be defined, that map onto the specific ones in the package
53 managers (e.g. catapult.SET_ALL should be replaced by the specific set
54 in the different managers)
55
56 > * Administration:
57 >
58 > - version. But no name?
59
60 I saw this myself some days ago... Really a flaw - but one simple to fix ;)
61
62 > - find_best. What does this do if you give it foo/bar-1 foo/baz-1?
63 Undefined atm.
64 > What's the point of having this function at all?
65 See very first remark.
66
67 > - find_best_match. What's a search key? If it's a spec, it needs an
68 > associated EAPI.
69 True.
70 > What if only_installed is false? Does this mean we
71 > want both not installed and installed stuff?
72 Yes. - But perhaps, instead of the "only_installed" flag used here and
73 there, a set-name should be provided. (Which then can be "installed",
74 "uninstalled" or whatever).
75
76 > - find_packages. As find_best_match for search key. What disambiguation
77 > is performed upon the atom? What happens if you pass it something like
78 > 'git', which is ambiguous?
79 Return everything that fits. It should be on the users side to translate
80 it into something useful.
81
82 > - get_config_path. Unportable. What if the user is using some other
83 > config format?
84 But the configs (read: package.mask, package.use etc.) have to be at a
85 specified unique location, don't they?
86
87 > - get_deep_option. Deep's a mess; making package managers emulate it via
88 > a command line switch is silly.
89 If you don't have an equivalent: Return "".
90
91 > - get_environment. In no way portable.
92 True. Should be dropped. I used it to get unwanted things out of the
93 environment. (E.g. modify EMERGE_DEFAULT_OPTS). But this is really a
94 user thing and should not be here.
95
96 > - get_global_key. Again, unportable -- Paludis has no notion of global
97 > configuration.
98 get_global_settings and get_package_settings should be merged anyway.
99
100
101 > - get_merge_command. There's no nice way of using whatever this returns.
102 > And it's pointless -- why not just ask the package manager to do the
103 > merge?
104 Because catapult should be passive: I.E. only provide information and
105 does not do anything that could be harmful.
106
107 > And what about package managers that require an explicit
108 > --install?
109 Return: ["pkgmgr", "--install"]. Everything that has "get_xxx_command"
110 should return the complete commandline.
111
112 > - get_newuse_option. Again, unportable and messy.
113 >
114 > - get_oneshot_option. Again, unportable and messy.
115 Why unportable? - See the remarks to "--deep".
116
117 > - get_pretend_option. Again, unportable and messy. And probably useless
118 > -- what would you do with this?
119 True.
120
121 > - get_updated_packages. Highly unclear what this really does.
122 Returns a list of packages, that can be updated. Similar to what
123 "eix-sync" shows at the end of the run.
124
125 > - get_world_file_path. Unportable.
126 True.
127
128 > - list_categories. String or regex?
129 Has to be defined.
130
131 > - sort_package_list. You don't want stuff sorted the way it's sorted by
132 > Paludis. You might want a well defined sort.
133 True.
134
135 > - split_cpv. Why the weird revision thing?
136 What's so weired about it?
137
138 > - update_world. Huh? In some ways pointlessly specific, in some ways way
139 > too vague. And what's this use flag stuff? We finally just about got
140 > people away from setting use flags in places other than config files,
141 > and for good reason.
142 Rember: Passive. It should return the packages, that WOULD be updated,
143 if a world-update (or alike) would be run. The parameters are there, to
144 run different scenarios. (Portato for example uses this, to generate the
145 list - taking into account the user saved flags, which aren't saved to
146 configs yet.)
147
148 > - What do all of these do on unknown EAPI?
149 Again: Why does the API have to care about EAPI? - It's the providers
150 job to care about it.
151
152 > - compare_version. But it takes packages. What's the ordering on
153 > foo/bar-1 vs bar/baz-1?
154 Currently it would return: ("bar-1", "baz-1") as bar < baz. But this can
155 easily specified different. And a good point to think about error
156 handling again.
157
158 > - get_actual_use_flags. What's the point of this?
159 In general: Returns all useflags currently set (even the package
160 specific ones). It additionally has the ability to merge in some other
161 flag settings. (Ok - the description in the API-document is a little bit
162 ... strange).
163
164 > - get_dep_packages. Hardcoding three dep classes is icky and doesn't
165 > work nicely with future EAPIs.
166 Is only hard-coded in the document. (Count this as a doc-error.)
167
168 > And what's the return value? What about when || is in operation?
169 WWPMD (what would the package manager do): Simplified: Pass the
170 dep-string to the package manager and see what he does with it. The
171 result is returned.
172
173 > - get_iuse_flags. What does this do for IUSE defaults? For installed
174 > packages, all flags are forced.
175 defaults are returned verbatim. I used to define "forced flags" as: "The
176 flags the user can't change." (like userland_GNU or use.mask'ed flags)
177
178 > - get_installed_use_flags. Empty list? Seriously?
179 DBus does not know the "empty value". The signature has to be kept in
180 all cases. So: yes - empty list. (Other choice would be an exception...)
181
182 > - get_masking_reason. Is the return value supposed to be used by
183 > anything other than a human?
184 I doubt it.
185
186 > - get_matched_dep_packages. Huh?
187 Return all packages the cpv depends on, but which are already installed.
188 "get_dep_packages" and "get_matched_dep_packages" can surely be merged.
189
190 > - get_overlay_path. What if it's in an overlay with no on-disk location?
191 > What if it's in some format the end tool doesn't recognise?
192 The end tool's problem I'd say.
193
194 > - get_use_flags. Bad. No legit use.
195 Doc error. Has already been removed several weeks ago.
196
197 > - is_in_system. System is a bad name.
198 Renaming is easy :)
199
200 > - is_testing. How does package.keywords alter whether a package is
201 > testing?
202 Just a naming issue - I use "testing" for things that are keyworded
203 "~KEYWORD".
204
205 > - use_expanded. Not clear how this works when things aren't really
206 > expanded.
207 Return "". The naming is bad here too.
208
209 > or when expanded keys aren't known.
210 When should that happen?
211
212 >
213 > Why DBus?
214 > ---------
215 >
216 > What's the point in using DBus? What does it add over a simplified
217 > library with bindings?
218
219 Library bindings have several disadvantages:
220 - - Providers have to be coded in C.
221 - - How to access portage internals from C-Code? Yes: You can implement
222 python-calls in C... but I think this is messy.
223
224 Dbus advantages:
225 - - allows some interesting structures: Like dbus+ssh: Contact the
226 Catapult-Service on one machine from another one (remote adminstration)
227 - - bindings already provided
228 - - caching: For example the portage internal caches are kept and don't
229 have to be recreated each time something using catapult is started.
230
231 > How does the whole privs thing work? Should anyone who can talk by DBus
232 > be allowed to perform privileged operations? Should anyone who can't
233 > perform privileged operations be allowed to do unprivileged operations?
234 I thought of having Catapult being a passive thing. So there is no way
235 of doing privileged actions.
236
237 > What about persistence? What's classed as a session? Why force it down
238 > to a single session at once?
239 Easier to implement. But it isn't forced. If the provider implements
240 sessions (e.g. using the Dbus-sending-adress as a key) w/o extending
241 API, I can't see a problem.
242
243 Regards,
244 Necoro
245 -----BEGIN PGP SIGNATURE-----
246 Version: GnuPG v2.0.7 (GNU/Linux)
247 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
248
249 iD4DBQFH784w4UOg/zhYFuARAnZRAJ4hnjiH/2yycAiDCXLnst2EpesyuQCWJNNs
250 6gPL9qWeiaFgCGzpwbT9cA==
251 =Pdi+
252 -----END PGP SIGNATURE-----
253 --
254 gentoo-guis@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-guis] Why I don't like catapult Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>