]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
[PATCH] faster test scripts
authorchris_friesen@sympatico.ca <chris_friesen@sympatico.ca>
Wed, 19 Nov 2003 10:39:39 +0000 (02:39 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:06:25 +0000 (21:06 -0700)
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.

test/test.block
test/test.tty

index 622a66037f3d4494c3bba07e6d410e9dfdc4d04e..b806a42aacfa5a2c53ab751695f72d6fd8a1f352 100644 (file)
@@ -16,14 +16,13 @@ export ACTION=$1    # 'add' or 'remove'
 
 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
index d5e2d6715dc7bd9afff037db8044fe0a009403e4..42f46a2e7c266a49a2f37374a472a8cfe6b83ec4 100644 (file)
@@ -15,6 +15,6 @@ BIN=./udev            # location of your udev binary
 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