1 |
On Sun, 28 Nov 2004 15:22:44 -0200, Gustavo Barbieri <barbieri@×××××.com> wrote: |
2 |
> On Sun, 28 Nov 2004 05:44:50 +0000 (GMT), Ed Grimm |
3 |
> <paranoid@××××××××××××××××××××××.org> wrote: |
4 |
> > On Sat, 27 Nov 2004, Gustavo Barbieri wrote: |
5 |
> > > Some packages use numbering version padded with zero, that's good to |
6 |
> > > list with shell functions, but it's bad because you can't change them |
7 |
> > > to numbers and them back to string. For example: |
8 |
> > > mail-mta/nullmailer-1.00_rc7-r4. If you Convert it to integers, it |
9 |
> > > becomes 1.0 and you can't map back to the ebuild. |
10 |
> > |
11 |
> > It's worse than that. They're not always integers. It's safest to |
12 |
> > treat version numbers as strings as much as possible; when one needs to |
13 |
> > break them into integer portions, do this for comparison only, and save |
14 |
> > the original. Finally, a number of packages would require that you |
15 |
> > provide a mechanism for determining all version numbers that aren't |
16 |
> > strictly numeric. Openssl, with its \d+.\d+.\d+[a-z] versions is easy. |
17 |
> > hddtemp, with its alpha/beta tags, is doable but tedious. |
18 |
> |
19 |
> I did a PackageVersion class that parses these sections using a |
20 |
> regular expression following the package naming policy. I don't send |
21 |
> the code since I'll need to recode it, my XFS lost many data after a |
22 |
> power failure :( But I have the bytecode if you want to test it or |
23 |
> help me to get the .py back. |
24 |
|
25 |
Okay, I hacked a free version of decompyle from BSD to support python |
26 |
2.3 bytecode and recovered my file. |
27 |
|
28 |
If you want to check it out: |
29 |
http://ltc08.ic.unicamp.br/~gustavo/packagemanager.tar.bz2, the file |
30 |
of interest is lib/packagemanager/packagemanagementsystem.py, there |
31 |
are some classes, he PackageVersion is of interest, please look at it. |
32 |
(if you don't want to get the package: |
33 |
http://ltc08.ic.unicamp.br/~gustavo/packagemanagementsystem.py) |
34 |
|
35 |
|
36 |
-- |
37 |
Gustavo Sverzut Barbieri |
38 |
--------------------------------------- |
39 |
Computer Engineer 2001 - UNICAMP |
40 |
GPSL - Grupo Pro Software Livre |
41 |
Cell..: +55 (19) 9165 8010 |
42 |
Jabber: gsbarbieri@××××××.org |
43 |
ICQ#: 17249123 |
44 |
GPG: 0xB640E1A2 @ wwwkeys.pgp.net |
45 |
|
46 |
-- |
47 |
gentoo-portage-dev@g.o mailing list |