From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Patterson Date: Thu, 14 Oct 2004 20:05:49 +0000 Subject: Re: Problem parsing %s in udev rules Message-Id: <1097784349.13758.83.camel@bluto.andrew> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-p1h7nDJ9Kxdgk6YvXRzc" List-Id: References: <1097105584.9273.9.camel@bluto.andrew> In-Reply-To: <1097105584.9273.9.camel@bluto.andrew> To: linux-hotplug@vger.kernel.org --=-p1h7nDJ9Kxdgk6YvXRzc Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2004-10-13 at 16:56 -0700, Greg KH wrote: > On Wed, Oct 13, 2004 at 05:13:12PM -0600, Andrew Patterson wrote: > > > We already trim it off when matching, but we also allow matching if y= ou > > > do put the spaces in there. This patch breaks that, right? > >=20 > > Correct, I have a new patch that trims after the comparison, so it > > should work in both cases.=20 >=20 > Thanks, I've applied this. Thanks. >=20 > > > > I also wonder if it might be a good idea to do some sort of > > > > transformation for characters in an attribute that are illegal in a= file > > > > system, rather than just chopping everything off. e.g, spaces that = are > > > > not leading or trailing would be changed to underscores. > > >=20 > > > ick, no. > >=20 > > Really? Care to elaborate?=20 > >=20 > > Do you not like any transformation (besides the "let's chop off > > everything after anything illegal") or just the underscores for spaces > > one? Perhaps a configuration value to make it optional? This sort of > > thing might relieve a lot of the script writing that must be done to > > handle cases that may be common. >=20 > Have you run into any cases where something like this is needed? I > don't really want to do any transformation within udev itself if > possible, as it's a slippery slope down... Helper programs can be used > if people run into anything really nasty, and the fact that this hasn't > come up yet, lends me to belive it really isn't a problem. =20 >=20 > Do you have any device that would need such transformation? Need, no. Want perhaps. Example: using the following rule: BUS=3D"scsi", KERNEL=3D"sd*", NAME=3D"%k", SYMLINK=3D"scsi_disks/%s{vendor}= -% s{model}" I have this stupid disk drive that has the following vendor and model entry: Vendor: HP 36.4G Model: ST336753LC So the resulting device file created by udev is /dev/scsi_disks/HP-ST336753LC Intuitively, I would expect /dev/scsi_disks/HP 36.4G-ST336753LC. Given that spaces are bad, it would be be nice to see something like: /dev/scsi_disks/HP_36.4G-ST336753LC. Is the %s stuff used a lot? I am somewhat surprised that I am the only one running into issues like this. Andrew >=20 > thanks, >=20 > greg k-h >=20 --=20 Andrew Patterson =20 Hewlett-Packard --=-p1h7nDJ9Kxdgk6YvXRzc Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBbtwcoKXgdXvblSgRAkgvAKDXfalCrVhyB6NZpuySpSOj4W5uXACfaJ3L 5/cBXgck/hGy517XAS+BpDo= =wrXW -----END PGP SIGNATURE----- --=-p1h7nDJ9Kxdgk6YvXRzc-- ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel