~kris/9p

glenda

ref: 4866136749b796584ec5f2c40543c736db5640fe glenda/x/mux/lookman/mkindex -rw-r--r-- 459 bytes
48661367 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/rc
# creates the index used by lookman

MIRROR=/usr/share/mirror/plan9front
index=$MIRROR/sys/lib/man/lookman/index
LIB=$MIRROR/sys/man

>index
for(i in $LIB^/[0-9]*/[a-z0-9:]*){
	p=`{echo $i | sed 's@^$LIB^/\([^ ]\)/\([^ ]*\)$@\2(\1)@'}
	deroff -w_ < $i |
	tr 'A-Z' 'a-z' |
	sort -u |
	comm -23 - junkwords |
	sed 's@$@	'$p'@' >>index		# stick file name on end of line
}
sort -o index index

# Drop our index into the plan9front tree
mv index $index