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.77) (envelope-from ) id 1SpQd6-0006z2-VK for garchives@archives.gentoo.org; Thu, 12 Jul 2012 21:08:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BE27BE075F; Thu, 12 Jul 2012 21:08:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E9247E0747 for ; Thu, 12 Jul 2012 21:07:53 +0000 (UTC) Received: from [10.186.31.9] (212-226-58-200-nat.elisa-mobile.fi [212.226.58.200]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ssuominen) by smtp.gentoo.org (Postfix) with ESMTPSA id BAC991B400B; Thu, 12 Jul 2012 21:07:52 +0000 (UTC) Message-ID: <4FFF3B2E.5010608@gentoo.org> Date: Fri, 13 Jul 2012 00:01:34 +0300 From: Samuli Suominen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120706 Thunderbird/13.0 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 To: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= CC: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] rfc: udev-rules.eclass References: <20120711191142.GA26844@linux1> <4FFF2C65.3080200@gentoo.org> <20120712230405.18386d47@pomiocik.lan> In-Reply-To: <20120712230405.18386d47@pomiocik.lan> Content-Type: multipart/mixed; boundary="------------030203090805010103050305" X-Archives-Salt: 420e2111-f5d3-43ec-ba2f-e344dde17df6 X-Archives-Hash: 88827cbef3d00e5a885a9edd4fa795d8 This is a multi-part message in MIME format. --------------030203090805010103050305 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 07/13/2012 12:04 AM, Micha=C5=82 G=C3=B3rny wrote: > On Thu, 12 Jul 2012 22:58:29 +0300 > Samuli Suominen wrote: > >> On 07/11/2012 10:11 PM, William Hubbs wrote: >>> All, >>> I am about to release udev-186-r1, which will move everything >>> currently in /lib/udev to /usr/lib/udev. >>> >>> For packages that install udev rules in ${FILESDIR}, we need an >>> eclass that tests the version of udev installed on the user's >>> system and installs the udev rules in the proper place. I'm not >>> sure how many packages do this, so if it is a very small number of >>> packages, it may not be worth the eclass. It would be good to >>> discuss that as well as reviewing the proposed eclass. >>> >>> Thanks, >>> >>> William >>> >> >> Please don't hardcode the path like this, use pkg-config instead: >> >> inherit toolchain-funcs >> >> dir=3D"$($(tc-getPKG_CONFIG) --variable=3Dudevdir udev)/rules.d" > > Don't forget to add udev to DEPEND of every package using the eclass > then. Oh wait... > Obviously the pkg-config should be only the primary method and there=20 should be a fallback, like what has already been posted. See attachment. --------------030203090805010103050305 Content-Type: text/x-patch; name="udev-rules.eclass.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="udev-rules.eclass.patch" --- udev-rules.eclass.orig 2012-07-12 23:59:40.465838370 +0300 +++ udev-rules.eclass 2012-07-13 00:01:12.921831177 +0300 @@ -22,6 +22,8 @@ # } # @CODE +inherit toolchain-funcs + case ${EAPI:-0} in 0|1|2|3|4) ;; *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established." @@ -33,10 +35,14 @@ # Get unprefixed udev rules directory. _udev_get_rulesdir() { local dir - if has_version '