[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] [PATCH 25/35] fsadm: Allow to specify size without "size=" prefix in "resize"



For backwards compatibility we should allow to specify plain number as a
new size in resize command.

Signed-off-by: Lukas Czerner <lczerner redhat com>
---
 scripts/fsadm.sh |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 55b4688..f354fec 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -587,9 +587,12 @@ resize() {
 			continue
 		fi
 		case $i in
-			"size=+"*) [ $size -eq 0 ] && extend=${i##*+} && size=1;;
-			"size=-"*) [ $size -eq 0 ] && shrink=${i##*-} && size=1;;
-			"size="*)  [ $size -eq 0 ] && new_size=${i##*=} && size=1;;
+			"size=+"*)	[ $size -eq 0 ] && extend=${i##*+} && size=1;;
+			+[[:digit:]]*)	[ $size -eq 0 ] && extend=${i##*+} && size=1;;
+			"size=-"*)	[ $size -eq 0 ] && shrink=${i##*-} && size=1;;
+			-[[:digit:]]*)	[ $size -eq 0 ] && shrink=${i##*-} && size=1;;
+			"size="*) 	[ $size -eq 0 ] && new_size=${i##*=} && size=1;;
+			[[:digit:]]*) 	[ $size -eq 0 ] && new_size=${i} && size=1;;
 			*) error "Wrong option $i. (see: $TOOL --help)";;
 		esac
 	done
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]