Home | History | Annotate | Line # | Download | only in mantools
check-postfix-files revision 1.1.1.2
      1      1.1  christos #!/bin/sh
      2      1.1  christos 
      3      1.1  christos # Reports missing documentation file names in postfix-files. For
      4      1.1  christos # simplicity and maintainability this looks at file basenames only.
      5      1.1  christos # The odds that a file is installed in the wrong place are small.
      6      1.1  christos 
      7      1.1  christos trap 'rm -f expected.tmp actual.tmp' 0 1 2 3 15
      8      1.1  christos 
      9      1.1  christos LANG=C; export LANG
     10      1.1  christos LC_ALL=C; export LC_ALL
     11      1.1  christos 
     12      1.1  christos # Extract file basenames from postfix-files.
     13      1.1  christos 
     14      1.1  christos awk -F: '
     15      1.1  christos     BEGIN { want["f"] = want["h"] = want["l"] = want["p"] = 1 }
     16      1.1  christos     want[$2] == 1 { n = split($1, path, "/"); print path[n] }
     17      1.1  christos ' conf/postfix-files | sort >actual.tmp
     18      1.1  christos 
     19      1.1  christos # Create a list of expected names, excluding files that aren't installed.
     20      1.1  christos 
     21  1.1.1.2  christos (ls man/man?/* html/*.html |sed 's/.*\///' | grep -E -v '^makedefs.1
     22      1.1  christos ^posttls-finger.1
     23      1.1  christos ^qmqp-sink.1
     24      1.1  christos ^qmqp-source.1
     25      1.1  christos ^qshape.1
     26      1.1  christos ^smtp-sink.1
     27      1.1  christos ^smtp-source.1'
     28      1.1  christos ls README_FILES) | sort >expected.tmp 
     29      1.1  christos 
     30      1.1  christos # Compare the expected names against the names in postfix-files.
     31      1.1  christos 
     32      1.1  christos comm -23 expected.tmp actual.tmp
     33