linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Friesen <chris_friesen@sympatico.ca>
To: linux-hotplug@vger.kernel.org
Subject: Re: RFC: cleaner version of test.block
Date: Thu, 23 Oct 2003 04:30:52 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-106706654708066@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-106671517825612@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Greg KH wrote:
> On Tue, Oct 21, 2003 at 01:35:04AM -0400, Chris Friesen wrote:
> 
>> I propose the following version of test.block.  I think the code's 
>> easier to read than the one using "cut", and it removes the
>> dependency on stuff outside of bash.

> Looks good, care to make a patch against the 004 release?

I've attached a patch against 005 for both the block and tty scripts.  I
didn't bother running udev backgrounded, since as you say, the new code
runs a lot faster.

Chris

[-- Attachment #2: udev.patch --]
[-- Type: text/plain, Size: 1706 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: udev
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.133   -> 1.135  
#	          test.block	1.11    -> 1.12   
#	            test.tty	1.3     -> 1.4    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/22	chris@doug.mackenzie.net	1.84.1.1
# cleaning up the test script
# --------------------------------------------
# 03/10/22	chris@doug.mackenzie.net	1.134
# Merge bk://kernel.bkbits.net/gregkh/udev/
# into doug.mackenzie.net:/home/chris/hacking/udev
# --------------------------------------------
# 03/10/23	chris@doug.mackenzie.net	1.135
# cleaning up test script
# --------------------------------------------
#
diff -Nru a/test.block b/test.block
--- a/test.block	Thu Oct 23 00:25:14 2003
+++ b/test.block	Thu Oct 23 00:25:14 2003
@@ -16,14 +16,13 @@
 
 for i in ${SYSFSDIR}/block/*; do
 	# add each drive
-	export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-`
+	export DEVPATH=${i#${SYSFSDIR}}
 	$BIN block
 
 	# add each partition, on each device
 	for j in $i/*; do
 		if [ -f $j/dev ]; then
-			export DEVPATH="/"`echo $j |  \
-				cut --delimiter='/' --fields=3-`
+			export DEVPATH=${j#${SYSFSDIR}}
 			$BIN block
 		fi
 	done
diff -Nru a/test.tty b/test.tty
--- a/test.tty	Thu Oct 23 00:25:14 2003
+++ b/test.tty	Thu Oct 23 00:25:14 2003
@@ -15,6 +15,6 @@
 export ACTION=$1	# 'add' or 'remove'
 
 for i in ${SYSFSDIR}/class/tty/*; do
-	export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-`
+	export DEVPATH=${i#${SYSFSDIR}}
 	$BIN tty
 done

  parent reply	other threads:[~2003-10-23  4:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21  5:35 RFC: cleaner version of test.block Chris Friesen
2003-10-21  6:13 ` Robert Love
2003-10-21 16:54 ` Greg KH
2003-10-21 16:55 ` Chris Larson
2003-10-21 17:42 ` Greg KH
2003-10-23  4:30 ` Chris Friesen [this message]
2003-11-20 16:55 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-106706654708066@msgid-missing \
    --to=chris_friesen@sympatico.ca \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).