File: gentexifile

package info (click to toggle)
libaws 2.2dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,624 kB
  • ctags: 1,173
  • sloc: ada: 61,829; ansic: 6,483; makefile: 1,282; xml: 196; sh: 119; java: 112; python: 66; sed: 40
file content (41 lines) | stat: -rw-r--r-- 888 bytes parent folder | download | duplicates (3)
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
37
38
39
40
41
#!/bin/sh
if [ $# = 0 ]; then
  echo "Usage: $0 <file to translate>"
  exit 0
fi

SOURCE=$1
TARGET=`basename ${SOURCE}`.texi
TMPTAR=${TARGET}.tmp

awk=`type gawk 2>/dev/null`
if [ x"$awk" = x ]; then
   awk="awk"
else
   awk="gawk"
fi

$awk 'BEGIN{out=1}$1=="end"&&substr($0,1,1)=="e"{out=1}out==1{print}$1=="private"&&out==1{out=0; print "   --  implementation removed"}' ${SOURCE} > genout

rm -f ${TMPTAR}

if [ $# = 1 ]; then
echo "@cartouche"        >>${TMPTAR}
fi
echo "@smallexample"     >>${TMPTAR}
if [ $# = 1 ]; then
echo "@group"            >>${TMPTAR}
fi
echo ""                  >>${TMPTAR}
sed -f ada.sed genout    >>${TMPTAR}
echo ""                  >>${TMPTAR}
if [ $# = 1 ]; then
echo "@end group"        >>${TMPTAR}
fi
echo "@end smallexample" >>${TMPTAR}
if [ $# = 1 ]; then
echo "@end cartouche"    >>${TMPTAR}
fi

cat ${TMPTAR} | tr -d '\r' > ${TARGET}
rm ${TMPTAR}