Basic fix for sortkey

Basic fix for sortkey

Used paralel arrays to get around out of order sesons/episodes

--- getBBoxCatalogFrom-sitemap.awk
+++ getBBoxCatalogFrom-sitemap.awk
@@ -14,6 +14,11 @@
     printf ("Sortkey\tTitle\tSeasons\tEpisodes\tDuration\tYear\tRating\tDescription\t")
     printf ("Content_Type\tContent_ID\tEntity_ID\tGenre\tShow_Type\tDate_Type\tOriginal_Date\t")
     printf ("Show_ID\tSeason_ID\tSn_#\tEp_#\t1st_#\tLast_#\n")
+
+    # For debugging variations in seasons and episodes format
+    str = "date +%y%m%d.%H%M%S"
+    str | getline longDate
+    close str
 }

 # Don't process credits
@@ -65,8 +70,8 @@
     # Generated fields
     year = ""
     # New fields that haven't been created yet
-    numSeasons = 111
-    numEpisodes = 222
+    numSeasons = 101
+    numEpisodes = 202
 }

 # Grab title
@@ -177,7 +182,6 @@
     sub (/&apos.*/,"")
     EntityId = "_" $0
     # print "EntityId = " EntityId  > "/dev/stderr"
-    next
 }

 # Do any special end of item processing, then print raw data spreadsheet row
@@ -234,7 +238,7 @@
     }

     if (EntityId == "") {
-        missingIDs += 1
+        missingEntityIds += 1
         printf ("==> Missing EntityId for %s %s '%s' in show %s\n", contentType, contentId, title, \
                 showContentId) >> ERROR_FILE
         # Add missing EntityId
@@ -250,20 +254,50 @@
         # Wish I didn't have to do this, but "movie" is too common to be in a key field
         contentType = "tv_movie"
         sortkey = sprintf ("%s (1) %s M%s", title, originalDate, EntityId)
+        # print "movie sortkey = " sortkey  > "/dev/stderr"
     }

     if (contentType == "tv_show") {
-        showTitle = title
+        # print "\ntv_show" > "/dev/stderr"
+        numShows += 1
+        showArray[numShows] = contentId
+        titleArray[numShows] = title
         sortkey = sprintf ("%s (1) S%s", title, EntityId)
+        # print "sortkey = " sortkey > "/dev/stderr"
     }

     if (contentType == "tv_season") {
+        # print "\ntv_season" > "/dev/stderr"
+        for ( i = 1; i <= numShows; i++ ) {
+            if (showArray[i] == showContentId) {
+                showTitle = titleArray[i]
+                break
+            }
+        }
         sortkey = sprintf ("%s (2) S%02d", showTitle, seasonNumber)
+        # print "sortkey = " sortkey  > "/dev/stderr"
+        # Compose title
     }

     if (contentType == "tv_episode") {
+        # xxx
+        # print "\ntv_episode" > "/dev/stderr"
+        for ( i = 1; i <= numShows; i++ ) {
+            if (showArray[i] == showContentId) {
+                showTitle = titleArray[i]
+                break
+            }
+        }
+        # Need to check that showContentId was actually found
+        if (showArray[i] != showContentId) {
+            missingShowContentIds += 1
+            printf ("==> Missing showContentId for %s %s '%s' in show %s\n", contentType, contentId, title, \
+                showContentId) >> ERROR_FILE
+        }
         sortkey = sprintf ("%s (2) S%02dE%03d %s", showTitle, seasonNumber, \
                 episodeNumber, showContentId)
+        # print "sortkey = " sortkey  > "/dev/stderr"
+        # Compose title
     }

     # Copied from above to make it easier to coordinate printing fields
@@ -277,17 +311,16 @@
             showContentId, seasonContentId, seasonNumber, episodeNumber, firstLineNum, lastLineNum)
 }

-# <artwork url="https://us.britbox.com/isl/api/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=45&ImageId='176236'&EntityType='Item'&EntityId='16103'&Width=1920&Height=1080&ResizeAction='fit'" type="tile_artwork" />
-# https://www.britbox.com/us/movie/300_Years_of_French_and_Saunders_16103
-/<item contentType="movie"/,/<\/item>/ {
-    # print
-}
-
 END {
     printf ("In getBBoxCatalogFrom-sitemap.awk\n") > "/dev/stderr"
-    if (missingIDs > 0 ) {
-        missingIDs == 1 ? field = "EntityId" : field = "EntityIds"
-        printf ("    %2d missing %s in %s\n", missingIDs, field, FILENAME) > "/dev/stderr"
+    if (missingEntityIds > 0 ) {
+        missingEntityIds == 1 ? field = "EntityId" : field = "EntityIds"
+        printf ("    %2d missing %s in %s\n", missingEntityIds, field, FILENAME) > "/dev/stderr"
+    }
+    #
+    if (missingShowContentIds > 0 ) {
+        missingShowContentIds == 1 ? field = "showContentId" : field = "showContentIds"
+        printf ("    %2d missing %s in %s\n", missingShowContentIds, field, FILENAME) > "/dev/stderr"
     }
     #
     if (revisedTitles > 0 ) {


fixed bug

fixed bug

--- proto_scripts/client/proto.awk
+++ proto_scripts/client/proto.awk
@@ -31,7 +31,7 @@
 		print pack_code
 		print "\t}"
 		#reader
-		print "\tpublic  static "name" "name"(ByteArray reader){"
+		print "\tpublic  static "name" UnPack(ByteArray reader){"
 		print "\t\t"name " tbl = new " name "();"
 		print unpack_code
 		print "\t\treturn tbl;\n\t}"


Languages: mark as stable: Samoan

Languages: mark as stable: Samoan

--- include/Languages.awk
+++ include/Languages.awk
@@ -291,8 +291,7 @@
     Locale["sd"]["script"]             = "Arab"
     Locale["sd"]["rtl"]                = "true" # RTL language

-    #? Samoan
-    Locale["sm"]["support"]            = "unstable"
+    # Samoan
     Locale["sm"]["name"]               = "Samoan"
     Locale["sm"]["endonym"]            = "Gagana Sāmoa"
     #Locale["sm"]["translations-of"]


Translate: retry using IPv4 if default connection timed out (#287)

--- include/Translate.awk
+++ include/Translate.awk
@@ -76,6 +76,9 @@
         HttpService = "/" inet "/tcp/0/" HttpHost "/" HttpPort
         HttpPathPrefix = ""
     }
+
+    # How long to wait in milliseconds for IPv6 before trying IPv4
+    PROCINFO[HttpService, "READ_TIMEOUT"] = 300
 }

 # Pre-process string (URL-encode before send).
@@ -109,21 +112,32 @@
         header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"

     content = NULLSTR; isBody = 0
-    print header |& HttpService
-    while ((HttpService |& getline) > 0) {
-        if (isBody)
-            content = content ? content "\n" $0 : $0
-        else if (length($0) <= 1)
-            isBody = 1
-        else { # interesting fields in header
-            match($0, /^HTTP[^ ]* ([^ ]*)/, group)
-            if (RSTART) status = group[1]
-            match($0, /^Location: (.*)/, group)
-            if (RSTART) location = squeeze(group[1]) # squeeze the URL!
+    while (1) {
+        print header |& HttpService
+        while ((HttpService |& getline) > 0) {
+            if (isBody)
+                content = content ? content "\n" $0 : $0
+            else if (length($0) <= 1)
+                isBody = 1
+            else { # interesting fields in header
+                match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+                if (RSTART) status = group[1]
+                match($0, /^Location: (.*)/, group)
+                if (RSTART) location = squeeze(group[1]) # squeeze the URL!
+            }
+            l(sprintf("%4s bytes > %s", length($0), $0))
         }
-        l(sprintf("%4s bytes > %s", length($0), $0))
-    }
-    close(HttpService)
+        close(HttpService)
+
+        if (ERRNO == "Connection timed out") {
+            w("[WARNING] " ERRNO ". Retrying IPv4 connection.")
+            Option["ip-version"] = 4
+            initHttpService()
+            PROCINFO[HttpService, "READ_TIMEOUT"] = 0
+            ERRNO = ""
+        } else
+            break
+    }

     if ((status == "301" || status == "302") && location)
         content = curl(location)
@@ -158,21 +172,32 @@
         header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"

     content = NULLSTR; isBody = 0
-    print (header "\r\n" reqBody) |& HttpService
-    while ((HttpService |& getline) > 0) {
-        if (isBody)
-            content = content ? content "\n" $0 : $0
-        else if (length($0) <= 1)
-            isBody = 1
-        else { # interesting fields in header
-            match($0, /^HTTP[^ ]* ([^ ]*)/, group)
-            if (RSTART) status = group[1]
-            match($0, /^Location: (.*)/, group)
-            if (RSTART) location = squeeze(group[1]) # squeeze the URL!
+    while (1) {
+        print (header "\r\n" reqBody) |& HttpService
+        while ((HttpService |& getline) > 0) {
+            if (isBody)
+                content = content ? content "\n" $0 : $0
+            else if (length($0) <= 1)
+                isBody = 1
+            else { # interesting fields in header
+                match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+                if (RSTART) status = group[1]
+                match($0, /^Location: (.*)/, group)
+                if (RSTART) location = squeeze(group[1]) # squeeze the URL!
+            }
+            l(sprintf("%4s bytes > %s", length($0), $0))
         }
-        l(sprintf("%4s bytes > %s", length($0), $0))
-    }
-    close(HttpService)
+        close(HttpService)
+
+        if (ERRNO == "Connection timed out") {
+            w("[WARNING] " ERRNO ". Retrying IPv4 connection.")
+            Option["ip-version"] = 4
+            initHttpService()
+            PROCINFO[HttpService, "READ_TIMEOUT"] = 0
+            ERRNO = ""
+        } else
+            break
+    }

     if (status == "404") {
         e("[ERROR] 404 Not Found")


Adding shell/awk addup function

Adding shell/awk addup function

--- files/home/.pu_addup.awk
+++ files/home/.pu_addup.awk
@@ -1,6 +1,9 @@
 BEGIN {
   split(columns,cols," ")
   for (i = 1; i <= length(cols); i++)
+  if (!multiplier) { multiplier = 1.0 }
+  if (!denominator) { denominator = 0 }
+  coefficient = denominator ? 1/denominator : multiplier
   if (debug) { printf "cols[%d] = %d\n", i, cols[i] }
 }
 {
@@ -12,7 +15,7 @@
 }
 END {
   for (i = 1; i <= length(cols); i++) {
-    if (headers[i]) { printf "%10.1f Mb %10s\n",  sum[i]/1024, headers[i] }
+    if (headers[i]) { printf "%20f %s %s\n",  sum[i] * coefficient, (units ? units : ""), headers[i] }
     else { printf "Column %2d: %20d\n", cols[i], sum[i] }
   }
 }


Help: widen the reference table (<=80 CPL)

--- include/Help.awk
+++ include/Help.awk
@@ -261,36 +261,38 @@
     PROCINFO["sorted_in"] = saveSortedIn

     if (displayName == "endonym") {
-        r = "┌" replicate("─", 23) "┬" replicate("─", 23) "┬" replicate("─", 23) "┐" RS
+        r = "┌" replicate("─", 25) "┬" replicate("─", 25) "┬" replicate("─", 25) "┐" RS
         for (i = 0; i < rows; i++) {
             r = r "│"
             for (j = 0; j < 3; j++) {
                 if (cols[j][i]) {
                     t1 = getDisplay(cols[j][i])
+                    if (length(t1) > 17)
+                        t1 = substr(t1, 1, 14) "..."
                     switch (cols[j][i]) { # fix rendered text width
                     case "he":
-                        t1 = sprintf(" %-18s", t1)
+                        t1 = sprintf(" %-20s", t1)
                         break
                     case "or": case "ur":
-                        t1 = sprintf(" %-17s", t1)
+                        t1 = sprintf(" %-19s", t1)
                         break
                     case "hi": case "gu": case "km": case "kn":
                     case "my": case "ne": case "pa": case "si":
                     case "ta": case "te": case "yi":
-                        t1 = sprintf(" %-16s", t1)
+                        t1 = sprintf(" %-18s", t1)
                         break
                     case "yue":
+                        t1 = sprintf(" %-15s", t1)
+                        break
+                    case "ja": case "ko":
+                        t1 = sprintf(" %-14s", t1)
+                        break
+                    case "zh-CN": case "zh-TW":
                         t1 = sprintf(" %-13s", t1)
                         break
-                    case "ja": case "ko":
-                        t1 = sprintf(" %-12s", t1)
-                        break
-                    case "zh-CN": case "zh-TW":
-                        t1 = sprintf(" %-11s", t1)
-                        break
                     default:
-                        if (length(t1) <= 15)
-                            t1 = sprintf(" %-15s", t1)
+                        if (length(t1) <= 17)
+                            t1 = sprintf(" %-17s", t1)
                     }
                     switch (length(cols[j][i])) {
                     case 1: case 2: case 3: case 4:
@@ -310,21 +312,21 @@
                     }
                     r = r t1 t2
                 } else
-                    r = r sprintf("%23s│", NULLSTR)
+                    r = r sprintf("%25s│", NULLSTR)
             }
             r = r RS
         }
-        r = r "└" replicate("─", 23) "┴" replicate("─", 23) "┴" replicate("─", 23) "┘"
+        r = r "└" replicate("─", 25) "┴" replicate("─", 25) "┴" replicate("─", 25) "┘"
     } else {
-        r = "┌" replicate("─", 23) "┬" replicate("─", 23) "┬" replicate("─", 23) "┐" RS
+        r = "┌" replicate("─", 25) "┬" replicate("─", 25) "┬" replicate("─", 25) "┐" RS
         for (i = 0; i < rows; i++) {
             r = r "│"
             for (j = 0; j < 3; j++) {
                 if (cols[j][i]) {
                     t1 = getName(cols[j][i])
-                    if (length(t1) > 15)
-                        t1 = substr(t1, 1, 12) "..."
-                    t1 = sprintf(" %-15s", t1)
+                    if (length(t1) > 17)
+                        t1 = substr(t1, 1, 14) "..."
+                    t1 = sprintf(" %-17s", t1)
                     switch (length(cols[j][i])) {
                     case 1: case 2: case 3: case 4:
                         t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i])))
@@ -343,11 +345,11 @@
                     }
                     r = r t1 t2
                 } else
-                    r = r sprintf("%23s│", NULLSTR)
+                    r = r sprintf("%25s│", NULLSTR)
             }
             r = r RS
         }
-        r = r "└" replicate("─", 23) "┴" replicate("─", 23) "┴" replicate("─", 23) "┘"
+        r = r "└" replicate("─", 25) "┴" replicate("─", 25) "┴" replicate("─", 25) "┘"
     }
     return r
 }


Main: formatting

Main: formatting

--- include/Main.awk
+++ include/Main.awk
@@ -48,7 +48,10 @@

     # Networking
     Option["proxy"] = ENVIRON["HTTP_PROXY"] ? ENVIRON["HTTP_PROXY"] : ENVIRON["http_proxy"]
-    Option["user-agent"] = ENVIRON["USER_AGENT"] ? ENVIRON["USER_AGENT"] : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 Safari/602.1 Epiphany/3.18.2"
+    Option["user-agent"] = ENVIRON["USER_AGENT"] ? ENVIRON["USER_AGENT"] :
+        "Mozilla/5.0 (X11; Linux x86_64) "                   \
+        "AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 " \
+        "Safari/602.1 Epiphany/3.18.2"

     # Interactive shell
     Option["no-rlwrap"] = 0


POSIX { and delete
TODO: still not POSIX compatible due to "match()"

git-svn-id: 88e1a00e4eab3b0bb0c09889526309a3e2f5bd8a@23 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

--- mkstructinfo.awk
+++ mkstructinfo.awk
@@ -2,7 +2,6 @@
 # vim:ts=4:sw=4
 BEGIN {
 	brace = 0;
-	delete buffer;
 	buffer_len = 0;
 }
 /^}.*;/ {
@@ -33,14 +32,16 @@
 		printf "define(`COUNTOF_%s', `%s')\n", instruct, i;
 		printf "define(`SIZEOF_%s', `(  %s  )')\n", instruct, elm;
 		print "\n";
-		delete buffer;
+		for (i in buffer) {
+			delete buffer[i];
+		}
 		buffer_len = 0;
 		instruct = 0;
 	}
 	next;
 }

-/.{/ {
+/.\{/ {
 	brace = brace + 1;
 }
 /.}/ {
@@ -75,13 +76,13 @@
 	typedefs[$3] = $4;
 	next;
 }
-/^typedef struct .*{/ {
+/^typedef struct .*\{/ {
 	brace = 1;
 	instruct = 1;
 	next;
 }

-/^struct .*{/ {
+/^struct .*\{/ {
 	instruct = $2;
 	brace = 1;
 	next;


Minor rewording

Minor rewording

--- verifyBBoxDownloadsFrom-webscraper.awk
+++ verifyBBoxDownloadsFrom-webscraper.awk
@@ -38,9 +38,9 @@
         seasonField = fields[7]
         episodeField = fields[9]
         if (seasonField == "") {
-            print "==> " target " missing Seasons field in " SEASONS_SORTED_FILE \
+            print "==> " target " (blank Seasons field in " SEASONS_SORTED_FILE ")" \
                 > "/dev/stderr"
-            print "    " unquotedTarget " missing Seasons field in " SEASONS_SORTED_FILE \
+            print "    " unquotedTarget " (blank Seasons field in " SEASONS_SORTED_FILE ")" \
                 >> TEMP_FILE
             continue
         }


- check unused

- check unused

--- scripts/modpost.awk
+++ scripts/modpost.awk
@@ -571,7 +571,7 @@
 	} else cache_dirty = 1
     } else if (sym in mapsrcs) { src = mapsrcs[sym] }
 }
-function set_symbol(sym, mod, crc, expt, set, pos, own, src, from)
+function set_symbol(sym, mod, crc, expt, set, pos, own, src, use, from)
 {
     if (!(sym in syms)) {
 	syms[sym] = 1
@@ -671,6 +671,15 @@
 	    }
 	} else cache_dirty = 1
     } else if (sym in srcs) { src = srcs[sym] }
+    if (use) {
+	if (sym in uses) {
+	    if (uses[sym] != use) {
+		uses[sym] = use
+		cache_dirty = 1
+	    }
+	} else cache_dirty = 1
+	uses[sym] = use
+    } else if (use in uses) { use = uses[sym] }
 }
 function set_symset(set, hash, numb, ssym, scrc, own, src, from,	n,i,symbols)
 {
@@ -747,26 +756,146 @@
 	cache_dirty = 1
     }
 }
-#
-# Read in an objdump -t listing.  This must be from objdump -t run on a kernel
-# object.  This will add EXPORT_SYMBOL or EXPORT_SYMBOL_GPL for use in the
-# Module.symvers file.
-#
-function read_modobject(command, dir, own, src,	    result,files,progress,HEADER,mod,flags,val,sec,ofs,sym,count_syms,count_unds,count_weak)
-{
-    print_vinfo(1,"r: ko object, subdirectory = \"" dir "\"")
+function read_modobject(command, dir, own, src,
+			pfx,fmt,files,progress,SECTION,string,mod,count_syms,count_unds,
+			count_weak,count_vers,flags,val,sec,offset,sym,crc,char)
+{
+    pfx = "r: ko object, "
+    fmt = "%3d syms, %3d unds, %3d weak, %3d vers"
+    print_vinfo(1, pfx "subdirectory = \"" dir "\"")
     files = 0
     progress = 0
-    HEADER = 1
+    SECTION = ""
+    string = ""
     mod = ""
-    count_syms = 0; count_unds = 0; count_weak = 0
-    while ((result = (command | getline)) == 1) {
-	if (HEADER) {
+    count_syms = 0; count_unds = 0; count_weak = 0; count_vers = 0
+    # use objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -s
+    while ((command | getline) == 1) {
+	if (SECTION) {
+	    if (/^$/) {
+		print_dmore(1,pfx sprintf(fmt, count_syms, count_unds, count_weak, count_vers))
+		if (SECTION) {
+		    print_debug(2,pfx "end of section " SECTION)
+		    if (count_syms||count_unds||count_weak||count_vers)
+			print_debug(2,pfx sprintf(fmt, count_syms, count_unds, count_weak, count_vers))
+		}
+		SECTION = ""
+		continue
+	    }
+	    if (SECTION == "SYMBOL TABLE") {
+		if (NF<4)
+		    continue
+		flags = substr($0, length($1)+2, 7)
+		val = $1; sec = $(NF-2); offset = $(NF-1); sym = $NF
+		if (substr(flags,1,1) == "l") {
+		    if (substr(flags,7,1) == "O") {
+			if (sec == ".modinfo") {
+			    if (sym ~ /^_?__mod_version[0-9]*$/)
+				mod_vers[mod] = 1
+			    continue
+			}
+			if (sub(/^_?__ksymtab/,"",sec)) {
+			    if (sub(/^_?__ksymtab_/,"",sym)) {
+				print_debug(3,pfx "symbol: " sym)
+				set_symbol(sym, mod, "", "EXPORT_SYMBOL" toupper(sec), "", 0, own, "", 0, "ko object")
+				count_syms++
+			    }
+			    continue
+			}
+		    }
+		    continue
+		}
+		if (sec == "*ABS*") {
+		    if (substr(flags,1,1) == "g") {
+			if (sub(/^_?__crc_/,"",sym)) {
+			    print_debug(3,pfx "symbol: " sym)
+			    set_symbol(sym, mod, "0x" val, "", "", 0, own, src, 0, "ko object")
+			    count_syms++
+			    continue
+			}
+		    }
+		    mod_abss[mod,sym] = 1
+		}
+		if (own != values["pkgdirectory"])
+		    continue
+		if (sec == "*UND*") {
+		    if (sym ~ /^_?__this_module$/) {
+			if (mod in mod_this)
+			    delete mod_this[mod]
+			continue
+		    }
+		    if (substr(flags,2,1) == " " && !((mod,sym) in mod_unds)) {
+			print_debug(3,pfx "undefined symbol: " sym)
+			mod_unds[mod,sym] = 1
+			count_unds++
+		    }
+		    if (substr(flags,2,1) == "w" && !((mod,sym) in mod_weak)) {
+			print_debug(3,pfx "weakundef symbol: " sym)
+			mod_weak[mod,sym] = 1
+			count_weak++
+		    }
+		    continue
+		}
+		if (sym ~ /^_?init_module$/) {
+		    mod_init[mod] = 1
+		    print_debug(2,pfx "module " mod " has init_module")
+		    continue
+		}
+		if (sym ~ /^_?cleanup_module$/) {
+		    mod_exit[mod] = 1
+		    print_debug(2,pfx "module " mod " has cleanup_module")
+		    continue
+		}
+		if (sym ~ /^_?__this_module$/) {
+		    mod_this[mod] = 1
+		    print_debug(2,pfx "module " mod " has this_module")
+		    continue
+		}
+		if (sym ~ /^_?__mod_version[0-9]*$/) {
+		    mod_vers[mod] = 1
+		    print_debug(2,pfx "module " mod " has mod_version")
+		    continue
+		}
+	    } else
+	    if (SECTION == "__versions") {
+		sub(/^ .... /, ""); sub(/  .*$/, ""); gsub(/ /, "")
+		string = string $0
+		if (length(string) < 128)
+		    continue
+		sub(/(00)+$/, "",string)
+		crc = "0x" substr(string,7,2) substr(string,5,2) substr(string,3,2) substr(string,1,2)
+		sub(/^......../, "", string)
+		if (crc == "0x00000000")
+		{ crc = "0x" substr(string,1,8); sub(/^......../,"",string) }
+		sub(/^00000000/, "", string)
+		sym = ""
+		while (string) {
+		    char = "0x" substr(string,1,2)
+		    sub(/^../, "", string)
+		    char = strtonum(char)
+		    if (32 <= char && char <= 126)
+			sym = sym sprintf("%c", char)
+		}
+		# really just want to mark symbol used and check crc
+		set_symbol(sym, "", crc, "", "", 0, "", src, 1, "ko object")
+		count_vers++
+	    }
+	    # skip __ksymtab and __ksymtab_gpl sections
+	} else {
 	    if (/^$/)
 		continue
-	    if (/:.*file format/) {
-		sub(/:.*$/, "")
-		print_debug(1,"r: ko object, module = " $0)
+	    if (sub(/:.*file format.*$/, "")) {
+		if (mod) {
+		    count_syms = 0; count_unds = 0; count_weak = 0; count_vers = 0
+		    mod_mods[mod] = 1
+		    if (progress >= 200) {
+			print_dmore(1,pfx files "kernel modules...")
+			progress = 0
+		    }
+		    files++
+		    progress++
+		}
+		print_debug(1,pfx "module = " $0)
 		sub(/(\.mod)?\.(k)?o(\.gz)?$/, "")
 		if (own == values["pkgdirectory"]) {
 		    sub(/.*\//, "")
@@ -779,6 +908,7 @@
 		    sub(/kernel\//, "")
 		}
 		mod = $0
+		print_debug(1,pfx mod)
 		if (own == values["pkgdirectory"]) {
 		    if (("vmlinux","struct_module") in mod_syms) {
 			mod_unds[mod,"struct_module"] = 1
@@ -791,104 +921,23 @@
 		continue
 	    }
 	    if (/SYMBOL TABLE:/) {
-		count_syms = 0; count_unds = 0; count_weak = 0
-		mod_mods[mod] = 1
-		HEADER = 0
-		if (progress >= 200) {
-		    print_dmore(1,"r: ko object, " files " kernel modules...")
-		    progress = 0
-		}
-		files++
-		progress++
+		SECTION = "SYMBOL TABLE"
 		continue
 	    }
-	}
-	if (/^$/ && !HEADER) {
-	    HEADER = 1
-	    if (count_syms || count_unds || count_weak) {
-		print_debug(1,"r: ko object, " mod)
-		print_debug(1,"r: ko object, syms " count_syms ", unds " count_unds ", weak " count_weak)
-	    }
-	    continue
-	}
-	# ok we have a listing line
-	# The flags are just after the first field and consist of 7 characters
-	# The last three fields always contain the same information
-	if (NF<4)
-	    continue
-	flags = substr($0, length($1)+2, 7); val = $1; sec = $(NF-2); ofs = $(NF-1); sym = $NF
-	if (substr(flags,1,1) == "l") {
-	    if (substr(flags,7,1) == "O") {
-		if (sec == ".modinfo") {
-		    if (sym ~ /^_?__mod_version[0-9]*$/)
-			mod_vers[mod] = 1
-		    continue
-		}
-		if (sub(/^_?__ksymtab/,"",sec)) {
-		    if (sub(/^_?__ksymtab_/,"",sym)) {
-			print_debug(3,"r: ko object, symbol: " sym)
-			set_symbol(sym, mod, "", "EXPORT_SYMBOL" toupper(sec), "", 0, own, "", "ko object")
-			count_syms++
-		    }
-		    continue
-		}
-	    }
-	    continue
-	}
-	if (sec == "*ABS*") {
-	    if (substr(flags,1,1) == "g") {
-		if (sub(/^_?__crc_/,"",sym)) {
-		    print_debug(3,"r: ko object, symbol: " sym)
-		    set_symbol(sym, mod, "0x" val, "", "", 0, own, src, "ko object")
-		    count_syms++
-		    continue
-		}
-	    }
-	    mod_abss[mod,sym] = 1
-	}
-	if (own != values["pkgdirectory"])
-	    continue
-	if (sec == "*UND*") {
-	    if (sym ~ /^_?__this_module$/) {
-		if (mod in mod_this)
-		    delete mod_this[mod]
+	    if (sub(/^Contents of section /,"")) {
+		sub(/:.*$/, "")
+		SECTION = $0
+		string = ""
 		continue
 	    }
-	    if (substr(flags,2,1) == " " && !((mod,sym) in mod_unds)) {
-		print_debug(3,"r: ko object, undefined symbol: " sym)
-		mod_unds[mod,sym] = 1
-		count_unds++
-	    }
-	    if (substr(flags,2,1) == "w" && !((mod,sym) in mod_weak)) {
-		print_debug(3,"r: ko object, weakundef symbol: " sym)
-		mod_weak[mod,sym] = 1
-		count_weak++
-	    }
-	    continue
-	}
-	if (sym ~ /^_?init_module$/) {
-	    mod_init[mod] = 1
-	    print_debug(2,"r: ko object, module " mod " has init_module")
-	    continue
-	}
-	if (sym ~ /^_?cleanup_module$/) {
-	    mod_exit[mod] = 1
-	    print_debug(2,"r: ko object, module " mod " has cleanup_module")
-	    continue
-	}
-	if (sym ~ /^_?__this_module$/) {
-	    mod_this[mod] = 1
-	    print_debug(2,"r: ko object, module " mod " has this_module")
-	    continue
-	}
-	if (sym ~ /^_?__mod_version[0-9]*$/) {
-	    mod_vers[mod] = 1
-	    print_debug(2,"r: ko object, module " mod " has mod_version")
-	    continue
-	}
-    }
-    if (result != -1) close(command)
-    print_vinfo(1,"r: ko object, " files " kernel modules   ")
+	}
+	# print stats
+    }
+    close(command)
+    if (SECTION)
+	print_debug(1,pfx sprintf(fmt, count_syms, count_unds, count_weak, count_vers))
+    print_debug(1,pfx files "kernel modules   ")
+    # print end of run info
 }
 #
 # Read in any nm -Bs listing.  This can be a System.map file, a Modules.map
@@ -920,7 +969,7 @@
 	    }
 	    if (sub(/^_?__ksymtab_/,"",sym)) {
 		print_debug(3,"r: systemmap, symbol: " sym)
-		set_symbol(sym, mod, "", "", "", 0, own, "", "systemmap")
+		set_symbol(sym, mod, "", "", "", 0, own, "", 0, "systemmap")
 		count_syms++
 		continue
 	    }
@@ -928,7 +977,7 @@
 	if (flag ~ /[Aa]/) {
 	    if (sub(/^_?__crc_/,"",sym)) {
 		print_debug(3,"r: systemmap, symbol: " sym)
-		set_symbol(sym, mod, "0x" val, "", "", 0, own, src, "systemmap")
+		set_symbol(sym, mod, "0x" val, "", "", 0, own, src, 0, "systemmap")
 		count_syms++
 		continue
 	    }
@@ -997,8 +1046,8 @@
 		} else
 		if (fields[1] == "sym") {
 		    if (n<3) { print_error("syntax error in cachefile: line = \"" line "\""); continue }
-		    for (i=9;i>n;i--) { fields[i] = "" }; n = 9
-		    set_symbol(fields[2],fields[3],fields[4],fields[5],fields[6],fields[7],fields[8],fields[9],"cachefile")
+		    for (i=10;i>n;i--) { fields[i] = "" }; n = 10
+		    set_symbol(fields[2],fields[3],fields[4],fields[5],fields[6],fields[7],fields[8],fields[9],fields[10],"cachefile")
 		} else
 		if (fields[1] == "set") {
 		    if (n<3) { print_error("syntax error in cachefile: line = \"" line "\""); continue }
@@ -1037,6 +1086,7 @@
 	line = line ":"; if (sym in posn) { line = line posn[sym] }
 	line = line ":"; if (sym in ownr) { line = line ownr[sym] }
 	line = line ":"; if (sym in srcs) { line = line srcs[sym] }
+	line = line ":"; if (sym in uses) { line = line uses[sym] }
 	print line > file; count_syms++; written[file] = 1
     }
     for (set in setsets) {
@@ -1075,7 +1125,7 @@
     }
     if (NF < 3) $3 = "vmlinux"
     if (NF < 4) $4 = ""
-    set_symbol($2, $3, $1, $4, "", 0, own, src, "dumpfiles")
+    set_symbol($2, $3, $1, $4, "", 0, own, src, 0, "dumpfiles")
 }
 function read_dumpfiles(command, own, src)
 {
@@ -1090,10 +1140,10 @@
 {
     print_vinfo(1,"r: moduledir, directory = \"" directory "\"")
     dir = "kernel"
-    command = "find " directory "/" dir " -type f -name '*.ko' 2>/dev/null | xargs -r objdump -t"
+    command = "find " directory "/" dir " -type f -name '*.ko' 2>/dev/null | xargs -r objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -s"
     read_modobject(command, dir, "kernel", src)
     dir = values["pkgdirectory"]
-    command = "find " directory "/" dir " -type f -name '*.ko' 2>/dev/null | xargs -r objdump -t"
+    command = "find " directory "/" dir " -type f -name '*.ko' 2>/dev/null | xargs -r objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -s"
     read_modobject(command, dir, values["pkgdirectory"], "pkgdirectory")
 }
 function read_mymodules(modules, src,    i,pair,ind,base,name,sym,fmt) {
@@ -1102,7 +1152,7 @@
     for (i = 1; i in modules; i++)
 	print modules[i] > "modvers.list"
     close("modvers.list")
-    command = "cat modvers.list | xargs objdump -t "
+    command = "cat modvers.list | xargs objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -s"
     read_modobject(command, ".", values["pkgdirectory"], src)
     system("rm -f modvers.list")
     # double check
@@ -1127,12 +1177,21 @@
 	    }
 	    continue
 	}
+	if (!(sym in uses) || !uses[sym]) {
+	    if (ownr[sym] != values["pkgdirectory"]) {
+		if (values["unused"])
+		    print_warns(sprintf(fmt, base, "unused", sym))
+		else
+		    print_error(sprintf(fmt, base, "unused", sym))
+	    }
+	}
 	if (!(sym in kabi) && values["kabi"]) {
-	    if (ownr[sym] != values["pkgdirectory"])
+	    if (ownr[sym] != values["pkgdirectory"]) {
 		if (values["unsupported"])
 		    print_vinfo(1,sprintf(fmt, base, "unsupportd", sym))
 		else
 		    print_error(sprintf(fmt, base, "unsupportd", sym))
+	    }
 	}
 	if (!(sym in crcs)) {
 	    print_error("r: mymodules, symbol " sym " defined in module " mods[sym] " has no version")
@@ -1158,6 +1217,14 @@
 		    print_error(sprintf(fmt, base, "weak unexp", sym))
 	    }
 	    continue
+	}
+	if (!(sym in uses) || !uses[sym]) {
+	    if (ownr[sym] != values["pkgdirectory"]) {
+		if (values["unused"])
+		    print_vinfo(1,sprintf(fmt, base, "weak unuse", sym))
+		else
+		    print_warns(sprintf(fmt, base, "weak unuse", sym))
+	    }
 	}
 	if (!(sym in kabi) && values["kabi"]) {
 	    if (ownr[sym] != values["pkgdirectory"]) {
@@ -1246,7 +1313,7 @@
 		    print_debug(4,"r: syssymset,         pos = \"" pos "\"")
 		    print_debug(4,"r: syssymset,         own = \"" own "\"")
 		    print_debug(5,"r: syssymset,         src = \"" src "\"")
-		    set_symbol($2, $3, $1, $4, set, pos, own, src, "syssymset")
+		    set_symbol($2, $3, $1, $4, set, pos, own, src, 0, "syssymset")
 		    n++
 		} else { unrecog(fnlp, $0); continue }
 	    }
@@ -1408,7 +1475,7 @@

 	for (pos=1;pos<=n;pos++) {
 	    sym = symbols[pos]
-	    set_symbol(sym, "", "", "", set "." hash, pos, "", "", "missedset")
+	    set_symbol(sym, "", "", "", set "." hash, pos, "", "", 0, "missedset")
 	    count_syms++
 	}
 	delete setnumb[set]
@@ -1824,6 +1891,7 @@
     longopts["rip-weak"     ] = "R"  ;								   defaults["rip-weak"     ] = 1						; descrips["rip-weak"     ] = "attempt to rip weak undefined symbols from system map (requires -F, implies -U)"
     longopts["unres-weak"   ] = "b"  ;								   defaults["unres-weak"   ] = 1						; descrips["unres-weak"   ] = "allow unresolved weak symbols"
     longopts["unsupported"  ] = "U"  ;								   defaults["unsupported"  ] = 1						; descrips["unsupported"  ] = "permit use of (strong) unsupported (non-ABI) kernel exports"
+    longopts["unused"       ] = "y"  ;								   defaults["unused"       ] = 1						; descrips["unused"       ] = "permit use of (strong) unused kernel exports"
     longopts["weak-symbols" ] = "w"  ;								   defaults["weak-symbols" ] = 1						; descrips["weak-symbols" ] = "resolve weak symbols (useful with -r and -U)"
     longopts["weak-versions"] = "W"  ;								   defaults["weak-versions"] = 1						; descrips["weak-versions"] = "version weak symbols (useful with -w)"
     longopts["weak-hidden"  ] = "H"  ;								   defaults["weak-hidden"  ] = 0						; descrips["weak-hidden"  ] = "weak symbol versions are hidden (used with -W)"
@@ -1852,6 +1920,7 @@
     values["rip-weak"     ] = defaults["rip-weak"     ]
     values["unres-weak"   ] = defaults["unres-weak"   ]
     values["unsupported"  ] = defaults["unsupported"  ]
+    values["unused"       ] = defaults["unused"       ]
     values["weak-symbols" ] = defaults["weak-symbols" ]
     values["weak-versions"] = defaults["weak-versions"]
     values["weak-hidden"  ] = defaults["weak-hidden"  ]


Tighten up the schedule parsing.

Tighten up the schedule parsing.

Now that it has some arrays in there, more guff turns up.


The assertions generated to test VFS locking never included checks
for vnodes reached through double indirection (i.e. **vpp). This
is worked-around by special-casing the identifier "vpp" (adding one
level of indirection).

The alternative fix mentioned in the PR had required substantial
changes to this script.

In case there are locking violations that had been hidden without
this patch, they may suddenly show up, now ...

This change does not affect code compiled without DEBUG_VFS_LOCKS.

PR:		kern/46652

--- sys/tools/vnode_if.awk
+++ sys/tools/vnode_if.awk
@@ -65,6 +65,8 @@

 function add_debug_code(name, arg, pos)
 {
+	if (arg == "vpp")
+		arg = "*vpp";
 	if (lockdata[name, arg, pos]) {
 		printh("\tASSERT_VI_UNLOCKED("arg", \""uname"\");");
 		# Add assertions for locking


Restore the comment that I removed by accident.

The comment still applies to this block of code.

--- sys/tools/makeobjops.awk
+++ sys/tools/makeobjops.awk
@@ -306,6 +306,7 @@
 	printh(format_line(prototype argument_list ");",
 	    line_width, length(prototype)));

+	# Print out the method desc
 	printc("struct kobjop_desc " mname "_desc = {");
 	printc("\t0, { &" mname "_desc, (kobjop_t)" default_function " }");
 	printc("};\n");


OOO330

--- solenv/bin/addsym.awk
+++ solenv/bin/addsym.awk
@@ -26,16 +26,29 @@
 #*************************************************************************

 # Add certain symbol patterns to the first global section.
+#
+# The below code fails with 'perverted' mapfiles (using a strange line layout,
+# or containing version UDK_3_0_0 without a global section, ...).

 BEGIN { state = 0 }
-/\{/ && state == 1 { exit 1 } #TODO: print error explanation to stderr?
-/^[\t ]*UDK_3_0_0[\t ]*\{/ && state == 0 { state = 1 }
-/^[\t ]*global[\t ]*:/ && state == 1 { state = 2 }
-{ print }
+END {
+    if (state == 0) {
+        print "# Weak RTTI symbols for C++ exceptions:"
+        print "UDK_3_0_0 {"
+        print "global:"
+        print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
+        if (ENVIRON["USE_SYSTEM_STL"] != "YES")
+            print "_ZN4_STL7num_put*; # for STLport"
+        print "};"
+    }
+}
 state == 2 {
     print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
     if (ENVIRON["USE_SYSTEM_STL"] != "YES")
         print "_ZN4_STL7num_put*; # for STLport"
     state = 3
 }
-END { if (state != 3) exit 1 } #TODO: print error explanation to stderr?
+# #i66636# - ???
+/^[\t ]*UDK_3_0_0[\t ]*\{/ { state = 1 }
+/^[\t ]*global[\t ]*:/ && state == 1 { state = 2 }
+{ print }


fixed eparams for new version bug - was referencing old dataset

--- bin/util/update-e-params-subject-discrim.awk
+++ bin/util/update-e-params-subject-discrim.awk
@@ -18,6 +18,12 @@
       # Change subject to name of layer dataset itself.
       printf("<%s/source/%s/dataset/%s/version/%s/conversion/enhancement/%s>\n",baseURI,sourceID,dataset_identifier,datasetVersion,layerID);

+   }else if( /^</ && /source\// && /dataset\// && /version\// && /conversion\// && /enhancement\/[^\/]*>/ ) {
+      # <http://logd.tw.rpi.edu/source/lebot/dataset/golfers/version/2012-Mar-11/conversion/enhancement/1>
+      # becomes
+      # <http://logd.tw.rpi.edu/source/lebot/dataset/golfers/version/2012-Mar-15/conversion/enhancement/1>
+      sub(/version\/[^\/]*/,"version/"datasetVersion);
+      print $0
    }else if( $0~"conversion:subject_discriminator *\"" ) {
       printf("      conversion:subject_discriminator \"%s\";\n",subjectDiscriminator)


tests: fix build with awk that does not support switch-case

The switch-case statement is a gawk-specific feature which is not
necessarily available, let's use traditional if-else statements instead.

* tests/uid.awk: Rewrite without switch-case statements.

--- tests/uid.awk
+++ tests/uid.awk
@@ -12,53 +12,43 @@

 {
   if (match($0, regexp, a)) {
-    switch (expected) {
-      case "getuid":
-        uid = a[1]
-        expected = "setuid"
-        regexp = "^setuid" suffix "\\(" uid "\\)[[:space:]]+= 0$"
-        next
-      case "setuid":
-        expected = "getresuid"
-        regexp = "^getresuid" suffix "\\(\\[" uid "\\], \\[" uid "\\], \\[" uid "\\]\\)[[:space:]]+= 0$"
-        next
-      case "getresuid":
-        expected = "setreuid"
-        regexp = "^setreuid" suffix "\\(-1, -1\\)[[:space:]]+= 0$"
-        next
-      case "setreuid":
-        expected = "setresuid"
-        regexp = "^setresuid" suffix "\\(-1, " uid ", -1\\)[[:space:]]+= 0$"
-        next
-      case "setresuid":
-        expected = "chown"
-        regexp = "^chown" suffix "\\(\".\", -1, -1\\)[[:space:]]+= 0$"
-        next
-      case "chown":
-        expected = "1st getgroups"
-        regexp = "^getgroups" suffix "\\(0, NULL\\)[[:space:]]+= " r_uint "$"
-        next
-      case "1st getgroups":
-        ngroups = a[1]
-        switch (ngroups) {
-          case "0": list=""; break
-          case "1": list=r_uint; break
-          default: list=r_uint "(, " r_uint "){" (ngroups - 1) "}"
-        }
-        expected = "2nd getgroups"
-        regexp = "^getgroups" suffix "\\(" ngroups ", \\[" list "\\]\\)[[:space:]]+= " ngroups "$"
-        next
-      case "2nd getgroups":
-        expected = "the last line"
-        regexp = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
-        next
-      case "the last line":
-        expected = "nothing"
-        regexp = ""
-        next
+    if (expected == "getuid") {
+      uid = a[1]
+      expected = "setuid"
+      regexp = "^setuid" suffix "\\(" uid "\\)[[:space:]]+= 0$"
+    } else if (expected == "setuid") {
+      expected = "getresuid"
+      regexp = "^getresuid" suffix "\\(\\[" uid "\\], \\[" uid "\\], \\[" uid "\\]\\)[[:space:]]+= 0$"
+    } else if (expected == "getresuid") {
+      expected = "setreuid"
+      regexp = "^setreuid" suffix "\\(-1, -1\\)[[:space:]]+= 0$"
+    } else if (expected == "setreuid") {
+      expected = "setresuid"
+      regexp = "^setresuid" suffix "\\(-1, " uid ", -1\\)[[:space:]]+= 0$"
+    } else if (expected == "setresuid") {
+      expected = "chown"
+      regexp = "^chown" suffix "\\(\".\", -1, -1\\)[[:space:]]+= 0$"
+    } else if (expected == "chown") {
+      expected = "1st getgroups"
+      regexp = "^getgroups" suffix "\\(0, NULL\\)[[:space:]]+= " r_uint "$"
+    } else if (expected == "1st getgroups") {
+      ngroups = a[1]
+      if (ngroups == "0")
+        list=""
+      else if (ngroups == "1")
+        list=r_uint
+      else
+        list=r_uint "(, " r_uint "){" (ngroups - 1) "}"
+      expected = "2nd getgroups"
+      regexp = "^getgroups" suffix "\\(" ngroups ", \\[" list "\\]\\)[[:space:]]+= " ngroups "$"
+    } else if (expected == "2nd getgroups") {
+      expected = "the last line"
+      regexp = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
+    } else if (expected == "the last line") {
+      expected = "nothing"
+      regexp = ""
     }
   }
-  next
 }

 END {


Commons: add ansi(code, text)

Commons: add ansi(code, text)

--- include/Commons.awk
+++ include/Commons.awk
@@ -248,19 +248,33 @@
     AnsiCode["white"]         = "\33[97m"
 }

+# Return ANSI escaped string.
+function ansi(code, text) {
+    switch (code) {
+    case "bold":
+        return AnsiCode[code] text AnsiCode["no bold"]
+    case "underline":
+        return AnsiCode[code] text AnsiCode["no underline"]
+    case "negative":
+        return AnsiCode[code] text AnsiCode["positive"]
+    default:
+        return AnsiCode[code] text AnsiCode[0]
+    }
+}
+
 # Print warning message.
 function w(text) {
-    print AnsiCode["yellow"] text AnsiCode[0] > "/dev/stderr"
+    print ansi("yellow", text) > "/dev/stderr"
 }

 # Print error message.
 function e(text) {
-    print AnsiCode["red"] AnsiCode["bold"] text AnsiCode[0] > "/dev/stderr"
+    print ansi("red", text) > "/dev/stderr"
 }

 # Print debugging message.
 function d(text) {
-    print AnsiCode["gray"] text AnsiCode[0] > "/dev/stderr"
+    print ansi("gray", text) > "/dev/stderr"
 }

 # Log an array.


Remove line count from commit line, since it's variable.

Consistently treat dates as seconds * 10.

--- make/log_to_changelog.awk
+++ make/log_to_changelog.awk
@@ -46,8 +46,16 @@

 		#The commit line
 		gline()
+		author=substr($6, 1, length($6)-1)
+
+		#Remove the variable line count.
+		if($9 == "lines:")
+		{
+			$10 = ""
+			$11 = ""
+		}
+		$0=$0
 		commit_line=$0
-		author=substr($6, 1, length($6)-1)

 		#Store the date* 10 for extra precision
 		date = $2" "$3
@@ -126,7 +134,7 @@
 			for(j=i-1; j>0 &&
 					   author==line_to_author[date_to_line[sorted_dates[j]]] &&
 					   message==line_to_message[date_to_line[sorted_dates[j]]] &&
-					   date - sorted_dates[j] < 20; j--)
+					   date - sorted_dates[j] < 100; j--)
 			{
 				#Reset i, so that the fragment appears once only.
 				i=j
@@ -136,7 +144,7 @@
 				rev_list=rev_list " " line_to_revision[date_to_line[sorted_dates[j]]];

 				#Make a note of teh concatenations
-				concatenation=concatenation ", " date - sorted_dates[j] "s"
+				concatenation=concatenation ", " (date - sorted_dates[j])/10 "s"
 				num_concat++
 			}


comments, & missing quote

comments, & missing quote

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -18,7 +18,7 @@

 function usage(){
-	print "usage: ntriple2dot.awk curie_map.yaml rdf.nt > rdf.dot"
+	print "usage: ntriple2dot.awk prefix_baseurl.yaml rdf.nt > dot.gv"
 }

 ##########################################################
@@ -93,7 +93,7 @@
 	# exceptions
 	prefix["BNODE"]="BNODE"  # is a fixed point
 	prefix["https://monarchinitiative.org/.well-known/genid"]="BNODE"
-	prefid["https_archive_monarchinitiative_org_"]="MonarchArchive
+	prefid["https_archive_monarchinitiative_org_"]="MonarchArchive"
 	############################################################
 	# Often re-visit whether these exceptions are still necessary
 	# they may have been moved into the curie prefix mapping file
@@ -102,7 +102,7 @@

 	# in mgi
 	prefix["https://www.mousephenotype.org"]="IMPC"
-    # in IMPC (not httpS)
+	# in IMPC (not httpS)
 	prefix["http://www.mousephenotype.org"]="IMPC"
 	# note in curie_map IMPC is:
 	# http://www.mousephenotype.org/data/genes/


do not show empty lines

do not show empty lines

--- tests/filter.awk
+++ tests/filter.awk
@@ -4,4 +4,8 @@
 /^->Loading import/ {next}
 /^loading / {next}

+# empty lines are dull
+#
+/^ *$/ {next}
+
 {print}


Yet another messy commit; this time making a start on getting labels in decent positions.

--- share/bin/plain2mp.awk
+++ share/bin/plain2mp.awk
@@ -6,20 +6,33 @@

 # Only intended to consume Dot generated from libfsm's .dot output,
 # and not graphviz diagrams in general.
-
-# graph 1 5.75 0.93056
-# node start 0.15278 0.41667 0.30556 0.5 "" solid none black lightgrey
-# node S6 0.97222 0.41667 0.30556 0.30556 "" solid circle black lightgrey
-# node S1 5.5417 0.20833 0.41667 0.41667 "" solid doublecircle black lightgrey
-# edge S3 S6 10 3.5244 0.20119 3.2727 0.19014 2.7322 0.17358 2.2778 0.20833 1.873 0.23929 1.7755 0.28067 1.375 0.34722 1.3389 0.35322 1.3009 0.35974 1.2635 0.3663 <ε> 2.3264 0.3125 solid black
-# edge S3 S2 4 3.835 0.20833 3.9555 0.20833 4.1328 0.20833 4.2831 0.20833 <y> 4.1319 0.3125 solid black
-# stop

 function sname(s)
 {
 	if (s == "start") {
 		return "S0";
 	}
+
+	return s;
+}
+
+# TODO: convert label from graphviz's html to a utf8
+# This is either <xyz> or abc (with no quotes)
+function slabel(s)
+{
+	# XXX: placeholder
+	if (s == "<>") {
+		return "";
+	}
+	if (s == "\"\"") {
+		return "";
+	}
+
+# XXX: placeholder
+gsub(/ε/, "e", s); # XXX: why not?
+gsub(/"/, "", s)
+gsub(/</, "", s)
+gsub(/>/, "", s)

 	return s;
 }
@@ -41,6 +54,15 @@

 	print "ahlength := 10bp;"
 	print "ahangle  := 45;"
+
+#	print "secondarydef v projectedalong w =";
+#	print "	if pair(v) and pair(w):";
+#	print "		(v dotprod w) / (w dotprod w) * w";
+#	print "	else:";
+#	print "		errmessage \"arguments must be pairs\"";
+#	print "	fi";
+#	print "enddef;";
+
 }

 /^graph / {
@@ -55,17 +77,29 @@
 	y      = $4;
 	width  = $5;
 	height = $6;
-	label  = $7;
+	label  = slabel($7);
 	style  = $8;
 	shape  = $9;
 	# TODO: label delimited by <>, may contain spaces

-	printf "\tl%s := 0;", name
+	printf "\tl%s := 0;\n", name

 	printf "\t%s := (%fin, %fin);\n", name, x, y

+# TODO: when plotting in graphviz, assume all nodes have the same width (not zero!). enough for "SXX" perhaps
+# that should align them all on the same centre line. and pass fixedsize=true
+
 	# TODO: explain this is diameter
-	printf "\td%s = %fin * 0.75;\n", name, (height + width) / 2;
+	# TODO: store 8bp as a constant somewhere
+# TODO: explain we take diameter from label presence and endstateness.
+# ignore graphviz height and width, because it scales with label width and that looks bad for S1 vs S5
+	diam = 0.3 + length(label) * 0.05;
+
+	if (shape == "doublecircle") {
+		printf "\td%s = %fin + 8bp;\n", name, diam;
+	} else {
+		printf "\td%s = %fin;\n", name, diam;
+	}

 	if (shape == "doublecircle") {
 # TODO: would rather && together paths to n%s or somesuch
@@ -76,6 +110,10 @@

 	if ($2 != "start") {
 		printf "\tdraw n%s withpen pencircle scaled 1bp;\n", name
+
+		if (label != "") {
+			printf "\tlabel(\"%s\", %s);\n", label, name
+		}
 	}
 }

@@ -88,7 +126,7 @@

 	v = split($0, a, " ");
 	# TODO: assert n < v - whatever
-	# TODO: assert n >= 4 (knot, control, control)
+	# TODO: assert n >= 4 (knot, control, control); mind trailing stuff... label etc

 	# TODO: note we assume -Etailclip=false -Eheadclip=false -Edir=none
 	# TODO: explain that requirement
@@ -102,7 +140,7 @@
 	# last two points (control, knot) are ontop of each other, in the head node
 	# coordinates are in inches

-	printf "\te := ";
+	printf "\te :=\n";
 	for (i = 1; i <= n - 1; i += 3) {
 		# knot
 		ox = a[(i + 0) * 2 + 3];
@@ -116,7 +154,7 @@
 		c2x = a[(i + 2) * 2 + 3];
 		c2y = a[(i + 2) * 2 + 4];

-		printf "(%fin, %fin) .. controls (%fin, %fin) and (%fin, %fin) .. ", ox, oy, c1x, c1y, c2x, c2y;
+		printf "\t(%fin, %fin) .. controls (%fin, %fin) and (%fin, %fin) ..\n", ox, oy, c1x, c1y, c2x, c2y;
 	}
 	# TODO: knot at end, which i haven't drawn
 	# last point:
@@ -124,37 +162,97 @@
 		# knot
 		ox = a[(n + 0) * 2 + 3];
 		oy = a[(n + 0) * 2 + 4];
-		printf "(%fin, %fin);", ox, oy;
-	}
-
-	printf "draw e withpen pencircle scaled 0.25bp withcolor red;\n";
+		printf "\t(%fin, %fin);\n", ox, oy;
+	}
+
+	printf "\tdraw e withpen pencircle scaled 0.25bp withcolor red;\n";

 	# TODO: better explain this
 	# TODO: explain reversed for q, else we'd find p again, where head == tail
 	printf "pair p; p = e intersectionpoint n%s;\n", head;
 	printf "pair q; q = (reverse e) intersectionpoint n%s;\n", tail;

+	# XXX: assuming no space in label
+label = slabel(a[n * 2 + 5]);
+lx    = (a[n * 2 + 6]);
+ly    = (a[n * 2 + 7]);
+
+	if (n * 2 == v - 4 - 2) {
+		label = "";
+	}
+
 	if (head == tail) {
 		printf "path pp; pp = %s -- 0.5[p, q];\n", head;
-#		printf "draw p -- q withpen pencircle scaled 0.5bp withcolor green;\n";
+printf "draw p -- q withpen pencircle scaled 0.5bp withcolor green;\n";
+printf "draw 0.5[p, q] withpen pencircle scaled 0.8bp withcolor green;\n";
+printf "draw %s -- 0.5[p, q] withpen pencircle scaled 0.8bp withcolor green;\n", head;

 		# extend loop 1.25 * diameter
 		# count number of self-loops for this node, and increment extension
 		printf "\tl%s := l%s + 1;", head, head
 		print "l := length pp;"
 		printf "\tpair m; m := (0.5 + 2 * mlog(l%s + 1) / 256) * d%s * unitvector(direction l of pp) shifted %s;\n", head, head, head
-#		printf "\tdraw %s -- m withpen pencircle scaled 0.25bp withcolor green;\n", head
+# u3 = u1 projectedalong u2;
+		printf "\tdraw %s -- m withpen pencircle scaled 0.5bp withcolor green;\n", head

 		printf "\tpath b; b = %s .. q .. m .. p .. %s;\n", tail, head;
+
+		if (label != "") {
+			# TODO: top or bottom, depending on green line direction
+			printf "\tlabel.top(\"%s\", m);\n", slabel(label)
+		}
 	} else {
 		printf "\tpath b; b = %s .. q .. p .. %s;\n", tail, head;

 		# TODO: explain this. we permit a 2% lengthening threshold relative to graphviz's b-spline
 		# this affects NFA especially
 		print "\tr := arclength b / arclength e;\n";
-		print "\tif (r > 1.02) or (r < 0.87):";
+		print "\tboolean g; g := (r > 1.02) or (r < 0.93);"; # XXX: or (arclength b > 6in);"; - no, wigglyness instead
+
+		print "\tif g:";
 		print "\t\tb := e;";
 		print "\tfi;";
+
+# if it wouldn't have been a straight line, go via the label point instead:
+# XXX: this idea doesn't work, because i don't know which side of the line the label point would be on
+#printf "\t\tb := %s .. q .. (%fin, %fin) .. p .. %s;\n", tail, lx, ly, head;
+
+		if (label != "") {
+			printf "\tpair bl;\n";
+			printf "\tpair ml; ml := .5[%s, %s];\n", tail, head;
+
+# TODO: new idea; draw right angle from midpoint, and use that to find intersection with b
+# this way it should always align for multiple edges, even if on a slant
+
+printf "draw (%fin, %fin) withpen pencircle scaled 5bp withcolor red;\n", lx, ly
+printf "draw point (length b / 2) of b withpen pencircle scaled 4bp withcolor blue;\n"
+#printf "draw %s -- %s withpen pencircle scaled 1bp withcolor green;\n", tail, head
+#printf "draw ml withpen pencircle scaled 5bp withcolor green;\n"
+
+			print "\tif g:";
+				printf "\t\tbl := (%fin, %fin);", lx, ly;
+			print "\telse:";
+				printf "\t\tbl := point (length b / 2) of b;\n";
+			print "\tfi;";
+
+# TODO: plus label delta, distancing it from point. make a label function
+# TODO: maybe an "extend" function, to extend a path in its direction. use dotprod for that?
+
+			# lft | rt | top | bot | ulft | urt | llft | lrt
+			# labels ought to be below, if they're below the straight line from head-tail, or above otherwise
+			# TODO: round label coordinates to grid? quantize rather
+# XXX: if using graphviz's point, label exactly on the spot
+print "\tif g:";
+# TODO: still want to distance by +/- 4bp or so
+			printf "\t\tlabel(\"%s\", bl);\n", label
+print "\telse:";
+			printf "\tif ypart bl < ypart ml:\n" # TODO: threshold for considering "below"
+			printf "\t\tlabel.bot(\"%s\", bl shifted (0, -3bp));\n", label
+			printf "\telse:\n"
+			printf "\t\tlabel.top(\"%s\", bl shifted (0, +3bp));\n", label
+			printf "\tfi;\n"
+print "\tfi;";
+		}
 	}

 	printf "drawarrow b cutbefore q cutafter p withpen pencircle scaled 1bp;\n";


ahrf.awk: one or more space(s)

ahrf.awk: one or more space(s)

--- ahrf.awk
+++ ahrf.awk
@@ -2,8 +2,8 @@

 BEGIN { FS = "\n"; RS = "" }

-# Common shell symbols to HTML
 {
+	# Common shell symbols to HTML
 	# Two backslashes for nawk(1) and OpenBSD awk(1)
 	gsub(/\&/,"\\&")
 	gsub(/</,"\\<")
@@ -16,7 +16,7 @@
 	cnt = RLENGTH
 	gsub(/^[\t ]*:+[\t ]*|[\t ]*:+[\t ]*$/,"")
 	anc = tolower($0)
-	gsub(/ /,"-",anc)
+	gsub(/ +/,"-",anc)
 	# length($0) would also work
 	if (cnt <= 6 && $0 != "") {
 		printf("<h%d id=\"%s\">%s</h%d>\n", cnt, anc, $0, cnt)


ahrf.awk: Enable comment exported to HTML. This is not final and therefore, it might be removed. Validated (even if the checks are not included yet).


Start 2016 testing.

Start 2016 testing.

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -11,8 +11,8 @@
 #$3>date
 {
   # add a loop to add line only if either status is (wanted or testing) or ending year is gt or eq to contract year
-  # increased to 2015 July 1 2015.
-  current_year = 2015
+  # increased to 2016 July 1 2016.
+  current_year = 2016
   # end_year is the AU year, or the second half of a range, ie 2014 in 2013-2014
   end_year = 0
   incontract = 0


Add automated years.

Add automated years.

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -11,8 +11,17 @@
 #$3>date
 {
   # add a loop to add line only if either status is (wanted or testing) or ending year is gt or eq to contract year
-  # increased to 2018 July 1 ish 2018
-  current_year = 2018
+
+  #After July 1 of this year, start reporting on this year. Before that, ignore this year.
+  current_year=`date +%Y`
+  week=`date +%W`
+  if [ $week -lt 26 ]
+    then
+    ((current_year--))
+    #echo current_year $current_year
+  fi
+  #echo current_year $current_year
+
   # end_year is the AU year, or the second half of a range, ie 2014 in 2013-2014
   end_year = 0
   incontract = 0


pull in the pretty-printer stylesheet

pull in the pretty-printer stylesheet

--- tools/slidy.awk
+++ tools/slidy.awk
@@ -24,7 +24,7 @@
 {
     sub(/<title>Haskell: Functional Programming, Solid Code, Big Data<\/title>/, "<title>Intro \\“Functional Programming\\”</title>")
     sub(/<meta name="date" content="2011-09-18" \/>/, "<meta name='date' content='2011-10-19' />")
-    sub(/<meta name="author" content="Bryan O'Sullivan" \/>/, "<meta name='author' content='Gabor Greif' />\n  <meta name='duration' content='45' />")
+    sub(/<meta name="author" content="Bryan O'Sullivan" \/>/, "<meta name='author' content='Gabor Greif' />\n  <meta name='duration' content='45' />\n  <link type='text/css' rel='stylesheet' href='http://www.gstatic.com/codesite/ph/13841197563397998716/css/ph_detail.css' />")
 }

 /^<body>/ {


Fix colorize_diff.awk

Fix colorize_diff.awk

--- tools/colorize_diff.awk
+++ tools/colorize_diff.awk
@@ -45,18 +45,23 @@
     need_reset = 0;
 }

+# Name of changed file / old name of file.
+/^--- / {
+    set_attrs(BOLD, WHITE, MAGENTA);
+}
+
 # Name of changed file / name of new file.
-/^\+\+\+/ {
+/^\+\+\+ / {
     set_attrs(BOLD, WHITE, BLUE);
 }

 # Lines which have been added.
-/^\+[^+]/ {
+/^\+[^+]/ || /^\+$/ {
     set_attrs(BOLD, WHITE, GREEN);
 }

 # Lines which have been removed.
-/^-[^-]/ {
+/^-[^-]/ || /^-$/ {
     set_attrs(BOLD, WHITE, RED);
 }


mpers: fix compound types with arbitrary member alignments

* mpers.sh: Compound types are now represented as packed
with character arrays as explicit fillers inbetween members
and at the end.

--- mpers.awk
+++ mpers.awk
@@ -5,7 +5,8 @@
 		return -1
 	return (c1 != c2)
 }
-function what_is(what_idx, type_idx, special, item)
+function what_is(what_idx, type_idx, special, item, \
+		 location, prev_location, prev_returned_size)
 {
 	type_idx = array[what_idx]["type"]
 	special = array[what_idx]["special"]
@@ -24,28 +25,62 @@
 			printf("%s ", array[what_idx]["name"])
 			break
 		}
+		returned_size = array[what_idx]["byte_size"]
 		break
 	case "enumeration_type":
 		printf("%s ", "uint" 8*array[type_idx]["byte_size"] "_t")
+		returned_size = array[what_idx]["byte_size"]
 		break
 	case "pointer_type":
 		printf("%s", "mpers_ptr_t ")
+		returned_size = array[what_idx]["byte_size"]
 		break
 	case "array_type":
 		what_is(type_idx)
 		to_return = array[what_idx]["upper_bound"]
+		returned_size = array[what_idx]["upper_bound"] * returned_size
 		return to_return
 		break
 	case "structure_type":
+		print "struct {"
+		prev_location = 0
+		location = 0
+		returned_size = 0
+		prev_returned_size = 0
+		for (item in array) {
+			if ("parent" in array[item] && \
+				array[item]["parent"] == what_idx) {
+				location = array[item]["location"]
+				loc_diff = location - prev_location - \
+					prev_returned_size
+				if (loc_diff != 0) {
+					printf("%s", \
+						"unsigned char mpers_filler_" \
+						item "[" loc_diff "];\n")
+				}
+				prev_location = location
+				returned = what_is(item)
+				prev_returned_size = returned_size
+				printf("%s", array[item]["name"])
+				if (returned) {
+					printf("%s", "[" returned "]")
+				}
+				print ";"
+			}
+		}
+		returned_size = array[what_idx]["byte_size"]
+		loc_diff = returned_size - prev_location - prev_returned_size
+		if (loc_diff != 0) {
+			printf("%s", "unsigned char mpers_end_filler_" \
+				item "[" loc_diff "];\n")
+		}
+		printf("%s", "} ATTRIBUTE_PACKED ")
+		break
 	case "union_type":
-		if (special == "structure_type") {
-			print "struct {"
-		} else {
-			print "union {"
-		}
+		print "union {"
 		for (item in array) {
-			if ("parent" in array[item] && array[item]["parent"] \
-				== what_idx) {
+			if ("parent" in array[item] && \
+				array[item]["parent"] == what_idx) {
 				returned = what_is(item)
 				printf("%s", array[item]["name"])
 				if (returned) {
@@ -55,6 +90,7 @@
 			}
 		}
 		printf("%s", "} ")
+		returned_size = array[what_idx]["byte_size"]
 		break
 	case "typedef":
 		return what_is(type_idx)
@@ -83,10 +119,11 @@
 }
 /^DW_AT_data_member_location/ {
 	match($0, /[[:digit:]]+/, temparray)
-	array[idx]["location"] = temparray[1]
+	array[idx]["location"] = temparray[0]
 }
 /^DW_AT_name/ {
-	match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, temparray)
+	match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \
+		temparray)
 	array[idx]["name"] = temparray[1]
 }
 /^DW_AT_byte_size/ {


ahrf.awk: Allow paragraphs to start with '(' (from Alex)


*** empty log message ***

*** empty log message ***


aux/ematch.awk: detect NetBSD awk bug with character classes

lib/modernish/aux/ematch.awk:
- Don't detect character class support if NetBSD awk bug
  http://gnats.netbsd.org/54424 is present (in UTF-8 locales, only
  the first character class in a bracket expression is matched).
  This triggers the ASCII translation of character classes, which
  is a bit better as it's at least consistent.

--- lib/modernish/aux/ematch.awk
+++ lib/modernish/aux/ematch.awk
@@ -29,7 +29,7 @@
 BEGIN {
 	if (ARGC != 3)
 		errorout("usage: ematch.awk <string> <ERE>");
-	hasclass = match("1", /[[:digit:]]/);
+	hasclass = match("1", /[[:alpha:][:digit:]]/);
 	exit !match(ARGV[1], convertere(ARGV[2]));
 }


Add percentiles support to stats.awk

Add percentiles support to stats.awk

--- stats.awk
+++ stats.awk
@@ -12,11 +12,25 @@
 	if (val > max)
 		max = val
 	avg += val
+
+	# percentiles
+	array[NR] = val
 }

 END {
 	avg /= NR
 	inv = 1000000
+
+	asort(array)
+
+	p50 = int(NR / 2)
+	p90 = int(NR * 0.9)
+	p95 = int(NR * 0.95)
+	p99 = int(NR * 0.99)
+
 	print "Min/avg/max frametimes (us): 	" min " / " avg " / " max
 	print "Min/avg/max FPS:		" inv/max " / " inv/avg " / " inv/min
+	print ""
+	print "50/90/95/99 percentiles (us):	" array[p50] " / " array[p90] " / " \
+			array[p95] " / " array[p99]
 }


units in initial state too

units in initial state too

--- horizons/horizons.awk
+++ horizons/horizons.awk
@@ -1,19 +1,21 @@
-function print_body() {
-  print "  body {"
-  print "    name = " body;
-  print "    x    = " x;
-  print "    y    = " y;
-  print "    z    = " z;
-  print "    vx   = " vx;
-  print "    vy   = " vy;
-  print "    vz   = " vz;
-  print "  }"
-}
-
 BEGIN {
-  print "principia_initial_state {"
+  print "principia_initial_state {";
+  first_pass = true
 }
 /^Target body name:/ {
+  if (first_pass) {
+    first_pass = false
+  } else {
+    print "  body {";
+    print "    name = " body;
+    print "    x    = " x " km";
+    print "    y    = " y " km";
+    print "    z    = " z " km";
+    print "    vx   = " vx " km/s";
+    print "    vy   = " vy " km/s";
+    print "    vz   = " vz "km/s";
+    print "  }"
+  }
   body = $0;
   sub(/ \(.*/, "", body);
   sub(/.*: /, "", body)
@@ -26,10 +28,8 @@
 /^ *VX=/ {
   vx = $2;
   vy = $4;
-  vz = $6;
-  print_body()
+  vz = $6
 }
 END {
-  print_body();
   print "}"
 }


Languages: add Tibetan script

Languages: add Tibetan script

--- include/Languages.awk
+++ include/Languages.awk
@@ -1441,6 +1441,7 @@
     case "Taml": return "Tamil"
     case "Telu": return "Telugu"
     case "Thai": return "Thai"
+    case "Tibt": return "Tibetan"
     default: return "Unknown"
     }
 }


LanguageData: update section M

LanguageData: update section M

--- include/LanguageData.awk
+++ include/LanguageData.awk
@@ -1481,9 +1481,7 @@
     Locale["lb"]["spoken-in"]          = "Luxembourg"
     Locale["lb"]["supported-by"]       = "google; yandex"

-
-
-    #58 Macedonian
+    # Macedonian
     Locale["mk"]["name"]               = "Macedonian"
     Locale["mk"]["endonym"]            = "Македонски"
     Locale["mk"]["translations-of"]    = "Преводи на %s"
@@ -1492,9 +1490,12 @@
     Locale["mk"]["examples"]           = "Примери"
     Locale["mk"]["see-also"]           = "Види и"
     Locale["mk"]["family"]             = "Indo-European"
+    Locale["mk"]["branch"]             = "South Slavic"
     Locale["mk"]["iso"]                = "mkd"
     Locale["mk"]["glotto"]             = "mace1250"
     Locale["mk"]["script"]             = "Cyrl"
+    Locale["mk"]["spoken-in"]          = "North Macedonia; Albania; Bosnia and Herzegovina; Romania; Serbia"
+    Locale["mk"]["supported-by"]       = "google; bing; yandex"

     # Maithili
     Locale["mai"]["name"]              = "Maithili"
@@ -1505,11 +1506,14 @@
     #Locale["mai"]["examples"]
     #Locale["mai"]["see-also"]
     Locale["mai"]["family"]            = "Indo-European"
+    Locale["mai"]["branch"]            = "Indo-Aryan"
     Locale["mai"]["iso"]               = "mai"
     Locale["mai"]["glotto"]            = "mait1250"
     Locale["mai"]["script"]            = "Deva"
-
-    #59 Malagasy (Plateau Malagasy)
+    Locale["mai"]["spoken-in"]         = "the Mithila region in India and Nepal"
+    Locale["mai"]["supported-by"]      = "google"
+
+    # Malagasy (Plateau Malagasy)
     Locale["mg"]["name"]               = "Malagasy"
     Locale["mg"]["endonym"]            = "Malagasy"
     Locale["mg"]["translations-of"]    = "Dikan'ny %s"
@@ -1518,11 +1522,14 @@
     Locale["mg"]["examples"]           = "Ohatra"
     Locale["mg"]["see-also"]           = "Jereo ihany koa"
     Locale["mg"]["family"]             = "Austronesian"
+    Locale["mg"]["branch"]             = "Malayo-Polynesian"
     Locale["mg"]["iso"]                = "mlg"
     Locale["mg"]["glotto"]             = "plat1254"
     Locale["mg"]["script"]             = "Latn"
-
-    #60 Malay (Standard Malay)
+    Locale["mg"]["spoken-in"]          = "Madagascar; the Comoros; Mayotte"
+    Locale["mg"]["supported-by"]       = "google; bing; yandex"
+
+    # Malay (Standard Malay), Latin alphabet
     Locale["ms"]["name"]               = "Malay"
     Locale["ms"]["endonym"]            = "Bahasa Melayu"
     Locale["ms"]["translations-of"]    = "Terjemahan %s"
@@ -1531,11 +1538,14 @@
     Locale["ms"]["examples"]           = "Contoh"
     Locale["ms"]["see-also"]           = "Lihat juga"
     Locale["ms"]["family"]             = "Austronesian"
+    Locale["ms"]["branch"]             = "Malayo-Polynesian"
     Locale["ms"]["iso"]                = "msa"
     Locale["ms"]["glotto"]             = "stan1306"
     Locale["ms"]["script"]             = "Latn"
-
-    #61 Malayalam
+    Locale["ms"]["spoken-in"]          = "Malaysia; Singapore; Indonesia; Brunei; East Timor"
+    Locale["ms"]["supported-by"]       = "google; bing; yandex"
+
+    # Malayalam
     Locale["ml"]["name"]               = "Malayalam"
     Locale["ml"]["endonym"]            = "മലയാളം"
     Locale["ml"]["translations-of"]    = "%s എന്നതിന്റെ വിവർത്തനങ്ങൾ"
@@ -1544,11 +1554,14 @@
     Locale["ml"]["examples"]           = "ഉദാഹരണങ്ങള്"
     Locale["ml"]["see-also"]           = "ഇതും കാണുക"
     Locale["ml"]["family"]             = "Dravidian"
+    Locale["ml"]["branch"]             = "South Dravidian"
     Locale["ml"]["iso"]                = "mal"
     Locale["ml"]["glotto"]             = "mala1464"
     Locale["ml"]["script"]             = "Mlym"
-
-    #62 Maltese
+    Locale["ml"]["spoken-in"]          = "Kerala, Lakshadweep and Puducherry in India"
+    Locale["ml"]["supported-by"]       = "google; bing; yandex"
+
+    # Maltese
     Locale["mt"]["name"]               = "Maltese"
     Locale["mt"]["endonym"]            = "Malti"
     Locale["mt"]["translations-of"]    = "Traduzzjonijiet ta' %s"
@@ -1557,11 +1570,14 @@
     Locale["mt"]["examples"]           = "Eżempji"
     Locale["mt"]["see-also"]           = "Ara wkoll"
     Locale["mt"]["family"]             = "Afro-Asiatic"
+    Locale["mt"]["branch"]             = "Semitic"
     Locale["mt"]["iso"]                = "mlt"
     Locale["mt"]["glotto"]             = "malt1254"
     Locale["mt"]["script"]             = "Latn"
-
-    #63 Maori
+    Locale["mt"]["spoken-in"]          = "Malta"
+    Locale["mt"]["supported-by"]       = "google; bing; yandex"
+
+    # Maori
     Locale["mi"]["name"]               = "Maori"
     Locale["mi"]["endonym"]            = "Māori"
     Locale["mi"]["translations-of"]    = "Ngā whakamāoritanga o %s"
@@ -1570,11 +1586,14 @@
     Locale["mi"]["examples"]           = "Ngā Tauira:"
     Locale["mi"]["see-also"]           = "Tiro hoki:"
     Locale["mi"]["family"]             = "Austronesian"
+    Locale["mi"]["branch"]             = "Malayo-Polynesian"
     Locale["mi"]["iso"]                = "mri"
     Locale["mi"]["glotto"]             = "maor1246"
     Locale["mi"]["script"]             = "Latn"
-
-    #64 Marathi
+    Locale["mi"]["spoken-in"]          = "New Zealand"
+    Locale["mi"]["supported-by"]       = "google; bing; yandex"
+
+    # Marathi
     Locale["mr"]["name"]               = "Marathi"
     Locale["mr"]["endonym"]            = "मराठी"
     Locale["mr"]["translations-of"]    = "%s ची भाषांतरे"
@@ -1583,9 +1602,28 @@
     Locale["mr"]["examples"]           = "उदाहरणे"
     Locale["mr"]["see-also"]           = "हे देखील पहा"
     Locale["mr"]["family"]             = "Indo-European"
+    Locale["mr"]["branch"]             = "Indo-Aryan"
     Locale["mr"]["iso"]                = "mar"
     Locale["mr"]["glotto"]             = "mara1378"
     Locale["mr"]["script"]             = "Deva"
+    Locale["mr"]["spoken-in"]          = "the Indian state of Maharashtra"
+    Locale["mr"]["supported-by"]       = "google; bing; yandex"
+
+    # Eastern Mari / Meadow Mari
+    Locale["mhr"]["name"]              = "Eastern Mari"
+    Locale["mhr"]["endonym"]           = "Олык марий"
+    #Locale["mhr"]["translations-of"]
+    #Locale["mhr"]["definitions-of"]
+    #Locale["mhr"]["synonyms"]
+    #Locale["mhr"]["examples"]
+    #Locale["mhr"]["see-also"]
+    Locale["mhr"]["family"]            = "Uralic"
+    Locale["mhr"]["branch"]            = "Mari"
+    Locale["mhr"]["iso"]               = "mhr"
+    Locale["mhr"]["glotto"]            = "east2328"
+    Locale["mhr"]["script"]            = "Cyrl"
+    Locale["mhr"]["spoken-in"]         = "Mari El, Russia"
+    Locale["mhr"]["supported-by"]      = "yandex"

     # Meiteilon / Manipuri
     Locale["mni-Mtei"]["name"]         = "Meiteilon"
@@ -1599,9 +1637,12 @@
     #Locale["mni-Mtei"]["examples"]
     #Locale["mni-Mtei"]["see-also"]
     Locale["mni-Mtei"]["family"]       = "Sino-Tibetan"
+    Locale["mni-Mtei"]["branch"]       = "Tibeto-Burman"
     Locale["mni-Mtei"]["iso"]          = "mni"
     Locale["mni-Mtei"]["glotto"]       = "mani1292"
     Locale["mni-Mtei"]["script"]       = "Mtei"
+    Locale["mni-Mtei"]["spoken-in"]    = "the northeast India; Bangladesh; Myanmar"
+    Locale["mni-Mtei"]["supported-by"] = "google"

     # Mizo
     Locale["lus"]["name"]              = "Mizo"
@@ -1612,11 +1653,14 @@
     #Locale["lus"]["examples"]
     #Locale["lus"]["see-also"]
     Locale["lus"]["family"]            = "Sino-Tibetan"
+    Locale["lus"]["branch"]            = "Tibeto-Burman"
     Locale["lus"]["iso"]               = "lus"
     Locale["lus"]["glotto"]            = "lush1249"
     Locale["lus"]["script"]            = "Latn"
-
-    #65 Mongolian, Cyrillic alphabet
+    Locale["lus"]["spoken-in"]         = "the Indian state of Mizoram"
+    Locale["lus"]["supported-by"]      = "google"
+
+    # Mongolian, Cyrillic alphabet
     Locale["mn"]["name"]               = "Mongolian"
     Locale["mn"]["endonym"]            = "Монгол"
     Locale["mn"]["translations-of"]    = "%s-н орчуулга"
@@ -1625,11 +1669,30 @@
     Locale["mn"]["examples"]           = "Жишээнүүд"
     Locale["mn"]["see-also"]           = "Мөн харах"
     Locale["mn"]["family"]             = "Mongolic"
+    #Locale["mn"]["branch"]
     Locale["mn"]["iso"]                = "mon"
     Locale["mn"]["glotto"]             = "mong1331"
     Locale["mn"]["script"]             = "Cyrl"
-
-    #66 Myanmar / Burmese
+    Locale["mn"]["spoken-in"]          = "Mongolia; Inner Mongolia in China"
+    Locale["mn"]["supported-by"]       = "google; bing; yandex"
+
+    # Mongolian, traditional Mongolian alphabet
+    Locale["mn-Mong"]["name"]          = "Mongolian (Traditional)"
+    Locale["mn-Mong"]["endonym"]       = "ᠮᠣᠩᠭᠣᠯ"
+    #Locale["mn-Mong"]["translations-of"]
+    #Locale["mn-Mong"]["definitions-of"]
+    #Locale["mn-Mong"]["synonyms"]
+    #Locale["mn-Mong"]["examples"]
+    #Locale["mn-Mong"]["see-also"]
+    Locale["mn-Mong"]["family"]        = "Mongolic"
+    #Locale["mn-Mong"]["branch"]
+    Locale["mn-Mong"]["iso"]           = "mon-Mong"
+    Locale["mn-Mong"]["glotto"]        = "mong1331"
+    Locale["mn-Mong"]["script"]        = "Mong"
+    Locale["mn-Mong"]["spoken-in"]     = "Mongolia; Inner Mongolia in China"
+    Locale["mn-Mong"]["supported-by"]  = "bing"
+
+    # Myanmar / Burmese
     Locale["my"]["name"]               = "Myanmar"
     Locale["my"]["name2"]              = "Burmese"
     Locale["my"]["endonym"]            = "မြန်မာစာ"
@@ -1639,9 +1702,14 @@
     Locale["my"]["examples"]           = "ဥပမာ"
     Locale["my"]["see-also"]           = "ဖော်ပြပါများကိုလဲ ကြည့်ပါ"
     Locale["my"]["family"]             = "Sino-Tibetan"
+    Locale["my"]["branch"]             = "Tibeto-Burman"
     Locale["my"]["iso"]                = "mya"
     Locale["my"]["glotto"]             = "nucl1310"
     Locale["my"]["script"]             = "Mymr"
+    Locale["my"]["spoken-in"]          = "Myanmar"
+    Locale["my"]["supported-by"]       = "google; bing; yandex"
+
+

     #67 Nepali
     Locale["ne"]["name"]               = "Nepali"
@@ -2377,20 +2445,6 @@
     Locale["br"]["iso"]                = "bre"
     Locale["br"]["glotto"]             = "bret1244"
     Locale["br"]["script"]             = "Latn"
-
-    #? Eastern Mari
-    Locale["mhr"]["support"]           = "yandex-only"
-    Locale["mhr"]["name"]              = "Eastern Mari"
-    Locale["mhr"]["endonym"]           = "Олык марий"
-    #Locale["mhr"]["translations-of"]
-    #Locale["mhr"]["definitions-of"]
-    #Locale["mhr"]["synonyms"]
-    #Locale["mhr"]["examples"]
-    #Locale["mhr"]["see-also"]
-    Locale["mhr"]["family"]            = "Uralic"
-    Locale["mhr"]["iso"]               = "mhr"
-    Locale["mhr"]["glotto"]            = "east2328"
-    Locale["mhr"]["script"]            = "Cyrl"

     #? Occitan
     Locale["oc"]["support"]            = "unstable"
@@ -2530,6 +2584,7 @@
     LocaleAlias["ji"] = "yi" # withdrawn language code for Yiddish
     LocaleAlias["jw"] = "jv" # withdrawn language code for Javanese
     LocaleAlias["kurdish"] = "ku" # Kurdish: default to "ku" (N.B. Google uses this code for Kurmanji)
+    LocaleAlias["mari"] = "mhr" # Mari: default to "mhr" (Eastern Mari)
     LocaleAlias["mo"] = "ro" # Moldavian or Moldovan considered a variant of the Romanian language
     LocaleAlias["mww"] = "hmn" # mww (Hmong Daw) treated the same as hmn (the inclusive code for Hmong)
     LocaleAlias["nb"] = "no" # Google Translate does not distinguish between Bokmål and Nynorsk (but Bing does!)


add fileTranslation() for inline mode with relevant URI scheme (file)

--- include/Translate.awk
+++ include/Translate.awk
@@ -231,6 +231,21 @@
     return r
 }

+# Translate a file.
+function fileTranslation(uri,    group, temp1, temp2) {
+    temp1 = Option["input"]
+    temp2 = Option["verbose"]
+
+    match(uri, /^file:\/\/(.*)/, group)
+    Option["input"] = group[1]
+    Option["verbose"] = 0
+
+    translateMain()
+
+    Option["input"] = temp1
+    Option["verbose"] = temp2
+}
+
 # Start a browser session and translate a web page.
 function webTranslation(uri, sl, tl, hl) {
     system(Option["browser"] " " parameterize("https://translate.google.com/translate?" \
@@ -270,8 +285,11 @@
                 print replicate("─", Option["width"])

         if (inline &&
-            startsWithAny(text, UriSchemes) == "http" ||
-            startsWithAny(text, UriSchemes) == "https") {
+            startsWithAny(text, UriSchemes) == "file") {
+            fileTranslation(text)
+        } else if (inline &&
+                   startsWithAny(text, UriSchemes) == "http" ||
+                   startsWithAny(text, UriSchemes) == "https") {
             webTranslation(text, Option["sl"], Option["tl"][i], Option["hl"])
         } else {
             print getTranslation(text, Option["sl"], Option["tl"][i], Option["hl"], Option["verbose"], Option["play"], playlist) > Option["output"]


wordMode & dictMode: adjust empty lines

wordMode & dictMode: adjust empty lines

--- include/Translate.awk
+++ include/Translate.awk
@@ -199,19 +199,20 @@
     } else {
         # Verbose mode

-        if (isarray(wordClasses) && anything(wordClasses))
+        if (isarray(wordClasses))
             wordMode = 1
-        if (il == tl)
+        if (il == tl && isarray(oWordClasses))
             wordMode = dictMode = 1

         if (wordMode) {
             r = AnsiCode["bold"] show(join(original), il) AnsiCode["no bold"]
             if (anything(oPhonetics))
                 r = r "\n" AnsiCode["bold"] "/" join(oPhonetics) "/" AnsiCode["no bold"]
-            r = r "\n"
         }
         if (dictMode) {
             # Dictionary mode
+            r = r "\n"
+
             if (isarray(oWordClasses) && anything(oWordClasses)) {
                 for (i = 0; i < length(oWordClasses); i++) {
                     r = r "\n" AnsiCode["negative"] AnsiCode["bold"]    \
@@ -271,11 +272,11 @@
             r = r AnsiCode["bold"] s(translation, tl) AnsiCode["no bold"] # target language
             if (anything(phonetics))
                 r = r "\n" AnsiCode["bold"] "/" join(phonetics) "/" AnsiCode["no bold"] # phonetic transcription
-            r = r "\n"
         }

         if (isarray(altTranslations[0]) && anything(altTranslations[0])) {
             # List alternative translations
+            r = r "\n"

             if (Locale[getCode(hl)]["rtl"] || Locale[getCode(il)]["rtl"])
                 r = r "\n" s(sprintf(Locale[getCode(hl)]["message"], "\"" join(original) "\"")) ":" # caution: mixed languages, BiDi invoked must be implemented correctly (i.e. FriBidi is required)


Delete loawson2osm.awk

Delete loawson2osm.awk

--- loawson2osm.awk
+++ loawson2osm.awk
@@ -1 +0,0 @@
-# test


build.awk: do not export TRANS_ABSPATH

build.awk: do not export TRANS_ABSPATH

--- build.awk
+++ build.awk
@@ -168,8 +168,6 @@
                 print "export TRANS_BUILD=git:" temp > Trans
         }

-        print "export TRANS_ABSPATH=$(cd \"$(dirname \"$0\")\" && pwd)/$(basename \"$0\")" > Trans
-
         print "export COLUMNS=$(tput cols)" > Trans

         print "gawk -f <(echo -E \"$TRANS_PROGRAM\") - \"$@\"" > Trans


Start refactoring

Start refactoring

--- getBritBoxFrom-scrapy_xml.awk
+++ getBritBoxFrom-scrapy_xml.awk
@@ -2,33 +2,34 @@
     FS="[<>]"
 }

+# Eliminate unneeded constant fields
 /^<item>/ {
     sub (/^<item>/,"")
     sub (/<\/item>$/,"")
+    gsub (/<value>/,"")
+    gsub (/<\/value>/,"")
 }

-/<value>/ {
-    gsub (/<value>/,"")
-    gsub (/<\/value>/,"")
+/\/us\// {
+    URL = $3
+    showTitle = $7
+    subtitle = $11
+
+    # Titles starting with "The" should not sort based on "The"
+    if (match (showTitle, /^The /)) {
+        showTitle = substr(showTitle, 5) ", The"
+    }
 }

 # <URL>/us/episode/Vera_S3_E1_13502</URL><Title>Vera</Title><Subtitle>Season 3, Castles in The Air</Subtitle>\
 # <Duration>88 min</Duration><Year>2013</Year><Rating>TV-MA</Rating>
 /\/us\/episode\// {
-    episodeURL = $3
-    seriesTitle = $7
-    episodeTitle = $11
     episodeDuration = $15
     episodeYear = $19
     episodeRating = $23
     episodeDescription = $27

-    # Titles starting with "The" should not sort based on "The"
-    if (match (seriesTitle, /^The /)) {
-        seriesTitle = substr(seriesTitle, 5) ", The"
-    }
-
-    nfields = split (episodeURL,fld,"_")
+    nfields = split (URL,fld,"_")
     seasonNumber = fld[nfields - 2]
     sub (/S/,"",seasonNumber)
     episodeNumber = fld[nfields - 1]
@@ -36,37 +37,30 @@

     # Get rid of perfunctory "Season <n>, " from episode title
     episodePrefix = "Season " seasonNumber ", "
-    sub (episodePrefix, "", episodeTitle)
+    sub (episodePrefix, "", subtitle)

     if (episodeNumber != "") {
         printf \
             ("%s S%02dE%02d\t=HYPERLINK(\"https://www.britbox.com%s\";\"%s, S%02dE%02d, %s\"\)\t\t%s\t%s\t%s\t%s\n", \
-             seriesTitle, seasonNumber, episodeNumber, episodeURL, seriesTitle, seasonNumber, episodeNumber, \
-             episodeTitle, episodeDuration, episodeYear, episodeRating, episodeDescription)
+             showTitle, seasonNumber, episodeNumber, URL, showTitle, seasonNumber, episodeNumber, \
+             subtitle, episodeDuration, episodeYear, episodeRating, episodeDescription)
     }
 }

 # <URL>/us/season/Vera_S8_15720</URL><Title>Vera</Title><SeasonNumber>8</SeasonNumber>\
 # <Year>2018</Year><NumEpisodes>4</NumEpisodes>
 /\/us\/season\// {
-    seasonURL = $3
-    seriesTitle = $7
-    seasonTitle = $11
     seasonYear = $15
     seasonEpisodes = $19

-    if (match (seriesTitle, /^The /)) {
-        seriesTitle = substr(seriesTitle, 5) ", The"
-    }
-
-    nfields = split (seasonURL,fld,"_")
+    nfields = split (URL,fld,"_")
     seasonNumber = fld[nfields - 1]
     sub (/S/,"",seasonNumber)

     if (seasonNumber != "") {
         printf \
             ("%s S%02d\t=HYPERLINK(\"https://www.britbox.com%s\";\"%s, Season %d\"\)\t%s\t\t%s\t%s\t%s\n", \
-             seriesTitle, seasonNumber, seasonURL, seriesTitle, seasonNumber, \
+             showTitle, seasonNumber, URL, showTitle, seasonNumber, \
              seasonEpisodes, seasonYear, seasonRating, seasonDescription)
     }
 }


avoid pointless output; cleanup & comments

--- scripts/distill_dot.awk
+++ scripts/distill_dot.awk
@@ -1,22 +1,17 @@
 #! /usr/bin/gawk -f
 # distill_dot.awk <numbered.gv>  > <filtered_weighted.gv>
-#

 # I have dot files with edge lables that terminate with a number in parens `(nnn)`.
 # the numbers may be simple counts (n > 0) or may be differences [nil neg zero pos ]
 #
-# I'm initally intrested in the case where the numbers are a difference
+# I'm initally intrested in the case where the numbers are a difference
 # and will filter out small differences and colorize/weight larger changes.
-#
-# To normalize, will need to read through first then output

 BEGIN {hi = -2^PREC; lo = 2^PREC; THRESHOLD = 10}

-# there is an unfortunate case where the label contains parens e.g.
+# there is an unfortunate case where the term label contains parens e.g.
 # ZFIN -> LITERAL [label=<dc:title ! title (dce) (30783)>];
-
 # AspGD -> GO [label=<RO:0002331 ! involved in (-12)>, color="pink"];
-

 /.*label=<.*\(-?[0-9]+\).*;$/{

@@ -39,30 +34,41 @@
 }

 # not processed
-!/.*label=<.*\(-?[0-9]+\).*;$/ {
+!/.*label=<.*\(-?[0-9]+\).*;$/{
     pass_on[pss++] = $0
 }

 END {
-    SCALE =  (hi > -lo)? hi: -lo
-    # Threshold could extended as a fraction of scale ...
-    THRESHOLD =  SCALE / 200
+    SCALE = (hi > -lo)? hi: -lo
+    # Threshold can be extended as a fraction of scale
+    # say... differences less than half a percent of the churn are supressed
+    SLIDINGSCALE =  SCALE / 200

-#    if (SCALE < 1){
-#       print "ERROR not to scale: " SCALE
-#        SCALE = 1
-#    }
+    if (SCALE < 1){
+        # print "ERROR not to scale: " SCALE
+        SCALE = 1
+    }

+    # precheck if there is any content before printing boilerplate
+    content = 0
+    for(key in value)   {
+        val = value[key]
+        aval = (val < 0.0) ? -val : val
+        if(aval >= SLIDINGSCALE)
+            content ++
+    }

-    for(i = 0; i < pss; i++)  # not the last line
-        if( (pass_on[i]!="") && (pass_on[i]!="}")) print pass_on[i]
+    for(i = 0; i < pss; i++)
+        if( (pass_on[i]!="") && (pass_on[i]!="}") && content > 0)
+            print pass_on[i]

     for(key in value)   {
         val = value[key]
         aval = (val < 0.0) ? -val : val
-        if(aval >= THRESHOLD)
+        if(aval >= SLIDINGSCALE)
             print key ">, penwidth = \""(aval/SCALE*5)"\", weight = \"" aval "\"" sufix[key]
     }

-    print "}"
+    if(content > 0)
+        print "}"
 }


New version.

New version.

--- CASED.awk
+++ CASED.awk
@@ -45,8 +45,8 @@
   tohex["e"] = 15;
   tohex["f"] = 16;

-  FILE = 1;
-  FS = ";";
+  FILE = "UnicodeData.txt";
+  FS = "[ \t]*[;#][ \t]*";
 }

 function decode_hex(str, idx) {
@@ -54,7 +54,7 @@
   len = length(str);
   for (i = idx; i <= len; i++)
     {
-      c = tohex[substr (str, i, 1)];
+      c = tohex[substr(str, i, 1)];
       if (c == 0)
 	break;
       n = n * 16 + c - 1;
@@ -62,46 +62,56 @@
   return n;
 }

-function single (str, bit) {
+function single(str, bit) {
   i = decode_hex(str, 1);
   if (cased[i] != bit)
     cased[i] += bit;
 }

-function range (str, bit) {
-  end = decode_hex(str, index (str, "..") + 2);
+function range(str, bit) {
+  end = decode_hex(str, index(str, "..") + 2);
   for (i = decode_hex(str, 1); i <= end; i++)
     if (cased[i] != bit)
       cased[i] += bit;
 }

-FILE == 1 && /^[^#]/ {
-  if ($3 ~ /L[ltu]/)
-    single($1, 1);
-  else if ($3 ~ /Mn|Me|Cf|Lm|Sk/)
-    range($1, 2);
+/^[^\#]/ {
+
+  if (FILE == "UnicodeData.txt") {
+    if ($3 ~ /L[ltu]/)
+      single($1, 1);
+    else if ($3 ~ /Mn|Me|Cf|Lm|Sk/)
+      single($1, 2);
+    next;
+  }
+
+  else if (FILE == "PropList.txt") {
+    if ($2 ~ /Other_(Upp|Low)ercase/) {
+      if (index($1, "."))
+	range($1, 1);
+      else
+	single($1, 1);
+      next;
+    }
+  }
+
+  else {			# FILE == "WordBreakProperty.txt"
+    if ($2 == "MidLetter") {
+      if (index($1, "."))
+	range($1, 2);
+      else
+	single($1, 2);
+      next;
+    }
+  }
 }

-/^# PropList-.+\.txt/ {
-  FILE = 2;
+/^\# PropList-.+\.txt/ {
+  FILE = "PropList.txt";
 }

-FILE == 2 && /^[^#;]+; *Other_(Upp|Low)ercase/ {
-  if (index ($1, "."))
-    range($1, 1);
-  else
-    single($1, 1);
-}
-
-/^# WordBreakProperty-.+\.txt/ {
-  FILE = 3;
-}
-
-FILE == 3 && /^[^#;]+; *MidLetter/ {
-  if (index ($1, "."))
-    range($1, 2);
-  else
-    single($1, 2);
+/^\# WordBreakProperty-.+\.txt/ {
+  FILE = "WordBreakProperty.txt";
 }

 END {


Remove _ from the list of allowed label characters

--- doxy/githublabels.awk
+++ doxy/githublabels.awk
@@ -44,8 +44,8 @@
 #
 line && (/^===*$/ || /^---*$/) {
 	id = tolower(line)
-	gsub(/[^- \t_a-z0-9]/, "", id) # remove undesired characters
-	gsub(/[ \t]/, "-", id)         # replace white space with _
+	gsub(/[^- \ta-z0-9]/, "", id)  # remove undesired characters
+	gsub(/[ \t]/, "-", id)         # replace white space with -
 	line = line " {#" prefix id "}"
 }


build.awk: add empty target temp

build.awk: add empty target temp

--- build.awk
+++ build.awk
@@ -243,6 +243,10 @@
     return 0
 }

+function temp() {
+    return 0
+}
+
 BEGIN {
     init()

@@ -308,6 +312,10 @@

         case "release":
             status = release()
+            break
+
+        case "temp":
+            status = temp()
             break

         default: # unknown task


Oops.

Oops.

--- dev/onewire/devlist2h.awk
+++ dev/onewire/devlist2h.awk
@@ -1,4 +1,4 @@
-# $OpenBSD: devlist2h.awk,v 1.2 2006/03/04 16:32:40 grange Exp $
+# $OpenBSD: devlist2h.awk,v 1.3 2006/03/10 14:36:32 grange Exp $

 #
 # Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -32,7 +32,7 @@
 	       "/*\n * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.\n" \
 	       " *\n * Generated from:\n *\t%s\n */\n\n", VERSION) > dfile
 	printf("static const struct onewire_family " \
-	       "onewire_familytab[] = {\n") > dfile
+	       "onewire_famtab[] = {\n") > dfile
 }

 $1 == "family" {


Languages: add Fijian language

Languages: add Fijian language

--- include/Languages.awk
+++ include/Languages.awk
@@ -104,6 +104,19 @@
     Locale["fo"]["iso"]                = "fao"
     Locale["fo"]["glotto"]             = "faro1244"
     Locale["fo"]["script"]             = "Latn"
+
+    #? Fijian
+    Locale["fj"]["name"]               = "Fijian"
+    Locale["fj"]["endonym"]            = "Vosa Vakaviti"
+    #Locale["fj"]["translations-of"]
+    #Locale["fj"]["definitions-of"]
+    #Locale["fj"]["synonyms"]
+    #Locale["fj"]["examples"]
+    #Locale["fj"]["see-also"]
+    Locale["fj"]["family"]             = "Austronesian"
+    Locale["fj"]["iso"]                = "fij"
+    Locale["fj"]["glotto"]             = "fiji1243"
+    Locale["fj"]["script"]             = "Latn"

     #1 Afrikaans
     Locale["af"]["name"]               = "Afrikaans"