File: api-index.sh

package info (click to toggle)
git 1%3A2.11.0-3%2Bdeb9u7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,644 kB
  • sloc: ansic: 176,247; sh: 155,188; perl: 29,746; tcl: 21,549; python: 6,781; makefile: 3,405; lisp: 1,786; php: 120; asm: 98; csh: 45
file content (32 lines) | stat: -rwxr-xr-x 699 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

(
	c=////////////////////////////////////////////////////////////////
	skel=api-index-skel.txt
	sed -e '/^\/\/ table of contents begin/q' "$skel"
	echo "$c"

	ls api-*.txt |
	while read filename
	do
		case "$filename" in
		api-index-skel.txt | api-index.txt) continue ;;
		esac
		title=$(sed -e 1q "$filename")
		html=${filename%.txt}.html
		echo "* link:$html[$title]"
	done
	echo "$c"
	sed -n -e '/^\/\/ table of contents end/,$p' "$skel"
) >api-index.txt+

if [ "$SOURCE_DATE_EPOCH" ]; then
    touch -d "@$SOURCE_DATE_EPOCH" api-index.txt+
fi

if test -f api-index.txt && cmp api-index.txt api-index.txt+ >/dev/null
then
	rm -f api-index.txt+
else
	mv api-index.txt+ api-index.txt
fi