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

Re: [Libguestfs] [PATCH] tests: Conditionally skip UUID tests.



Richard W.M. Jones wrote:
...
> diff --git a/capitests/Makefile.am b/capitests/Makefile.am
...
> +# Old version of e2fsprogs which didn't support UUIDs?
> +e2fs_uuid_not_supported := $(shell r=1; if test -x ../initramfs/sbin/mkswap; then if ../initramfs/sbin/mkswap --help 2>&1 | grep -sq -- -U; then r=0; fi; fi; echo $$r)

Looks good.
However it'd be even tidier, and easier to read with line lengths < 80:

e2fs_uuid_not_supported :=					\
  $(shell r=1; if test -x ../initramfs/sbin/mkswap; then	\
    if ../initramfs/sbin/mkswap --help 2>&1			\
      | grep -sq -- -U; then r=0; fi; fi; echo $$r)

In case you're comfortable with cmd && cmd2 && ... notation,
here's another way to write it using slightly less syntax:

e2fs_uuid_not_supported :=						\
  $(shell r=1;								\
    test -x ../initramfs/sbin/mkswap					\
      && ../initramfs/sbin/mkswap --help 2>&1 | grep -sq -- -U		\
      && r=1; echo $$r)


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