[Lunar-commits] r18591 - lunar/trunk/var/lib/lunar/functions

Auke Kok sofar at lunar-linux.org
Wed Feb 8 18:44:41 UTC 2006


Author: sofar
Date: 2006-02-08 18:44:38 +0000 (Wed, 08 Feb 2006)
New Revision: 18591

Modified:
   lunar/trunk/var/lib/lunar/functions/misc.lunar
Log:
Code speedup - don't run readlink unneededly a lot.


Modified: lunar/trunk/var/lib/lunar/functions/misc.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/misc.lunar	2006-02-08 18:29:15 UTC (rev 18590)
+++ lunar/trunk/var/lib/lunar/functions/misc.lunar	2006-02-08 18:44:38 UTC (rev 18591)
@@ -116,9 +116,10 @@
 
 unmap_device()
 {
-    local DEVICE
+    local DEVICE REAL
+    REAL=$(readlink -f $1)
     for DEVICE in $(ls -1d /dev/[hs]d* 2> /dev/null); do
-        if [ "$(readlink -f $DEVICE)" == "$(readlink -f $1)" ]; then
+        if [[ "$(readlink -f $DEVICE)" == "$REAL" ]]; then
             echo $DEVICE
             return 0
         fi



More information about the Lunar-commits mailing list