aboutsummaryrefslogtreecommitdiff
path: root/dist/mkfilelist
blob: eaea893304421c304e647bbb52179f4abddeb159 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/local/plan9/bin/rc

@{cd $PLAN9; find . -type f -print; find . -type d -print | sed 's;$;/;'} | 
	sort | sed 's;^./;;' | grep . |
awk -vplan9'='$PLAN9 '
	function cat(s) {
		print line0, s
		next
	}
	
	BEGIN{
		# Dependencies
		# print "bin: base"
		# print "devel: base bin"
		# print "dist: base"
		# print "faces: base"
		# print "font-asian: font-core"
		# print "font-bh: font-core"
		# print "font-proof: font-core"	
		# print "font-core: core"
		# print "devel: base, lib"
		# print "lp: base, faces"
		# print "sky: base"
		# print "sky-data: sky"
		# print "src: base, devel"
		# print "troff: base, postscript"
		# print "unixdist: base, src"
	}
	
	# Eliminate unmentionables.
	{ line0 = $0 }
	/^CVS\// { next }
	/\/CVS\// { next }
	/\.#/ { next }
	/\.cvsignore/ { next }	
	/^ChangeLog/ { next }
	/^config$/ { next }
	/^install.log$/ { next }
	/CVS.IEXIST/ { next }
	
	# Print with categories.
	/^(LICENSE|CHANGES|INSTALL|NOTES|TODO)/ { cat("base") }

	/^acid\// { cat("devel") }

	/^bin\/(9c|9l|9ar|9install)/ { cat("devel") }
	/^bin\/.*\/$/ { cat("base") }
	/^bin\/./ { 
		file=$1
		cmd = "file " plan9 "/''" $1 "'' | sed ''s/.*: //'' "
		type = cmd | getline
		close(cmd)
		$1=file
		if(type ~ /script/)
			cat("base")
		else
			cat("bin")
	}
	/^bin\/$/ { cat("base") }
	
	/^dict\// { cat("dict") }
	
	/^dist\/debian\/(dists|pool)/ { next }
	/^dist\// { cat("dist") }

	/^face\// { cat("faces") }

	/^font\/(big5|gb|jis|naga10|shinonome)/ { cat("font-asian") }
	/^font\/LICENSE/ { cat("font-bh") }
	/^font\/(luc|lucsans|lucm|pelm)\// { cat("font-bh") }
	/^font\/(MAP|fixed|misc|sample|smiley)/ { cat("font-core") }
	/^font\/(palatino|times|special)/ { cat("font-proof") }
	/^font\// { cat("font-core") }
	
	/^include\// { cat("devel") }

	/^lib\/.*\.a$/ { cat("lib") }
	/^lib\/(..spell|acme.rc|bclib|fortunes|gv|grap|keyboard|lex|unicode|units|words|yacc)/ { cat("base") }
	/^lib\/moveplan9/ { cat("base") }
	/^lib\/hyphen.tex/ { cat("troff") }
	/^lib\/linux-isnptl\.c/ { cat("src") }
	/^lib\/$/ { cat("base") }

	/^log\// { cat("base") }

	/^lp\// { cat("lp") }
	
	/^man\/man3/ { cat("devel") }
	/^man\// { cat("base") }
	
	/^ndb\// { cat("base") }
	
	/^news\// { cat("base") }
	
	/^plumb/ { cat("base") }
	
	/^postscript\/troff/ { cat("troff") }
	/^postscript\/font\/(Lucida|lsunr|NOTICE)/ { cat("postscript-bh") }
	/^postscript\// { cat("postscript") }

	/^proto/ { cat("base") }

	/^rcmain/ { cat("base") }

	/^sky\/$/ { cat("sky") }
	/^sky\/here/ { cat("sky") }
	/^sky\// { cat("sky-data") }
	
	/^(tmac|troff)\// { cat("troff") }
	
	/^src\/mk/ { cat("devel") }

	/^src/ { cat("src") }

	/^unix\// { cat("unixdist") }
	
	# Print warning about unsorted files.
	{ 
		print "unsorted: " $0 >"/dev/stderr"
	}
'