From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1M6Ua4-0005YC-1A for garchives@archives.gentoo.org; Tue, 19 May 2009 19:02:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E4C7E0462; Tue, 19 May 2009 19:01:52 +0000 (UTC) Received: from mail-fx0-f219.google.com (mail-fx0-f219.google.com [209.85.220.219]) by pigeon.gentoo.org (Postfix) with ESMTP id 1A883E0462 for ; Tue, 19 May 2009 19:01:52 +0000 (UTC) Received: by fxm19 with SMTP id 19so3832214fxm.34 for ; Tue, 19 May 2009 12:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=nAR8+X0HEAW090x/KXyfeSeMihiaO3IjZpEy0A5Z/jw=; b=WQZpaYt5SJdAwg0DsQmQ9lD2h3N7qEWGJ7TOKXyYqRtVx9PKxytBBXj8oUBcJflLE0 aVrSLxHrvUACHZUmAy5ZZbgM5Bn86WkazqJ9kOeHqb/wja5P2DO9zMgu30iAwEA6Z1Zh WqvxwxwG/xKZZpfArg3fvHFvYkH1N8QDcCsTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=i5+rqvAFNbcKgBmeYUILinvwyj2twtwgPVcMwYfkF9U53xe7+XHUccyP1wh444oKkU MDQn2ZSf6wUWJu+JMIOhgZBqHJiQe8/2BaYdEfB6AdxLeueVW9AkIBjgQSCxBNAWkbsD pVwHH/IOMEhTM6oeIb/+Uwqer/VsKNljRVrY4= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Received: by 10.239.148.82 with SMTP id e18mr29700hbb.13.1242759711492; Tue, 19 May 2009 12:01:51 -0700 (PDT) In-Reply-To: <18962.58841.849848.476586@a1ihome1.kph.uni-mainz.de> References: <18960.39345.978610.837853@a1ihome1.kph.uni-mainz.de> <20090518001618.02998a81@snowmobile> <18960.40466.923843.233294@a1ihome1.kph.uni-mainz.de> <20090518003340.4a186623@snowmobile> <18960.41263.854038.675219@a1ihome1.kph.uni-mainz.de> <20090518004942.0571d4c3@snowmobile> <18960.60216.54583.466848@a1ihome1.kph.uni-mainz.de> <20090518151332.22798476@snowmobile> <18962.58841.849848.476586@a1ihome1.kph.uni-mainz.de> Date: Wed, 20 May 2009 07:01:51 +1200 Message-ID: <8cd1ed20905191201u3efe7117t6fa92303b2038f22@mail.gmail.com> Subject: Re: [gentoo-dev] GLEP 54 and hyphens in PV From: Kent Fredric To: gentoo-dev@lists.gentoo.org Content-Type: multipart/alternative; boundary=001485f5cef0250c11046a488bdf X-Archives-Salt: fddea4e3-13f2-4d7e-bf2f-113c9e4d73f1 X-Archives-Hash: 2333cc00549ec09c6ca532ca804fd3f8 --001485f5cef0250c11046a488bdf Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, May 20, 2009 at 5:01 AM, Ulrich Mueller wrote: > > > ${PORTDIR}/app-misc/foo/foo-1a_live.ebuild > ${PORTDIR}/app-misc/foo-1a/foo-1a-live.ebuild > > With our current versioning scheme the rule is very simple: ${P} is > split into ${PN} and ${PV} at the last hyphen. This can be done in a > straight forward way by regexp matching, and I would really hate to > lose this nice property. > > Ulrich > > $str="app-misc/foo/foo-1a_live.ebuild"; $str =~ /([^/]+)/([^/]+)/\2(.*).ebuild/ ( $category, $package, $version ) = ( $1, $2, $3 ) Simple enough on a supporting language. Naive maybe, but has worked well for me thus far. It appears to be more a problem disambiguating from the user-input end of the spectrum, and this scenario would be more likely to happen if for some insane crack-fueled reason both packages were to exist. Even then, app-misc/foo-1a # must always resolve to "app-misc/foo-1a" due to no = stating that it needs a version part =app-misc/foo-1a # must always resolve to "app-misc/foo" due to the = stating a mandatory version part. ( =cat/pack is invalid ) -- Kent --001485f5cef0250c11046a488bdf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


$str=3D"app-misc/foo/foo-1a_live.ebu= ild";
$str =3D~ /([^/]+)/([^/]+)/\2(.*).ebuild/
( $category, $p= ackage, $version ) =3D ( $1, $2, $3 )

Simple enough on= a supporting language. Naive maybe, but has worked well for me thus far. <= br>
It appears to be more a problem disambiguating from the user-input end = of the spectrum, and this scenario would be more likely to happen if for so= me insane crack-fueled reason both packages were to exist. Even then,

app-misc/foo-1a=A0 # must always resolve to "app-misc/foo-1a"= due to no =3D stating that it needs a version part
=3Dapp-misc/foo-1a = # must always resolve to "app-misc/foo" due to the =3D stating a = mandatory version part.=A0 ( =3Dcat/pack is invalid )

--
Kent

--001485f5cef0250c11046a488bdf--