Gentoo Archives: gentoo-dev

From: Steven J Long <slong@××××××××××××××××××.uk>
To: gentoo-dev@l.g.o
Cc: packagekit@×××××××××××××××××.org
Subject: [gentoo-dev] Re: Re: Inviting you to project "PackageMap"
Date: Sat, 11 Jul 2009 21:41:08
Message-Id: 3637194.4P3UzGsuaa@news.friendly-coders.info
In Reply to: Re: [gentoo-dev] Re: Inviting you to project "PackageMap" by Sebastian Pipping
1 Sorry for delay in answering this one, been up to here with RL, and I didn't
2 have access to the debian and BSD bookmarks.
3
4 Sebastian Pipping wrote:
5
6 > Steven J Long wrote:
7 >> You might as well use Gentoo's version specification for your internal
8 >> format, as it's the most comprehensive. The most you need to add is
9 >> debian epochs.
10 >
11 > I'm not sure what you are referring to.
12 > Please share more details or pointers.
13 >
14 There's two aspects: the category grouping, and the version specifier.
15
16 Most distros have a flat namespace, which gets kinda hairy. One level of
17 grouping above that makes a BIG difference.
18
19 If you take a look here:
20 http://sources.gentoo.org/viewcvs.py/portage/main/trunk/pym/portage/versions.py?view=markup
21 you can see the version RE; note it can handle arbitrary levels of patch
22 (pre etc.) This is what we use in update[1] to split an arbitrary CPV:
23 CPV='^(.*-.*|virtual)/(.*)-([0-9]+)((\.[0-9]+)*)([a-z]?)((_(pre|p|beta
24 alpha|rc)[0-9]*)*)(-r([0-9.]+))?$'
25
26 (That's all one line.) If it doesn't match that, the CPV is not valid, and
27 with the one RE match, we have all the constituent parts, though we don't
28 often compare versions and handle that separately.
29
30 We've removed cvs. prefix since it's supposed to be deprecated, and added
31 the inter-rev bit for prefix portage. cvs. is still kept in our version
32 comparison code as it's a pita to rewrite, and we're waiting for some sort
33 of outcome to handling vcs builds; simply swapping two letters is clearly
34 optimal.
35
36 The "official" reasons given for deprecating cvs. were
37 1) no-one knew about it.
38 2) those who did apparently found it "hard to deal with" though one could be
39 forgiven for thinking that's due to novelty; -rNN is supposedly "hard" too.
40 3) it's vendor-specific.
41
42 We removed it for getCPV() as we call that function a *lot*; much more often
43 than verCompare() and every little bit helps. Adding it back is a doddle.
44 A prefix here is more efficient than yet another suffix.
45
46 I've yet to see an upstream version that can't be handled adequately by the
47 Gentoo versioning scheme. Granted you get the odd insane upstream; in those
48 kind of cases, I'd rather go by date (which can ofc be handled easily) or
49 svn id. A distro really should not have any need to push a version more
50 than once a day, and the distro release bit at the end allows one to deal
51 with the occasional mistake. Ultimately it's down to the maintainer, ofc,
52 but I'd question the stability of a project that releases more than once per
53 day; it does occasionally happen with bugfixes, usually with some sort of
54 patch revision.
55
56 WRT debian epochs, they're described here:
57 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
58
59 You should also take a look at how *BSD handle eg LIB_DEPENDS (the LDEPEND
60 variable I've occasionally suggested in the past):
61 http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html
62
63 I personally am not too fussed about the other *_DEPENDS mentioned therein;
64 you might want to add them for completeness.
65
66 >
67 >> XML was never meant for data-storage for such record-sets: it was
68 >> designed for data *interchange* [..]
69 >
70 > Interesting point. What would you use as an alternative that
71 > works well with a version control system?
72 >
73 Ah didn't realise you wanted to keep this all in a vcs. Personally I'd use
74 a format similar to the metadata section part of an ebuild, so simple
75 shell assignments. I wouldn't worry about whether strings are single or
76 double-quoted (or even if they're quoted at all, myself); just ban all
77 backslashes, and have some sort of script that runs to verify pre-commit.
78
79 There's no need to start going off into some nutty anxiety attack about "oh
80 but sh allows X and BASH allows Y" imo; just verify that the data lexes
81 fine: people make mistakes all the time. (It's only mildly tricky in C, so
82 should be easy enough however you implement.)
83
84 Having said that, XML is fine for microformats; Gentoo GuideXML is one of
85 the nicest applications of XML I've seen (and was a factor in us going with
86 Gentoo, believe it or not.) Nor is this a massive dataset. I just think most
87 of your users will be more comfortable.
88
89 Good luck with it, whatever format you go with.
90
91 HTH,
92 Steve.
93
94 [1] http://forums.gentoo.org/viewtopic-t-546828.html -- the version on there
95 is very much out of date (I'll get that modded soon, Naib ty for your lovely
96 comments;) so if any Gentoo-user does want to try it:
97 git clone git://weaver.gentooenterprise.com/update.git
98 Please be aware this is under AGPL3+ for non-commercial use only, so if that
99 bothers you, don't clone it. (Written with a work colleague, on work time.
100 He wasn't happy with CC-NCSA as he's committed to FSF for some reason, a
101 stance I have to say I am coming to agree with, but that's another
102 [off;]topic.)
103 --
104 #friendly-coders -- We're friendly but we're not /that/ friendly ;-)