Adjust filesystem check for new blkid behaviour
authorMichael Prokop <mika@grml.org>
Thu, 11 Dec 2014 10:40:24 +0000 (11:40 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 11 Dec 2014 17:37:32 +0000 (18:37 +0100)
blkid used to return with an exit code of 2 if 'blkid -s TYPE -o
value' was executed on an unformated device.  Nowadays blkid
returns with exit code 0 even if there's no file system on the
according device.

Related to #772846 in Debian.

Closes: #772849

grml-debootstrap

index c029246..ffcb6aa 100755 (executable)
@@ -430,7 +430,10 @@ prompt_for_target()
   fi
 
   PARTITION_LIST=$(for i in $AVAILABLE_PARTITIONS ; do
-                     echo "$i $(blkid -s TYPE -o value "$i" 2>/dev/null || echo '[no_filesystem_yet]')"
+                     fs="$(blkid -s TYPE -o value "$i" 2>/dev/null)"
+                     [ -n "$fs" ] || fs='[no_filesystem_yet]'
+                     echo "$i" "$fs"
+                     unset fs
                    done)
 
   TARGET=$(dialog --title "$PN" --single-quoted --stdout \