Gentoo Archives: gentoo-dev

From: Kent Fredric <kentfredric@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] GLEP 54 and hyphens in PV
Date: Tue, 19 May 2009 19:02:28
Message-Id: 8cd1ed20905191201u3efe7117t6fa92303b2038f22@mail.gmail.com
In Reply to: Re: [gentoo-dev] GLEP 54 and hyphens in PV by Ulrich Mueller
1 On Wed, May 20, 2009 at 5:01 AM, Ulrich Mueller <ulm@g.o> wrote:
2
3 >
4 >
5 > ${PORTDIR}/app-misc/foo/foo-1a_live.ebuild
6 > ${PORTDIR}/app-misc/foo-1a/foo-1a-live.ebuild
7 >
8 > With our current versioning scheme the rule is very simple: ${P} is
9 > split into ${PN} and ${PV} at the last hyphen. This can be done in a
10 > straight forward way by regexp matching, and I would really hate to
11 > lose this nice property.
12 >
13 > Ulrich
14 >
15 >
16
17 $str="app-misc/foo/foo-1a_live.ebuild";
18 $str =~ /([^/]+)/([^/]+)/\2(.*).ebuild/
19 ( $category, $package, $version ) = ( $1, $2, $3 )
20
21 Simple enough on a supporting language. Naive maybe, but has worked well for
22 me thus far.
23
24 It appears to be more a problem disambiguating from the user-input end of
25 the spectrum, and this scenario would be more likely to happen if for some
26 insane crack-fueled reason both packages were to exist. Even then,
27
28 app-misc/foo-1a # must always resolve to "app-misc/foo-1a" due to no =
29 stating that it needs a version part
30 =app-misc/foo-1a # must always resolve to "app-misc/foo" due to the =
31 stating a mandatory version part. ( =cat/pack is invalid )
32
33 --
34 Kent