FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 07-11-2012, 07:11 PM
William Hubbs
 
Default rfc: udev-rules.eclass

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

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.11 2012/01/07 17:53:47 mgorny Exp $

# @ECLASS: udev-rules.eclass
# @MAINTAINER:
# udev-bugs@gentoo.org
# @BLURB: helper functions to install udev rules
# @DESCRIPTION:
# This eclass provides a set of functions to install udev rules.
# With versions of udev prior to 186, udev rules for extra packages were
# installed in /lib/udev/rules.d, but with newer versions they are installed in
# /usr/lib/udev/rules.d.
# @EXAMPLE:
#
# @CODE
# inherit udev-rules
#
# src_install() {
# udev_dorules "${FILESDIR}"/foo.rules "${FILESDIR}"/bar.rules
# udev_newrules "${FILESDIR}"/old.rules.name baz.rules
# }
# @CODE

case ${EAPI:-0} in
0|1|2|3|4) ;;
*) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
esac

# @FUNCTION: _udev_get_rulesdir
# @INTERNAL
# @DESCRIPTION:
# Get unprefixed udev rules directory.
_udev_get_rulesdir() {
local dir
if has_version '<sys-fs/udev-186-r1'; then
dir=/lib/udev/rules.d
else
dir=/usr/lib/udev/rules.d
fi
echo -n $dir
}

# @FUNCTION: udev_get_rulesdir
# @DESCRIPTION:
# Output the path for the udev rules directory (not including ${D}).
udev_get_rulesdir() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
debug-print-function ${FUNCNAME} "${@}"

echo -n "${EPREFIX}$(_udev_get_rulesdir)"
}

# @FUNCTION: udev_dorules
# @USAGE: rulesfile [...]
# @DESCRIPTION:
# Install udev rule(s). Uses doins, thus it is fatal in EAPI 4
# and non-fatal in earlier EAPIs.
udev_dorules() {
debug-print-function ${FUNCNAME} "${@}"

(
insinto "$(_udev_get_rulesdir)"
doins "${@}"
)
}

# @FUNCTION: udev_newrules
# @USAGE: oldname newname
# @DESCRIPTION:
# Install udev rules file with a new name. Uses newins, thus it is fatal
# in EAPI 4 and non-fatal in earlier EAPIs.
udev_newrules() {
debug-print-function ${FUNCNAME} "${@}"

(
insinto "$(_udev_get_rulesdir)"
newins "${@}"
)
}
 
Old 07-11-2012, 07:57 PM
"W. Trevor King"
 
Default rfc: udev-rules.eclass

On Wed, Jul 11, 2012 at 02:11:42PM -0500, William Hubbs wrote:
> 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.

I do this in sci-misc/comedi-headers (wtk overlay). Actually, I had
just been installing the rules into /etc/udev/rules.d, because I
hadn't read the docs thoroughly enough. +1 for an eclass to handle
this for me .

--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
 
Old 07-11-2012, 08:57 PM
Diego Elio Pettenò
 
Default rfc: udev-rules.eclass

Il 11/07/2012 21:11, William Hubbs ha scritto:
> I am about to release udev-186-r1, which will move everything currently
> in /lib/udev to /usr/lib/udev.

Unless you're going to establish a symlink, please keep it under p.mask
until everything is using some common code — otherwise things _will_ break.

--
Diego Elio Pettenò — Flameeyes
flameeyes@flameeyes.eu — http://blog.flameeyes.eu/
 
Old 07-11-2012, 08:57 PM
William Hubbs
 
Default rfc: udev-rules.eclass

On Wed, Jul 11, 2012 at 02:11:42PM -0500, 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.

If there are no objections, I will commit this to the tree, no earlier
than 15 July UTC.

Thanks,

William
 
Old 07-11-2012, 08:59 PM
Alexis Ballier
 
Default rfc: udev-rules.eclass

On Wed, 11 Jul 2012 14:11:42 -0500
William Hubbs <williamh@gentoo.org> 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.

How do you plan to handle the following:
- foo installs an udev rule
- install foo with old udev
- upgrade udev

are rules installed by foo used by new udev ?

A.
 
Old 07-11-2012, 09:51 PM
"Rick "Zero_Chaos" Farina"
 
Default rfc: udev-rules.eclass

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/11/2012 03: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.
I have at least half a dozen ebuilds which install rules (if you include
gentoo-x86 and pentoo overlay)

I'm guessing an eclass would be a good idea.

Thanks,
Zero
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP/fVvAAoJEKXdFCfdEflKQcQP/igsYucmoFmJuozob2vFyKhw
iTs/T3zFqyJXZh4k4WygQUhbrPToNkIvs24Ic7Zb90lYDlva1W24Vj 4r+GBMOEEF
19q3wk3SDnZZI6ulLlpx6jTh4uzJeTl8jO3efOpHcnbXKjf3pJ JGldotkYmbz1pD
ALrZywqYCpDAf2ioQFKafBnpY7coe/qyzgtOScGy680V+YIFSX0mmHl0MAFJ/jyH
V4gQvzsag227FILTRdmqMm/megYFY9POplRTVPeu/1vn6oGabPk6d+OmwR+uGoYL
8EpdG1W4RMsXGYBUsbFZWPO+q/MfJaZXa5DmwHc7z/MgNIYCj3cYmX750sWBW1EJ
GclSnu0/ykJ4I3ABMXyK3d9ZEPbjXrrEY09YVTkxd3Un1zA3LEjRSP3VBu 74xvUN
oMf7MPxYuMK8ynR705j4r/WCZINKQhBRwNxUXnVrqsD0HS0qJRhZ4iYI3WzrJv7g
rGO+K8IgZLzXaWQXSocbtAlJcl1juf47O1qu2PhtNbopC+G+s1 s/A3wZwjNY3LHl
Zj3nwzsijumsKid4TvHzlGtL28yPy5fQU+hniCapFr0M9QChBh LEH4VxTGqX4MzP
YEVwBEqq/QZD9T8b0Hdw7PW8KTJCX7ttemW5x27WRHHSoYP2qwoOoycixuU NpJ0j
XLt/mIBoiAiRJUHkynN4
=1aWY
-----END PGP SIGNATURE-----
 
Old 07-11-2012, 11:42 PM
William Hubbs
 
Default rfc: udev-rules.eclass

On Wed, Jul 11, 2012 at 10:57:42PM +0200, Diego Elio Pettenò wrote:
> Il 11/07/2012 21:11, William Hubbs ha scritto:
> > I am about to release udev-186-r1, which will move everything currently
> > in /lib/udev to /usr/lib/udev.
>
> Unless you're going to establish a symlink, please keep it under p.mask
> until everything is using some common code — otherwise things _will_ break.

Since multiple packages put things in /lib/udev, I'm not sure it is
possible to establish a symlink from /lib/udev to /usr/lib/udev if
that's what you mean; I'll look into it though.

My concern about p.mask is things tend to die there. How will we know
for sure when there will not be any breakages without putting it in
~arch to see what breaks?

William
 
Old 07-11-2012, 11:43 PM
Diego Elio Pettenò
 
Default rfc: udev-rules.eclass

Tinderbox will help you there.

On Thursday, July 12, 2012, William Hubbs wrote:
On Wed, Jul 11, 2012 at 10:57:42PM +0200, Diego Elio Pettenò wrote:


> Il 11/07/2012 21:11, William Hubbs ha scritto:

> > I am about to release udev-186-r1, which will move everything currently

> > in /lib/udev to /usr/lib/udev.

>

> Unless you're going to establish a symlink, please keep it under p.mask

> until everything is using some common code — otherwise things _will_ break.



Since multiple packages put things in /lib/udev, I'm not sure it is

possible to establish a symlink from /lib/udev to /usr/lib/udev if

that's what you mean; I'll look into it though.



My concern about p.mask is things tend to die there. How will we know

for sure when there will not be any breakages without putting it in

~arch to see what breaks?



William
 
Old 07-11-2012, 11:48 PM
William Hubbs
 
Default rfc: udev-rules.eclass

On Wed, Jul 11, 2012 at 04:59:11PM -0400, Alexis Ballier wrote:
> How do you plan to handle the following:
> - foo installs an udev rule
> - install foo with old udev
> - upgrade udev
>
> are rules installed by foo used by new udev ?

No, they wouldn't be; that is a good reason to question the value of the
eclass itself. Maybe the correct way to do this is to forget the eclass
and just file bugs against packages that break having them move their
rules to the new location and set a dependency on the newer udev.

This would have to be a rev bump for the broken packages.

William

>
> A.
>
 
Old 07-12-2012, 02:25 AM
"Rick "Zero_Chaos" Farina"
 
Default rfc: udev-rules.eclass

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/11/2012 07:48 PM, William Hubbs wrote:
> On Wed, Jul 11, 2012 at 04:59:11PM -0400, Alexis Ballier wrote:
>> How do you plan to handle the following:
>> - foo installs an udev rule
>> - install foo with old udev
>> - upgrade udev
>>
>> are rules installed by foo used by new udev ?
>
> No, they wouldn't be; that is a good reason to question the value of the
> eclass itself. Maybe the correct way to do this is to forget the eclass
> and just file bugs against packages that break having them move their
> rules to the new location and set a dependency on the newer udev.
Perhaps a new ebuild helper would be best here? It seems no one knows
where to install udev rules in the first place (I know I didn't till a
recent version of portage yelled at me with a QA warning).

How about dorule/newrule?

- -Zero
>
> This would have to be a rev bump for the broken packages.
>
> William
>
>>
>> A.
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP/jWIAAoJEKXdFCfdEflKwPUP/25MRtz2WYr/ajnGIFks7Rge
KFlCkIVILejW/5Bh2Ct+OUhcIcT26lENIyRi+agXxvmI6eO5RwWFz1uqinM10dc 5
eQ2rdq+SzM5yrRDuy3aQRNSpemGPIT9Rnmz+/JwgqaeEbl5qMLglqIjZcU9sL675
bfFF0n6y2/HuSFY1kZ6elK5A4UBnM3LRVl6DYZlYPH0/KzSYo03qQlgrUKzODaZ6
C+d1Ctd1g8yCuMmrk2QvAuPO1dxNJHV6zWIQFmuVOZrDKxoQyi S73HwG53oeqwN1
Ig1tZo9X8co4gb8f6YcxxG6tAligqMXRbBCHwdZh1JEeLfAtA6 hFxmVZ4u+Ldj9W
Eco1MAGSX3qoUfoEJQeI49AcjMIkIBHR7kyvl7/IJ10xjI1QWsa9Cx2kkowaGbCw
CuNlqmMLsAyOVDXdAoW/ODC/2ntNsnigv8J5m6kJ2sUzzGVzU2q1VBxkTfLQkkD4
1H0nReTSo3ilNN9ZpsBEer+xMz1xsXssDbkQGXxRi0modKYUe2 z9JZ0bJweFDn2I
ixEooL6D67TFS3lhkScGA0S4WO1lUO+Ih1cb6SPvGOpx+R6A+o 1IYWC3utdIB1ho
mGDyK8NB9fNgP3B5PAjACWPoTSs4IMRIiLBMfCIperbPNrAFGr zwJcbLnxaNy7KY
l5ug3XKuM/B2yZdxyzSu
=8j1W
-----END PGP SIGNATURE-----
 

Thread Tools




All times are GMT. The time now is 06:52 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org