[lxc-devel] [PATCH] lxc-create: Script cleanup
Serge Hallyn
serge.hallyn at canonical.com
Mon Dec 3 14:45:33 UTC 2012
Quoting Stéphane Graber (stgraber at ubuntu.com):
> - Removes the mixed tabs/spaces, replacing by standard 4 spaces indent.
> - Fix a bunch of bashisms.
> - Use shell syntax for and/or in if statements instead of the "test"
> syntax.
> - Improve block spacing a bit.
>
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> @@ -188,13 +187,14 @@ if [ "$(id -u)" != "0" ]; then
> exit 1
> fi
> -if [ -n "$custom_rootfs" -a "$backingstore" != "dir" ]; then
> +if [ -n "$custom_rootfs" ] && [ "$backingstore" != "dir" ]; then
> echo "--dir is only valid with -B dir"
> fi
> case "$backingstore" in
> dir|lvm|none|btrfs|_unset) :;;
> - *) echo "$(basename $0): '$backingstore' is not known (try 'none',
> 'dir', 'lvm', 'btrfs')" >&2
> + *)
> + echo "$(basename $0): '$backingstore' is not known (try 'none',
> 'dir', 'lvm', 'btrfs')" >&2
> usage
> exit 1
> ;;
> @@ -207,7 +207,7 @@ fi
> rootfs="$lxc_path/$lxc_name/rootfs"
> -if [ "$backingstore" = "_unset" -o "$backingstore" = "btrfs" ]; then
> +if [ "$backingstore" = "_unset" ] || [ "$backingstore" = "btrfs" ]; then
The only ones which seem unnecessary are these. They're not wrong, just
seem unnecessary. So for my education, are they in fact necessary?
thanks,
-serge
More information about the lxc-devel
mailing list