1 |
Dnia 2015-09-19, o godz. 03:50:52 |
2 |
konsolebox <konsolebox@×××××.com> napisał(a): |
3 |
|
4 |
> On Sat, Sep 19, 2015 at 2:23 AM, Michał Górny <mgorny@g.o> wrote: |
5 |
> > |
6 |
> > |
7 |
> > Dnia 18 września 2015 11:32:15 CEST, konsolebox <konsolebox@×××××.com> napisał(a): |
8 |
> >>This is what an ideal and simple versioning spec should look like to |
9 |
> >>me. (Not the form, but the concept). I'm posting this here so it |
10 |
> >>could be used as an added reference to anyone that would consider |
11 |
> >>revising the current specification. |
12 |
> > |
13 |
> > The length of this mail itself proves that this is far from simple. |
14 |
> |
15 |
> Well that was called for yet still surprising. I'm not sure how the |
16 |
> length matters. And imagine how longer it would have been if I used |
17 |
> the 7 lexical algorithms of the current spec. |
18 |
|
19 |
If you call something simple, make it simple. if it can't be |
20 |
implemented simply, it's not simple. Simple as that. |
21 |
|
22 |
> > And similarly to the current solution it's full of silly special cases and magical rules. If you really want something simple and clean, take a look at the scheme used by pkg-config and rpm. |
23 |
> |
24 |
> Silly because it uses a not-so-monolithic approach which is more |
25 |
> convenient to implement and actually works? What special cases or |
26 |
> magical rules where you could find it more complex than the current |
27 |
> spec? |
28 |
|
29 |
It's silly because it shifts the existing terrible structure a bit |
30 |
and doesn't really solve most of its issues. It's silly because you |
31 |
still have a fair number of limitations which make parsing harder |
32 |
rather than easier. It's silly because you still have to remember |
33 |
the relation between 'alpha', 'beta', 'rc' and 'pre'. It's silly |
34 |
because those magical suffixes never match what upstreams use. |
35 |
And those are just a few sillinesses. |
36 |
|
37 |
> It's all about converting version strings to numerical values |
38 |
> and comparing them from left to right. And the idea on how things are |
39 |
> mapped is just a model and doesn't necessarily need to be followed |
40 |
> when making an implementation. If you don't want to allow "version |
41 |
> nodes" and only allow a single letter after the last version number of |
42 |
> the base part, then you could do it. How you convert 4a to a form you |
43 |
> could use for comparison is up to you - maybe just a struct with two |
44 |
> integral fields would suffice. But the idea of (1) using four |
45 |
> sections: base, stage, patch and revision, (2) converting each |
46 |
> sections to arrays or lists of integral numbers or finite-sized data |
47 |
> forms usable for comparisons, and (3) comparing them simply from left |
48 |
> to right, is there. |
49 |
|
50 |
I don't really understand what this paragraph was supposed to mean. Are |
51 |
you saying that your spec is fun because it's fun? |
52 |
|
53 |
> To add: comparing version strings in converted numerical forms is |
54 |
> friendly to the processor. You can also cache converted forms if you |
55 |
> want. On the other hand using a train of lexical algorithms that |
56 |
> parses and compares strings at the same time is painful to implement |
57 |
> and yields mixed-up code. Separating parsing from comparing is |
58 |
> convenient. |
59 |
> |
60 |
> And about pkg-config and rpm: I haven't thoroughly examined them yet, |
61 |
> but you sure their implementation is applicable to Gentoo? It might |
62 |
> just turn simpler because it's more limited or strict. Gentoo allows |
63 |
> stages, patches and revisions and uses predefined prefixes. Mine |
64 |
> starts on a flexible approach where "version nodes" are allowed |
65 |
> everywhere. |
66 |
|
67 |
Then you should have. It is appreciated when people do some *research* |
68 |
before throwing out random ideas on areas they have almost no idea of. |
69 |
|
70 |
And to save you some time reading: the rpm implementation is simpler |
71 |
and more flexible. It's free of stupidities like hardcoded suffix |
72 |
lists or forced component ordering. Ordering (pre/post) is expressed |
73 |
explicitly, and in many more cases you can avoid writing something |
74 |
completely different than what upstream uses. |
75 |
|
76 |
> If perhaps you mean to completely overhaul Gentoo's way of |
77 |
> implementing package versions, I don't think that would work. |
78 |
|
79 |
And is your change going to work? Because if you understood how ebuilds |
80 |
work, you'd know you practically can't change versioning because you'd |
81 |
immediately break compatibility between 'old' and 'new' ebuilds. This |
82 |
isn't something that was designed to support changes in version scheme, |
83 |
and changing that won't be anywhere close to easy. And if we ever agree |
84 |
on doing that, we should go for a complete and useful solution rather |
85 |
than some minor change with even smaller benefit. |
86 |
|
87 |
> Just to remind you I'm presenting the idea, not the draft nor the |
88 |
> implementation itself. So don't pay too much attention on how it's |
89 |
> made. I think I should have given it a more abstract form, but this |
90 |
> is just the first post. I also hope you can give more specific or |
91 |
> more elaborated criticizations about it, or perhaps give ideas on how |
92 |
> it should be better implemented. |
93 |
|
94 |
Also, you seem to have accidentally removed the mailing list from |
95 |
To/CC. |
96 |
|
97 |
-- |
98 |
Best regards, |
99 |
Michał Górny |
100 |
<http://dev.gentoo.org/~mgorny/> |