rsc | 0efbc55 | 2005-09-13 01:40:50 +0000 | [diff] [blame] | 1 | #!/usr/local/plan9/bin/rc |
| 2 | |
| 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) { |
rsc | 28c158a | 2005-09-13 04:18:22 +0000 | [diff] [blame] | 7 | print line0, s |
rsc | 0efbc55 | 2005-09-13 01:40:50 +0000 | [diff] [blame] | 8 | next |
| 9 | } |
| 10 | |
| 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 | } |
| 29 | |
| 30 | # Eliminate unmentionables. |
rsc | 28c158a | 2005-09-13 04:18:22 +0000 | [diff] [blame] | 31 | { line0 = $0 } |
rsc | 0efbc55 | 2005-09-13 01:40:50 +0000 | [diff] [blame] | 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 } |
| 40 | |
| 41 | # Print with categories. |
| 42 | /^(LICENSE|CHANGES|INSTALL|NOTES|TODO)/ { cat("base") } |
| 43 | |
| 44 | /^acid\// { cat("devel") } |
| 45 | |
| 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") } |
| 60 | |
| 61 | /^dict\// { cat("dict") } |
| 62 | |
rsc | a4cb453 | 2005-09-13 03:59:35 +0000 | [diff] [blame] | 63 | /^dist\/debian\/(dists|pool)/ { next } |
rsc | 0efbc55 | 2005-09-13 01:40:50 +0000 | [diff] [blame] | 64 | /^dist\// { cat("dist") } |
| 65 | |
| 66 | /^face\// { cat("faces") } |
| 67 | |
| 68 | /^font\/(big5|gb|jis|naga10|shinonome)/ { cat("font-asian") } |
| 69 | /^font\/LICENSE/ { cat("font-bh") } |
| 70 | /^font\/(lucida|lucidasans|lucm|pelm)\// { cat("font-bh") } |
| 71 | /^font\/(MAP|fixed|misc|sample|smiley)/ { cat("font-core") } |
rsc | 0efbc55 | 2005-09-13 01:40:50 +0000 | [diff] [blame] | 72 | /^font\/(palatino|times|special)/ { cat("font-proof") } |
rsc | a4cb453 | 2005-09-13 03:59:35 +0000 | [diff] [blame] | 73 | /^font\// { cat("font-core") } |
rsc | 0efbc55 | 2005-09-13 01:40:50 +0000 | [diff] [blame] | 74 | |
| 75 | /^include\// { cat("devel") } |
| 76 | |
| 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") } |
| 83 | |
| 84 | /^log\// { cat("base") } |
| 85 | |
| 86 | /^lp\// { cat("lp") } |
| 87 | |
| 88 | /^man\/man3/ { cat("devel") } |
| 89 | /^man\// { cat("base") } |
| 90 | |
| 91 | /^ndb\// { cat("base") } |
| 92 | |
| 93 | /^news\// { cat("base") } |
| 94 | |
| 95 | /^plumb/ { cat("base") } |
| 96 | |
| 97 | /^postscript\/troff/ { cat("troff") } |
| 98 | /^postscript\/font\/(Lucida|lsunr|NOTICE)/ { cat("postscript-bh") } |
| 99 | /^postscript\// { cat("postscript") } |
| 100 | |
| 101 | /^proto/ { cat("base") } |
| 102 | |
| 103 | /^rcmain/ { cat("base") } |
| 104 | |
| 105 | /^sky\/$/ { cat("sky") } |
| 106 | /^sky\/here/ { cat("sky") } |
| 107 | /^sky\// { cat("sky-data") } |
| 108 | |
| 109 | /^(tmac|troff)\// { cat("troff") } |
| 110 | |
| 111 | /^src\/mk/ { cat("devel") } |
| 112 | |
| 113 | /^src/ { cat("src") } |
| 114 | |
| 115 | /^unix\// { cat("unixdist") } |
| 116 | |
| 117 | # Print warning about unsorted files. |
| 118 | { |
| 119 | print "unsorted: " $0 >"/dev/stderr" |
| 120 | } |
| 121 | ' |