Package: laptop-mode
Version: 0.4
Severity: normal
Flags: patch

I've got an iso image mounted via a loop block device, and when I run
'laptop-mode start', it bails with an error message from one of the
'sed' commands..  The problem is that the mount options have several
'/' characters in them, and that's what 'sed' is using for expression
delimiters.  The included patch fixes the problem.

Here's the string from mtab:

/home/karlheg/Desktop/CD_Images/Understanding_the_Linux_Virtual_Memory_Manager.iso
 on /media/isoimg type iso9660 (rw,loop=/dev/loop0)

Here's part of a trace of the script:

8<---------------------------------------------------->8
  + read DEV MP FST OPTS DUMP PASS
  ++ parse_mount_opts rw,loop=/dev/loop0
  ++ OPT=rw,loop=/dev/loop0
  ++ shift
  ++ echo ''
  ++ sed 's/.*/,&,/'
  ++ sed 's/,rw,loop=/dev/loop0=[0-9]*,/,/g'
  sed: -e expression #1, char 17: unknown option to `s'
  ++ sed 's/,,*/,/g'
  ++ sed 's/^,//'
  ++ sed 's/,$//'
8<---------------------------------------------------->8

And here's the simple and tested patch:


--- laptop-mode 2005/06/04 08:31:06     1.1
+++ laptop-mode 2005/06/04 09:03:30
@@ -20,7 +20,7 @@
        shift
        echo "$*"                       | \
        sed 's/.*/,&,/'                 | \
-       sed 's/,'"$OPT"'=[0-9]*,/,/g'   | \
+       sed 's%,'"$OPT"'=[0-9]*,%,%g'   | \
        sed 's/,,*/,/g'                 | \
        sed 's/^,//'                    | \
        sed 's/,$//'                    | \
@@ -34,7 +34,7 @@
        shift
        echo "$*"                       | \
        sed 's/.*/,&,/'                 | \
-       sed 's/,'"$OPT"',/,/g'          | \
+       sed 's%,'"$OPT"',%,%g'          | \
        sed 's/,,*/,/g'                 | \
        sed 's/^,//'                    | \
        sed 's/,$//'                    | \


-- 
Karl Hegbloom <[EMAIL PROTECTED]>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to