Re: /etc/udev/rules.d non-symlinks
Marco d'Itri wrote: > It's OK, I planned to discuss this after the release. > Experience showed that generally other packages do not need an easy way > to disable their whole rules files, so I think we can conclude that > usage of symlinks can be restricted to some of udev's own files and > eventually packages with special needs. > Do we need special code to move the conffiles on upgrades (and only do > that if the symlink does not exist)? Code such as the following is needed to deal with moving the conffile and replacing the symlink with the conffile: preinst: if [ "$1" = install ] || [ "$1" = upgrade ]; then if [ -e /etc/udev/#FILE# ]; then if [ "`md5sum \"/etc/udev/#FILE#\" | sed -e \"s/ .*//\"`" = \ "`sed -n -e \"/^Conffiles:/,/^[^ ]/{' /etc/udev/#FILE#'{s/.* //;p}}\" /var/lib/dpkg/status`" ] then rm -f /etc/udev/#FILE# fi fi if [ -L /etc/udev/rules.d/#PRIO##FILE# ]; then rm -f /etc/udev/rules.d/#PRIO##FILE# fi fi postinst: if [ "$1" = configure ]; then if [ -e /etc/udev/#FILE# ]; then echo "Preserving user changes to /etc/udev/rules.d/#PRIO##FILE# ..." if [ -e /etc/udev/rules.d/#PRIO##FILE# ]; then mv -f /etc/udev/rules.d/#PRIO##FILE# /etc/udev/rules.d/#PRIO##FILE#.dpkg-new fi mv -f /etc/udev/#FILE# /etc/udev/rules.d/#PRIO##FILE# fi fi -- see shy jo signature.asc Description: Digital signature
Re: /etc/udev/rules.d non-symlinks
On Tue, Apr 10, 2007 at 12:11:57PM +0200, Loïc Minier <[EMAIL PROTECTED]> was heard to say: > On Mon, Apr 09, 2007, Joey Hess wrote: > > The intent is to let users disable a udev rule by removing the symlink, or > > reorder a rule to a different number by renaming the symlink. Putting a > > rules > > conffile directly in /etc/udev/rules.d/ wouldn't allow for this, and as > > Marco > > says in #359614, this "may be useful. Or at least appeared to be useful when > > I designed this." My question is simply whether anyone actually finds this > > useful? > > Can we encode the number in the rule itself? Perhaps in the comments > at the top of the file. >This would allow dpkg to handle numbering changes correctly. You could look at how file-rc handles a similar problem -- IIRC it replace update-init.d with a script that edits a file in /etc. Daniel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: /etc/udev/rules.d non-symlinks
On Apr 09, Joey Hess <[EMAIL PROTECTED]> wrote: > I'm proposing that we change our de-facto policy for handling of files > in /etc/udev/rules.d. Currently it is this (from udev's README.Debian): It's OK, I planned to discuss this after the release. Experience showed that generally other packages do not need an easy way to disable their whole rules files, so I think we can conclude that usage of symlinks can be restricted to some of udev's own files and eventually packages with special needs. Do we need special code to move the conffiles on upgrades (and only do that if the symlink does not exist)? At the same time it would be a good idea to change the XXX_ file name scheme to a saner one, since currently they all share 0??_ or z??_ prefixes to coexsist with the existing prefix-less files. Probably we should just copy the scheme used by Ubuntu, but I am not sure if there is a good way to do it. -- ciao, Marco signature.asc Description: Digital signature
Re: /etc/udev/rules.d non-symlinks
On Mon, Apr 09, 2007, Joey Hess wrote: > The intent is to let users disable a udev rule by removing the symlink, or > reorder a rule to a different number by renaming the symlink. Putting a rules > conffile directly in /etc/udev/rules.d/ wouldn't allow for this, and as Marco > says in #359614, this "may be useful. Or at least appeared to be useful when > I designed this." My question is simply whether anyone actually finds this > useful? Can we encode the number in the rule itself? Perhaps in the comments at the top of the file. This would allow dpkg to handle numbering changes correctly. -- Loïc Minier "For subalterns, saying something intelligent is as risky as saying something stupid." -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: /etc/udev/rules.d non-symlinks
Mike Hommey wrote: > On Mon, Apr 09, 2007 at 02:50:58PM -0400, Joey Hess <[EMAIL PROTECTED]> wrote: > > I'm proposing that we change our de-facto policy for handling of files > > in /etc/udev/rules.d. Currently it is this (from udev's README.Debian): > > > > Packages should NEVER create files in /etc/udev/rules.d/, but create a > > symlink the first time the package is installed (and never try again, to > > allow the local system administrator to remove it). > > > > The intent is to let users disable a udev rule by removing the symlink, or > > reorder a rule to a different number by renaming the symlink. Putting a > > rules > > conffile directly in /etc/udev/rules.d/ wouldn't allow for this > > Why ? Isn't dpkg supposed to track removed conffiles ? dpkg does not notice when you rename a conffile to a different number. -- see shy jo signature.asc Description: Digital signature
Re: /etc/udev/rules.d non-symlinks
On Mon, Apr 09, 2007 at 02:50:58PM -0400, Joey Hess <[EMAIL PROTECTED]> wrote: > I'm proposing that we change our de-facto policy for handling of files > in /etc/udev/rules.d. Currently it is this (from udev's README.Debian): > > Packages should NEVER create files in /etc/udev/rules.d/, but create a > symlink the first time the package is installed (and never try again, to > allow the local system administrator to remove it). > > The intent is to let users disable a udev rule by removing the symlink, or > reorder a rule to a different number by renaming the symlink. Putting a rules > conffile directly in /etc/udev/rules.d/ wouldn't allow for this Why ? Isn't dpkg supposed to track removed conffiles ? Mike -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]