Mention updated config files.
[rsync.git] / maybe-make-man
1 #!/bin/sh
2
3 if [ $# != 1 ]; then
4     echo "Usage: $0 NAME.NUM.md" 1>&2
5     exit 1
6 fi
7
8 inname="$1"
9 srcdir=`dirname "$0"`
10 flagfile="$srcdir/.md2man-works"
11 force_flagfile="$srcdir/.md2man-force"
12
13 if [ ! -f "$flagfile" ]; then
14     # We test our smallest manpage just to see if the python setup works.
15     if "$srcdir/md-convert" --test "$srcdir/rsync-ssl.1.md" >/dev/null 2>&1; then
16         touch $flagfile
17     else
18         outname=`echo "$inname" | sed 's/\.md$//'`
19         if [ -f "$outname" ]; then
20             exit 0
21         elif [ -f "$srcdir/$outname" ]; then
22             echo "Copying $srcdir/$outname"
23             cp -p "$srcdir/$outname" .
24             exit 0
25         else
26             echo "ERROR: $outname cannot be created."
27             if [ -f "$HOME/build_farm/build_test.fns" ]; then
28                 exit 0 # No exit errorno to avoid a build failure in the samba build farm
29             else
30                 exit 1
31             fi
32         fi
33     fi
34 fi
35
36 if [ -f "$force_flagfile" ]; then
37     opt='--force-link-text'
38 else
39     opt=''
40 fi
41
42 "$srcdir/md-convert" $opt "$srcdir/$inname"