1 |
Marius Mauch wrote: |
2 |
|
3 |
> On Sun, 21 Oct 2007 23:13:58 +0100 |
4 |
> Steve Long <slong@××××××××××××××××××.uk> wrote: |
5 |
>> Well the line from portage_versions.py is: |
6 |
>> ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre| |
7 |
>> p|beta |
8 |
>> alpha|rc)\\d*)*)(-r(\\d+))?$") |
9 |
>> - which means that a version begins with either a digit or cvs |
10 |
>> followed by digit. |
11 |
> |
12 |
> Not precisely: a digit, or "cvs" followed by a dot and a digit (you got |
13 |
> it right in the following, but not in the code posted earlier) |
14 |
> |
15 |
Bleh, thanks: code review FTW! Sleep-loss er FTL :p |
16 |
|
17 |
>> We represented this in bash (for verCompare) as: |
18 |
>> ver='^(cvs\.)?([0-9]+)((\.[0-9]+)*)([a-z]?)((_(pre|p|beta|alpha|rc) |
19 |
>> [0-9]*)* (-r([0-9]+))?$' |
20 |
>> |
21 |
>> I think we can use: |
22 |
>> CPV='^(.*-.*)/(.*)-(cvs\.)?([0-9]+)((\.[0-9]+)*)([a-z]?)((_(pre|p|beta |
23 |
>> alpha|rc)[0-9]*)*)(-r([0-9.]+))?$' |
24 |
> |
25 |
> Well, categories don't necessarily have to contain a dash (though all |
26 |
> official ones do currently). |
27 |
> |
28 |
Ah OK, excellent! |
29 |
^(([[:alpha:]]+-[[:alpha:]]+)|virtual)/.. and |
30 |
^([[:alpha:]]+(-[[:alpha:]]+)?)/.. (if other single-terms are to be allowed) |
31 |
- would add one to every subsequent term index (for the general case, not |
32 |
when globbing the tree.) |
33 |
|
34 |
If we can correctly reduce this to a single regex match, it'll make my life |
35 |
a lot easier :) |
36 |
|
37 |
(For update there's no need to check the category exists, since the strings |
38 |
are taken from portage output, but such a check could be performed after |
39 |
the match.) |
40 |
|
41 |
|
42 |
-- |
43 |
gentoo-dev@g.o mailing list |