summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-blockdevices-filesystems.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-12 22:18:43 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-12 22:18:43 +0100
commit6d8f39a5e114755b67b86529e6f16b7d9ee752df (patch)
tree61938bc3117e8e5e729b9b3b78639cb3fccfd55a /src/core/libs/lib-blockdevices-filesystems.sh
parentfd76714bcbf1dfb470f0f4c4c55ae4d50c158305 (diff)
nicer display of partitions and filesystems in "Manage filesystems"
Diffstat (limited to 'src/core/libs/lib-blockdevices-filesystems.sh')
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index 2cb5652..8accfab 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -447,7 +447,8 @@ process_disk ()
}
# $1 fs_string
-# $2 decode yes/no
+# $2 value to replace "no_foo" values with (optional) (can be '')
+# when given, __ will be translated to ' ' as well
parse_filesystem_string ()
{
fs="$1"
@@ -458,15 +459,15 @@ parse_filesystem_string ()
fs_opts=` cut -d ';' -f 5 <<< $fs`
fs_label=` cut -d ';' -f 6 <<< $fs`
fs_params=` cut -d ';' -f 7 <<< $fs`
- if [ "$2" == 'yes' ]; then
+ if [ -n "${2+2}" ]; then # checking if a var is defined, in bash.
fs_opts="${fs_opts//__/ }"
fs_params="${fs_params//__/ }"
- [ "$fs_type" = no_type ] && fs_type=
- [ "$fs_mountpoint" = no_mountpoint ] && fs_mountpoint=
- [ "$fs_mount" = no_mount ] && fs_mount=
- [ "$fs_opts" = no_opts ] && fs_opts=
- [ "$fs_label" = no_label ] && fs_label=
- [ "$fs_params" = no_params ] && fs_params=
+ [ "$fs_type" = no_type ] && fs_type=$2
+ [ "$fs_mountpoint" = no_mountpoint ] && fs_mountpoint=$2
+ [ "$fs_mount" = no_mount ] && fs_mount=$2
+ [ "$fs_opts" = no_opts ] && fs_opts=$2
+ [ "$fs_label" = no_label ] && fs_label=$2
+ [ "$fs_params" = no_params ] && fs_params=$2
fi
}
@@ -750,7 +751,7 @@ process_filesystem ()
debug 'FS' "process_filesystem $@"
local ret=0
part=$1
- parse_filesystem_string "$2;$3;$4;$5;$6;$7;$8" yes
+ parse_filesystem_string "$2;$3;$4;$5;$6;$7;$8" ''
# Create the FS
if [ "$fs_create" = yes ]