1 |
On Sun, Sep 20, 2015 at 4:47 PM, Michał Górny <mgorny@g.o> wrote: |
2 |
>> >>So what would pkg-1.4_alpha1_p20 look like if you convert it to a form |
3 |
>> >>that uses ~? |
4 |
>> > |
5 |
>> > You shouldn't start with old gentoo version but with whatever upstream uses. The goal is that the scheme is really upstream friendly. |
6 |
>> > |
7 |
>> > So Python-3.5.0a2 would be 3.5.0~a2. We just add the tilde to indicate it's alpha-a and not post-version a. |
8 |
>> |
9 |
>> > Then, instead of full alpha/beta substitution we just strip the tilde. |
10 |
>> |
11 |
>> Strip the tilde? |
12 |
> |
13 |
> SRC_URI=".../Python-${PV/~/}.tar.xz" |
14 |
|
15 |
Ok, although a version where the appended letter on the end of it does |
16 |
not always imply alpha, so it doesn't always occur on most packages. |
17 |
|
18 |
>> > So in your case, it could be 1.4~alpha1_p20, or 1.4~a1_20, or… |
19 |
>> |
20 |
>> Or just like my idea of using multiple nodes which is 1.4~a1.20? |
21 |
>> Although I don't agree about concatenating the patch (_p) or another |
22 |
>> custom suffix's value against the preceding suffix - because the |
23 |
>> preceding suffix could actually have a dotted value in _alpha in which |
24 |
>> case comparing the minor numbers would be ambiguous. |
25 |
>> |
26 |
>> >>Also what about if the package has a custom "newer than no suffix" |
27 |
>> >>suffix used like pkg-1.4-sr5-p20? |
28 |
>> > |
29 |
>> > Well, sr would be used as letter version component but it shouldn't hurt. |
30 |
>> |
31 |
>> So we add `sr` as a known suffix, what about other possible suffixes? |
32 |
> |
33 |
> No, we don't. There are *no* known magical suffixes. 'sr' is just |
34 |
> text version part, like 'a', 'b', 'c', 'za'... |
35 |
|
36 |
So you get its value for comparison by base 26, base 27 or |
37 |
lexicographic order level? |
38 |
|
39 |
>> The point is, how would you compare custom suffixes when you don't |
40 |
>> apply definite levels to them? Which one would come before or after |
41 |
>> another? And comparing lexicographically does not always apply. Would |
42 |
>> everyone have to convert them to presentable values where you could |
43 |
>> calculate a number or compare in lexicographical order? |
44 |
> |
45 |
> You can't solve every single problem. Instead, you can apply simple |
46 |
> and generic rules that could work in majority of cases, and be clearly |
47 |
> changed in the remaining cases. |
48 |
|
49 |
Well that would sound like your solution doesn't solve anything at |
50 |
all. You just added another version space where you can add |
51 |
translated values of custom suffixes. Forcing people to use |
52 |
translated values even makes package versions less descriptive. |
53 |
That's what's worth to be called as hard-coding. |
54 |
|
55 |
>> > We could even extend this to allow multiple tildes and add another symbol that evaluates as higher than any version component. |
56 |
>> |
57 |
>> Yes, like adding _post? |
58 |
> |
59 |
> No, 'post' is string which again imposes limitation on upstream naming |
60 |
> of versions. Use symbols as separators are symbols already. |
61 |
> |
62 |
>> This really sounds like it can be solved by allowing multiple version |
63 |
>> nodes on _pre and _post just like what I said earlier. |
64 |
>> |
65 |
>> If you want you can have symbol versions of those but it would not be |
66 |
>> necessary to actually remove the existing suffixes. |
67 |
> |
68 |
> You really can't think flexibly, can you? You always try to hardcode |
69 |
> some strings, some arbitrary limitations because someone happened to |
70 |
> implement Portage like this without too much thinking years ago. |
71 |
|
72 |
I'm pretty sure I'm thinking flexible enough - as I also consider |
73 |
compatibility despite also considering the use of symbols. Maybe you |
74 |
should ask yourself that instead? Your method of doing things |
75 |
generically would not apply if you can't have an algorithm that can |
76 |
compare suffixes on their original form generically. And so you also |
77 |
cannot say that there is a difference between using a string or using |
78 |
symbol if you can't place suffixes on them on their original form but |
79 |
on their translated ones instead. |