hc
2023-02-14 0cc9b7c44253c93447ddf73e206fbdbb3d9f16b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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