Blob


1 #!/usr/local/plan9/bin/rc
3 @{cd $PLAN9; find . -type f -print; find . -type d -print | sed 's;$;/;'} |
4 sort | sed 's;^./;;' | grep . |
5 awk -vplan9'='$PLAN9 '
6 function cat(s) {
7 print line0, s
8 next
9 }
11 BEGIN{
12 # Dependencies
13 # print "bin: base"
14 # print "devel: base bin"
15 # print "dist: base"
16 # print "faces: base"
17 # print "font-asian: font-core"
18 # print "font-bh: font-core"
19 # print "font-proof: font-core"
20 # print "font-core: core"
21 # print "devel: base, lib"
22 # print "lp: base, faces"
23 # print "sky: base"
24 # print "sky-data: sky"
25 # print "src: base, devel"
26 # print "troff: base, postscript"
27 # print "unixdist: base, src"
28 }
30 # Eliminate unmentionables.
31 { line0 = $0 }
32 /^CVS\// { next }
33 /\/CVS\// { next }
34 /\.#/ { next }
35 /\.cvsignore/ { next }
36 /^ChangeLog/ { next }
37 /^config$/ { next }
38 /^install.log$/ { next }
39 /CVS.IEXIST/ { next }
41 # Print with categories.
42 /^(LICENSE|CHANGES|INSTALL|NOTES|TODO)/ { cat("base") }
44 /^acid\// { cat("devel") }
46 /^bin\/(9c|9l|9ar|9install)/ { cat("devel") }
47 /^bin\/.*\/$/ { cat("base") }
48 /^bin\/./ {
49 file=$1
50 cmd = "file " plan9 "/''" $1 "'' | sed ''s/.*: //'' "
51 type = cmd | getline
52 close(cmd)
53 $1=file
54 if(type ~ /script/)
55 cat("base")
56 else
57 cat("bin")
58 }
59 /^bin\/$/ { cat("base") }
61 /^dict\// { cat("dict") }
63 /^dist\/debian\/(dists|pool)/ { next }
64 /^dist\// { cat("dist") }
66 /^face\// { cat("faces") }
68 /^font\/(big5|gb|jis|naga10|shinonome)/ { cat("font-asian") }
69 /^font\/LICENSE/ { cat("font-bh") }
70 /^font\/(luc|lucsans|lucm|pelm)\// { cat("font-bh") }
71 /^font\/(MAP|fixed|misc|sample|smiley)/ { cat("font-core") }
72 /^font\/(palatino|times|special)/ { cat("font-proof") }
73 /^font\// { cat("font-core") }
75 /^include\// { cat("devel") }
77 /^lib\/.*\.a$/ { cat("lib") }
78 /^lib\/(..spell|acme.rc|bclib|fortunes|gv|grap|keyboard|lex|unicode|units|words|yacc)/ { cat("base") }
79 /^lib\/moveplan9/ { cat("base") }
80 /^lib\/hyphen.tex/ { cat("troff") }
81 /^lib\/linux-isnptl\.c/ { cat("src") }
82 /^lib\/$/ { cat("base") }
84 /^log\// { cat("base") }
86 /^lp\// { cat("lp") }
88 /^man\/man3/ { cat("devel") }
89 /^man\// { cat("base") }
91 /^ndb\// { cat("base") }
93 /^news\// { cat("base") }
95 /^plumb/ { cat("base") }
97 /^postscript\/troff/ { cat("troff") }
98 /^postscript\/font\/(Lucida|lsunr|NOTICE)/ { cat("postscript-bh") }
99 /^postscript\// { cat("postscript") }
101 /^proto/ { cat("base") }
103 /^rcmain/ { cat("base") }
105 /^sky\/$/ { cat("sky") }
106 /^sky\/here/ { cat("sky") }
107 /^sky\// { cat("sky-data") }
109 /^(tmac|troff)\// { cat("troff") }
111 /^src\/mk/ { cat("devel") }
113 /^src/ { cat("src") }
115 /^unix\// { cat("unixdist") }
117 # Print warning about unsorted files.
119 print "unsorted: " $0 >"/dev/stderr"