first pass at cleaning up manual generation errors. deal with μlawdec and θfs .TH lines. man pages that start with eqn escapes are still not delt with, and there are still too many complaints. Reference: /n/atom/patch/applied/mancheckth Date: Sun Oct 18 21:55:30 CES 2015 Signed-off-by: quanstro@quanstro.net --- /sys/lib/man/checkman.awk Sun Oct 18 21:50:14 2015 +++ /sys/lib/man/checkman.awk Sun Oct 18 21:50:15 2015 @@ -23,7 +23,6 @@ Weight["BUGS"] = 1024 Skipdirs["ape"] = 1 - Skipdirs["aux"] = 1 Skipdirs["fb"] = 1 Skipdirs["games"] = 1 Skipdirs["service.alt"] = 1 @@ -57,20 +56,18 @@ FNR==1 { n = length(FILENAME) seclen = 0 - if (substr(FILENAME, 2, 1) == "/") - seclen = 1 - else if (substr(FILENAME, 3, 1) == "/") - seclen = 2 + section = FILENAME; + gsub("/.*", "", section); + seclen = length(section); if(seclen == 0) - print "FILENAME", FILENAME, "not of form [0-9][0-9]?/*" + print "FILENAME", FILENAME, "not of form [0-9]+[a-z]+/*" else if(!(substr(FILENAME, seclen+2, n-seclen-1) ~ /^[A-Z]+(.html)?$/)){ - section = substr(FILENAME, 1, seclen) name = substr(FILENAME, seclen+2, n-seclen-1) if($1 != ".TH" || NF != 3) print "First line of", FILENAME, "not a proper .TH" - else if($2 != toupper(name) || substr($3, 1, seclen) != section){ + else if($2 != runetoupper(name) || substr($3, 1, seclen) != section){ if($2!="INTRO" || name!="0intro") - print ".TH of", FILENAME, "doesn't match filename" + print ".TH of", FILENAME, "doesn't match filename", runetoupper(name) }else Pages[section "/" $2] = 1 } @@ -153,13 +150,14 @@ next } gsub(/[^0-9]/, "", section) - Refs[section "/" toupper(name)]++ + Refs[section "/" runetoupper(name)]++ } END { print "Checking Cross-Referenced Pages" for (i in Refs) { - if (!(i in Pages)){ + if (!(i in Pages)) + if (i !~ /^[1-9]+[a-z]*\/intro$/) { split(tolower(i), a, "/") print "grep -n " a[2] ".*" a[1] " [0-9]*/* # Need " tolower(i) } @@ -171,7 +169,7 @@ getindex("/sys/man/7") getindex("/sys/man/8") getindex("/sys/man/9") - getindex("/sys/man/9adr") + getindex("/sys/man/9nix") getindex("/sys/man/10") getbinlist("/386/bin") getbinlist("/rc/bin") @@ -208,7 +206,7 @@ getnmlist("/386/lib/libhtml.a") getnmlist("/386/lib/libhttpd.a") getnmlist("/386/lib/libip.a") -# getnmlist("/386/lib/libl.a") +## getnmlist("/386/lib/libl.a") getnmlist("/386/lib/libmach.a") getnmlist("/386/lib/libmemdraw.a") getnmlist("/386/lib/libmemlayer.a") @@ -217,7 +215,7 @@ # getnmlist("/386/lib/liboventi.a") getnmlist("/386/lib/libplumb.a") getnmlist("/386/lib/libregexp.a") -# getnmlist("/386/lib/libscribble.a") +## getnmlist("/386/lib/libscribble.a") getnmlist("/386/lib/libsec.a") getnmlist("/386/lib/libstdio.a") # getnmlist("/386/lib/libsunrpc.a") @@ -279,4 +277,13 @@ { for (i in List) delete List[i] +} + +func runetoupper(s, ns) +{ + if(s ~ /[-􏿿]/){ + "/bin/rune/case -u " s |getline ns + return ns + }else + return toupper(s); }