X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fsupport%2Fdependencies%2Fcheck-host-asciidoc.sh;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fsupport%2Fdependencies%2Fcheck-host-asciidoc.sh;h=fc5fcba4435f0ff34f6e8efbcd7728d893821809;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/support/dependencies/check-host-asciidoc.sh b/cirros-testvm/src-cirros/buildroot-2015.05/support/dependencies/check-host-asciidoc.sh new file mode 100755 index 0000000..fc5fcba --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/support/dependencies/check-host-asciidoc.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +candidate="$1" #ignored + +asciidoc=`which asciidoc` +if [ ! -x "$asciidoc" ]; then + # echo nothing: no suitable asciidoc found + exit 1 +fi + +# Output of 'asciidoc --version' examples: +# asciidoc 8.6.7 +version=`$asciidoc --version | cut -d\ -f2` +major=`echo "$version" | cut -d. -f1` +minor=`echo "$version" | cut -d. -f2` +bugfix=`echo "$version" | cut -d. -f3` + +# To generate the manual, we need asciidoc >= 8.6.3 +major_min=8 +minor_min=6 +bugfix_min=3 +if [ $major -gt $major_min ]; then + echo $asciidoc +else + if [ $major -eq $major_min -a $minor -ge $minor_min ]; then + echo $asciidoc + else + if [ $major -eq $major_min -a $minor -eq $minor_min \ + -a $bugfix -ge $bugfix_min ]; then + echo $asciidoc + else + # echo nothing: no suitable asciidoc found + exit 1 + fi + fi +fi