Fix problem with comment chars in /etc/fstab
authorMichael Prokop <devnull@localhost>
Sat, 24 May 2008 23:30:04 +0000 (01:30 +0200)
committerMichael Prokop <devnull@localhost>
Sat, 24 May 2008 23:30:04 +0000 (01:30 +0200)
debian/changelog
grml2usb

index 7309a37..4d998ea 100644 (file)
@@ -1,3 +1,10 @@
+grml2usb (0.9.1) unstable; urgency=low
+
+  * Fix problem with comment chars in /etc/fstab.
+    Thanks for debugging and the patch to Robert Euhus!
+
+ -- Michael Prokop <mika@grml.org>  Sun, 25 May 2008 01:29:30 +0200
+
 grml2usb (0.9.0) unstable; urgency=low
 
   * Support new directory layout of different grml-flavours
index c4778ba..9e94b26 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -4,7 +4,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Sun Feb 24 13:49:13 CET 2008 [mika]
+# Latest change: Sun May 25 01:29:21 CEST 2008 [mika]
 ################################################################################
 
 # colors {{{
@@ -110,7 +110,7 @@ info(){
 
 vfat_warning(){
   DEV=$(echo ${DEVICE%/})
-  TMPDEV=$(grep ${DEV} /etc/fstab | awk '{print $1}')
+  TMPDEV=$(grep "[[:space:]]${DEV}[[:space:]]" /etc/fstab | grep -vh '^[[:space:]]*#' | awk '{print $1}')
   SYSDEV=$(echo ${TMPDEV%/})
   if [ -x /lib/udev/vol_id ] ; then
      /lib/udev/vol_id $SYSDEV | grep -q 'FS_TYPE=vfat' || VFAT=1
@@ -227,7 +227,7 @@ copyit(){
 
 run_syslinux(){
   DEV=$(echo ${DEVICE%/})
-  TMPDEV=$(grep ${DEV} /etc/fstab | awk '{print $1}')
+  TMPDEV=$(grep "[[:space:]]${DEV}[[:space:]]" /etc/fstab | grep -vh '^[[:space:]]*#' | awk '{print $1}')
   SYSDEV=$(echo ${TMPDEV%/})
   echo -n "Running syslinux on ${SYSDEV}: "
   debugit "debug: syslinux ${SYSDEV}"