Utils: get rev padding right this time, hopefully (see also 6e630d9)

--- include/Utils.awk
+++ include/Utils.awk
@@ -31,7 +31,7 @@
     FriBidi = detectProgram("fribidi", "--version", 1)
     BiDiNoPad = FriBidi ? "fribidi --nopad" : "rev" SUPERR
     BiDi = FriBidi ? "fribidi --width %s" :
-        "rev" SUPERR "| sed \"s/'/\\\\\\'/\" | xargs printf '%%s '"
+        "rev" SUPERR "| sed \"s/'/\\\\\\'/\" | xargs -0 printf '%%%ss'"
 }

 # Detect external readline wrapper (rlwrap).


Revert "Update min/maxx to be inclusive"

This reverts commit 5485acdc307383322387471b0de5ce93d2bf896e.

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -140,7 +140,7 @@
         msg         = "Field " field " in \" CSVFILENAME \" line \" NR \" is a duplicate and should be unique"

     } else if (rule_type ~ /^minimum|maximum$/) {
-        comparator  = $2 == "maximum" ? ">=" : "<="
+        comparator  = $2 == "maximum" ? ">" : "<"
         limit       = params[2]
         term        = $2 == "maximum" ? "less" : "greater"


Add remaining six fields

Add remaining six fields

This will need optimizing after explorig the data

--- getBBoxCatalogFrom-sitemap.awk
+++ getBBoxCatalogFrom-sitemap.awk
@@ -2,8 +2,9 @@

 BEGIN {
     # Print header
-    printf ("contentType\tcontentId\tpubDate\ttitle\tEntityId\t")
-    printf ("genre\trating\tshowType\tDuration\tdescription\n")
+    printf ("contentType\tcontentId\tpubDate\ttitle\tEntityId\tgenre\trating\t")
+    printf ("showType\tduration\tdateType\toriginalDate\tshowContentId\tseasonContentId\t")
+    printf ("seasonNumber\tepisodeNumber\tdescription\n")
 }

 # Don't process credits
@@ -38,6 +39,12 @@
     rating = ""
     showType = ""
     duration = ""
+    dateType = ""
+    originalDate = ""
+    showContentId = ""
+    seasonContentId = ""
+    seasonNumber = ""
+    episodeNumber = ""
     description = ""
 }

@@ -99,6 +106,48 @@
     # print "duration = " duration
 }

+# Grab originalDate
+# <originalAirDate>1978-03-25</originalAirDate>
+/<original.*Date>/ {
+    split ($0,fld,"[<>]")
+    dateType = fld[2]
+    originalDate = fld[3]
+    # print "dateType = " dateType
+    # print "originalDate = " originalDate
+}
+
+# Grab showContentId
+# <showContentId>b008yjd9</showContentId>
+/<showContentId>/ {
+    split ($0,fld,"[<>]")
+    showContentId = fld[3]
+    # print "showContentId = " showContentId
+}
+
+# Grab seasonContentId
+# <seasonContentId>p0318ps9</seasonContentId>
+/<seasonContentId>/ {
+    split ($0,fld,"[<>]")
+    seasonContentId = fld[3]
+    # print "seasonContentId = " seasonContentId
+}
+
+# Grab seasonNumber
+# <seasonNumber>1</seasonNumber>
+/<seasonNumber>/ {
+    split ($0,fld,"[<>]")
+    seasonNumber = fld[3]
+    # print "seasonNumber = " seasonNumber
+}
+
+# Grab episodeNumber
+# <episodeNumber>10</episodeNumber>
+/<episodeNumber>/ {
+    split ($0,fld,"[<>]")
+    episodeNumber = fld[3]
+    # print "episodeNumber = " episodeNumber
+}
+
 # Grab EntityId from artwork
 # <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" />
 /<artwork url=.*EntityId='/ {
@@ -119,8 +168,9 @@
         EntityId = "_23842"
         # print "EntityId = " EntityId
     }
-    printf ("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", contentType, contentId, pubDate, title, EntityId, \
-            genre, rating, showType, duration, description)
+    printf ("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", contentType, contentId, \
+            pubDate, title, EntityId, genre, rating, showType, duration, dateType, originalDate, \
+            showContentId, seasonContentId, seasonNumber, episodeNumber, description)
 }

 # <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" />


Help: fix showMan() (regression by 49c9b0)

--- include/Help.awk
+++ include/Help.awk
@@ -207,8 +207,8 @@
             return
         }
     }
-    if (fileExists("man/" Command ".1"))
-        system("man man/" Command ".1" SUPERR)
+    if (fileExists(ENVIRON["TRANS_DIR"] "/man/" Command ".1"))
+        system("man " parameterize(ENVIRON["TRANS_DIR"] "/man/" Command ".1") SUPERR)
     else if (system("man " Command SUPERR))
         print getHelp()
 }


Main: exit ExitCode for all information sessions

--- include/Main.awk
+++ include/Main.awk
@@ -566,27 +566,27 @@
     switch (InfoOnly) {
     case "version":
         print getVersion()
-        exit
+        exit ExitCode
     case "help":
         print getHelp()
-        exit
+        exit ExitCode
     case "manual":
         showMan()
-        exit
+        exit ExitCode
     case "reference":
         print getReference("endonym")
-        exit
+        exit ExitCode
     case "reference-english":
         print getReference("name")
-        exit
+        exit ExitCode
     case "list":
         print getList(Option["tl"])
-        exit
+        exit ExitCode
     case "upgrade":
         upgrade()
-        exit
+        exit ExitCode
     case "nothing":
-        exit
+        exit ExitCode
     }

     if (Option["interactive"])


use portable whitespace regexp in proof timer annot

--- proofalytics/proof-time-annot.awk
+++ proofalytics/proof-time-annot.awk
@@ -1,10 +1,10 @@
-/Lemma|Theorem|Corollary|Remark|Definition/ {
+/^[[:space:]]*(Lemma|Theorem|Corollary|Remark|Definition)/ {
   fn = FILENAME
   sub(/^../, "", fn)
   tok = fn "__PROOFALYTICS__" $2 "__PROOFALYTICS__" FNR
 }

-/Qed\.|Defined\./ {
+/^[[:space:]]*(Qed|Defined)\./ {
   printf("Eval compute in ltac:(idtac \"%s\").\n", tok)
 }

@@ -12,10 +12,10 @@
   print $0
 }

-/^Proof\.|\sProof\./ {
+/^[[:space:]]*Proof\./ {
   printf("Eval compute in ltac:(idtac \"%s\").\n", tok)
 }

-/Qed\.|Defined\./ {
+/^[[:space:]]*(Qed|Defined)\./ {
   printf("Eval compute in ltac:(idtac \"%s\").\n", tok)
 }


Fixed issue where fzn - Numberjack file did not have the objective variable added to output_vars.

--- fzn/fzn2py.awk
+++ fzn/fzn2py.awk
@@ -251,7 +251,7 @@
 	n = asorti(output,varnames);
 	for (i=1; i<=n; i++) {
 		e = varnames[i];
-		if (output[e]!=1) {
+		if (output[e]!=1 || e == "objective") {
 			if(e != objective) {
 				if(length(output_vars) > 0) output_vars = output_vars ", ";
 				output_vars = output_vars e;


ksymtab entries are extern for 3.14.28 kernels

--- scripts/modpost.awk
+++ scripts/modpost.awk
@@ -822,6 +822,19 @@
 			}
 		    }
 		    continue
+		}
+		if (substr(flags,1,1) == "g") {
+		    if (substr(flags,7,1) == "O") {
+			if (sub(/^_?_?__ksymtab/,"",sec)) {
+			    sub(/\+.*/,"",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
+			}
+		    }
 		}
 		if (sec == "*ABS*") {
 		    if (substr(flags,1,1) == "g") {


- updated modpost script for compressed kernel modules

--- scripts/modpost.awk
+++ scripts/modpost.awk
@@ -901,6 +901,7 @@
 		}
 		print_debug(1,pfx "module = " $0)
 		sub(/(\.mod)?\.(k)?o(\.gz)?$/, "")
+		sub("^" me "." PROCINFO["pid"] ".modules/", "")
 		if (own == values["pkgdirectory"]) {
 		    sub(/.*\//, "")
 		    $0 = values["pkgdirectory"] "/" $0
@@ -1140,15 +1141,68 @@
     close(command)
     print_vinfo(1,"r: dumpfiles, syms " count_syms ", unds " count_unds)
 }
-function read_moduledir(directory, src,	    dir,command)
+function read_moduledir(directory, src,	    dir,command,find,file,tmpdir,dirs,written)
 {
     print_vinfo(1,"r: moduledir, directory = \"" directory "\"")
+    tmpdir = me "." PROCINFO["pid"] ".modules"
+    system_command("mkdir -p -- " tmpdir)
     dir = "kernel"
-    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 -j .init.text -j .exit.text -s"
-    read_modobject(command, dir, "kernel", src)
+    find = "find " directory "/" dir " -type f \\( -name '*.ko' -o -name '*.ko.gz' \\) 2>/dev/null"
+    if (system("test -d " directory "/" dir) == 0) {
+	system_command("rm -f -- " tmpdir "/modules.list 2>/dev/null")
+	written = 0
+	while ((find | getline file) == 1) {
+	    if (file~/\.ko\.gz$/) {
+		dir = tmpdir "/" file
+		sub(/\/[^\/]*$/, "", dir)
+		if (!(dir in dirs)) {
+		    system_command("mkdir -p -- " dir)
+		    dirs[dir] = 1
+		}
+		sub(/\.ko\.gz$/, ".ko", file)
+		system_command("gzip -dc " file ".gz >" tmpdir "/" file)
+		print tmpdir "/" file >> tmpdir "/modules.list"
+	    } else {
+		print file >> tmpdir "/modules.list"
+	    }
+	    written = 1
+	}
+	close(find)
+	if (written) {
+	    close(tmpdir "/modules.list")
+	    command = "cat " tmpdir "/modules.list | xargs -r objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -j .init.text -j .exit.text -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 -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -j .init.text -j .exit.text -s"
-    read_modobject(command, dir, values["pkgdirectory"], "pkgdirectory")
+    find = "find " directory "/" dir " -type f \\( -name '*.ko' -o -name '*.ko.gz' \\) 2>/dev/null"
+    if (system("test -d " directory "/" dir) == 0) {
+	system_command("rm -f -- " tmpdir "/modules.list 2>/dev/null")
+	written = 0
+	while ((find | getline file) == 1) {
+	    if (file~/\.ko\.gz$/) {
+		dir = tmpdir "/" file
+		sub(/\/[^\/]*$/, "", dir)
+		if (!(dir in dirs)) {
+		    system_command("mkdir -p -- " dir)
+		    dirs[dir] = 1
+		}
+		sub(/\.ko\.gz$/, ".ko", file)
+		system_command("gzip -dc " file ".gz >" tmpdir "/" file)
+		print tmpdir "/" file >> tmpdir "/modules.list"
+	    } else {
+		print file >> tmpdir "/modules.list"
+	    }
+	    written = 1
+	}
+	close(find)
+	if (written) {
+	    close("modules.list")
+	    command = "cat modules.list | xargs -r objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -j .init.text -j .exit.text -s"
+	    read_modobject(command, dir, values["pkgdirectory"], "pkgdirectory")
+	}
+    }
+    system_command("rm -rf -- " tmpdir)
 }
 function read_mymodules(modules, src,    i,pair,ind,base,name,sym,fmt) {
     fmt = "r: mymodules, %-20s: %14s; %-30s"
@@ -1156,9 +1210,11 @@
     for (i = 1; i in modules; i++)
 	print modules[i] > "modvers.list"
     close("modvers.list")
-    command = "cat modvers.list | xargs objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -j .init.text -j .exit.text -s"
+    #command = "cat modvers.list | xargs -r objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -j .init.text -j .exit.text -s"
+    command = "cat modvers.list | while read f ; do case $f in (*.ko) echo $f ;; (*.ko.gz) gzip -dc $f >/var/tmp/`basename $f .gz` ; echo /var/tmp/`basename $f .gz` ;; esac ; done | xargs -r objdump -t -j '*ABS*' -j '*UND*' -j __ksymtab -j __ksymtab_gpl -j __versions -j .init.text -j .exit.text -s"
     read_modobject(command, ".", values["pkgdirectory"], src)
     system("rm -f modvers.list")
+    system("rm -f /var/tmp/*.ko")
     # double check
     for (pair in mod_unds) {
 	split(pair, ind, SUBSEP); name = ind[1]; sym = ind[2]; base = name; gsub(/^.*\//, "", base)


[ru] remove deprecated scripts

[ru] remove deprecated scripts


add duration, but it does not activate yet

--- tools/slidy.awk
+++ tools/slidy.awk
@@ -5,7 +5,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' />")
+    sub(/<meta name="author" content="Bryan O'Sullivan" \/>/, "<meta name='author' content='Gabor Greif' />\n  <meta name='duration' content='45' />")
 }

 /^<body>/ {


Add date.

Add date.

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -3,6 +3,8 @@

 BEGIN {
   #After July 1 of this year, start reporting on this year. Before that, ignore this year.
+  str = "date +%m-%d-%Y";
+  str | getline date;
   str = "date +%Y";
   str | getline current_year;
   #close str;
@@ -16,6 +18,7 @@
   FS="\t"
   pn = 0
 }
+$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
@@ -148,7 +151,8 @@
     }

   printf "\n"
-  #printf "%s", date
-  #printf "\n"
+  printf "%s", date
+  printf "\n"
+
 }


droid

droid


Commons: handle Unicode '=' correctly, fix #420

--- include/Commons.awk
+++ include/Commons.awk
@@ -198,6 +198,8 @@
         return "&" # Unicode Character 'AMPERSAND'
     case "u003c":
         return "<" # Unicode Character 'LESS-THAN SIGN'
+    case "u003d":
+        return "=" # Unicode Character 'EQUALS SIGN'
     case "u003e":
         return ">" # Unicode Character 'GREATER-THAN SIGN'
     case "u200b":


LanguageHelper: getDescription()

LanguageHelper: getDescription()

--- include/LanguageHelper.awk
+++ include/LanguageHelper.awk
@@ -199,6 +199,11 @@
     return r
 }

+# Return the extra description of a language.
+function getDescription(code) {
+    return Locale[getCode(code)]["description"]
+}
+
 # Return 1 if a language is supported by Google; otherwise return 0.
 function isSupportedByGoogle(code,    engines, i, str) {
     str = Locale[getCode(code)]["supported-by"]
@@ -245,12 +250,17 @@

     if (getBranch(code)) {
         article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a"
-        desc = sprintf("%s is %s %s language spoken mainly in %s.",
-                       names, article, getBranch(code), getSpokenIn(code))
-    } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") {
-        desc = sprintf("%s is a language spoken mainly in %s.",
-                       names, getSpokenIn(code))
-    } else
+        if (iso == "eng")
+            desc = sprintf("%s is %s %s language spoken %s.",
+                           names, article, getBranch(code), getSpokenIn(code))
+        else
+            desc = sprintf("%s is %s %s language spoken mainly in %s.",
+                           names, article, getBranch(code), getSpokenIn(code))
+    } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate")
+        desc = sprintf("%s is a language spoken mainly in %s.", names, getSpokenIn(code))
+    else if (tolower(getFamily(code)) == "constructed language")
+        desc = sprintf("%s is %s.", names, getDescription(code))
+    else
         desc = sprintf("%s is a language of the %s family, spoken mainly in %s.",
                        names, getFamily(code), getSpokenIn(code))
     if (writing && getWrittenIn(code))


Theme: 3 predefined themes (default, none, random)

--- include/Theme.awk
+++ include/Theme.awk
@@ -13,6 +13,89 @@
     return temp
 }

+function randomColor(    i) {
+    i = int(5 * rand())
+    switch (i) {
+    case 0: return "green"
+    case 1: return "yellow"
+    case 2: return "blue"
+    case 3: return "magenta"
+    case 4: return "cyan"
+    default: return "default"
+    }
+}
+
+function setRandomTheme(    i, n, temp) {
+    srand(systime())
+    for (i = 0; i < 3; i++) {
+        do temp = randomColor(); while (belongsTo(temp, n))
+        n[i] = temp
+    }
+
+    Option["sgr-prompt-message"] = Option["sgr-languages"] = n[0]
+    Option["sgr-original-dictionary-detailed-word-class"][1] = n[0]
+    Option["sgr-original-dictionary-detailed-word-class"][2] = "bold"
+    Option["sgr-original-dictionary-synonyms"] = n[0]
+    Option["sgr-original-dictionary-synonyms-word-class"][1] = n[0]
+    Option["sgr-original-dictionary-synonyms-word-class"][2] = "bold"
+    Option["sgr-original-dictionary-examples"] = n[0]
+    Option["sgr-original-dictionary-see-also"] = n[0]
+    Option["sgr-dictionary-word-class"][1] = n[0]
+    Option["sgr-dictionary-word-class"][2] = "bold"
+
+    Option["sgr-original"][1] = Option["sgr-original-phonetics"][1] = n[1]
+    Option["sgr-original"][2] = Option["sgr-original-phonetics"][2] = "bold"
+    Option["sgr-prompt-message-original"][1] = n[1]
+    Option["sgr-prompt-message-original"][2] = "bold"
+    Option["sgr-languages-sl"] = n[1]
+    Option["sgr-original-dictionary-detailed-explanation"][1] = n[1]
+    Option["sgr-original-dictionary-detailed-explanation"][2] = "bold"
+    Option["sgr-original-dictionary-detailed-example"] = n[1]
+    Option["sgr-original-dictionary-detailed-synonyms"] = n[1]
+    Option["sgr-original-dictionary-detailed-synonyms-item"][1] = n[1]
+    Option["sgr-original-dictionary-detailed-synonyms-item"][2] = "bold"
+    Option["sgr-original-dictionary-synonyms-synonyms"] = n[1]
+    Option["sgr-original-dictionary-synonyms-synonyms-item"][1] = n[1]
+    Option["sgr-original-dictionary-synonyms-synonyms-item"][2] = "bold"
+    Option["sgr-original-dictionary-examples-example"] = n[1]
+    Option["sgr-original-dictionary-examples-original"][1] = n[1]
+    Option["sgr-original-dictionary-examples-original"][2] = "bold"
+    Option["sgr-original-dictionary-examples-original"][3] = "underline"
+    Option["sgr-original-dictionary-see-also-phrases"] = n[1]
+    Option["sgr-original-dictionary-see-also-phrases-item"][1] = n[1]
+    Option["sgr-original-dictionary-see-also-phrases-item"][2] = "bold"
+    Option["sgr-dictionary-explanation"] = n[1]
+    Option["sgr-dictionary-explanation-item"][1] = n[1]
+    Option["sgr-dictionary-explanation-item"][2] = "bold"
+    Option["sgr-alternatives-original"][1] = n[1]
+    Option["sgr-alternatives-original"][2] = "bold"
+
+    Option["sgr-translation"][1] = Option["sgr-translation-phonetics"][1] = n[2]
+    Option["sgr-translation"][2] = Option["sgr-translation-phonetics"][2] = "bold"
+    Option["sgr-languages-tl"] = n[2]
+    Option["sgr-dictionary-word"][1] = n[2]
+    Option["sgr-dictionary-word"][2] = "bold"
+    Option["sgr-alternatives-translations"] = n[2]
+    Option["sgr-alternatives-translations-item"][1] = n[2]
+    Option["sgr-alternatives-translations-item"][2] = "bold"
+}
+
+function setDefaultTheme() {
+    Option["sgr-translation"] = Option["sgr-translation-phonetics"] = "bold"
+    Option["sgr-prompt-message-original"] = "underline"
+    Option["sgr-languages-sl"] = "underline"
+    Option["sgr-languages-tl"] = "bold"
+    Option["sgr-original-dictionary-detailed-explanation"] = "bold"
+    Option["sgr-original-dictionary-detailed-synonyms-item"] = "bold"
+    Option["sgr-original-dictionary-synonyms-synonyms-item"] = "bold"
+    Option["sgr-original-dictionary-examples-original"][1] = "bold"
+    Option["sgr-original-dictionary-examples-original"][2] = "underline"
+    Option["sgr-original-dictionary-see-also-phrases-item"] = "bold"
+    Option["sgr-dictionary-word"] = "bold"
+    Option["sgr-alternatives-original"] = "underline"
+    Option["sgr-alternatives-translations-item"] = "bold"
+}
+
 function setTheme(    file, line, script) {
     if (Option["theme"] && Option["theme"] != "default") {
         file = Option["theme"]
@@ -26,22 +109,10 @@
         while (getline line < file)
             script = script "\n" line
         loadOptions(script)
-    } else {
-        # Default theme
-        Option["sgr-translation"] = "bold"
-        Option["sgr-translation-phonetics"] = "bold"
-        Option["sgr-prompt-message-original"] = "underline"
-        Option["sgr-languages-sl"] = "underline"
-        Option["sgr-languages-tl"] = "bold"
-        Option["fmt-languages"] = "[ %s -> %t ]"
-        Option["sgr-original-dictionary-detailed-explanation"] = "bold"
-        Option["sgr-original-dictionary-detailed-synonyms-item"] = "bold"
-        Option["sgr-original-dictionary-synonyms-synonyms-item"] = "bold"
-        Option["sgr-original-dictionary-examples-original"][1] = "bold"
-        Option["sgr-original-dictionary-examples-original"][2] = "underline"
-        Option["sgr-original-dictionary-see-also-phrases-item"] = "bold"
-        Option["sgr-dictionary-word"] = "bold"
-        Option["sgr-alternatives-original"] = "underline"
-        Option["sgr-alternatives-translations-item"] = "bold"
-    }
+    } else if (Option["theme"] == "none")
+        ;# skip
+    else if (Option["theme"] == "random")
+        setRandomTheme()
+    else
+        setDefaultTheme()
 }


Use a file name prefix for generated labels

This ensures labels are unique within the wider context of the doxygen
documentation.

--- doxy/githublabels.awk
+++ doxy/githublabels.awk
@@ -5,11 +5,27 @@
 #

 #
+# Get file name prefix for references.
+#
+filename != FILENAME {
+	filename = FILENAME
+	# strip path
+	"pwd" | getline path
+	path = path "/"
+	prefix = substr(filename, 1, length(path)) == path \
+	         ? substr(filename, length(path) + 1) \
+	         : filename
+	sub(/\.[^.]*$/, "", prefix)
+	gsub(/[^_a-z0-9]+/, "-", prefix)
+	prefix = "md_" prefix "_"
+}
+
+#
 # Substitute github references with doxygen references.
 #
 /\(#[_a-z0-9-]*\)/ {
 	gsub(/\(#[_a-z0-9-]*\)/, "<__REF__&__REF__>")
-	gsub(/<__REF__\(#/, "(@ref ")
+	gsub(/<__REF__\(#/, "(@ref " prefix)
 	gsub(/\)__REF__>/, ")")
 }

@@ -20,7 +36,7 @@
 line && (/^===*$/ || /^---*$/) {
 	id = tolower(line)
 	gsub(/[^_a-z0-9]+/, "-", id)
-	line = line " {#" id "}"
+	line = line " {#" prefix id "}"
 }

 #


make-barcodes.awk: Allow 0 TAG_LEN or INVARIANT values, remove semicolons.

--- make-barcodes.awk
+++ make-barcodes.awk
@@ -25,34 +25,35 @@
 # beta is first, but then you have bigger problems).

 BEGIN {
-  FS = "\t"; OFS = "\t";
+  FS = "\t"
+  OFS = "\t"
   # The number of bases from the start of each read that form the two halves of the barcode.
   # (this should be half the size of the full, canonical barcode).
-  if (! TAG_LEN) {
-    TAG_LEN = 12;
+  if (TAG_LEN == "") {
+    TAG_LEN = 12
   }
   # The number of bases in the read that are between the barcode and the start of the actual sample
   # sequence (the restriction site in the Loeb 2014 protocol).
-  if (! INVARIANT) {
-    INVARIANT = 5;
+  if (INVARIANT == "") {
+    INVARIANT = 5
   }
 }

 $3 && $4 {
-  alpha = substr($3, 1, TAG_LEN);
-  beta = substr($4, 1, TAG_LEN);
+  alpha = substr($3, 1, TAG_LEN)
+  beta = substr($4, 1, TAG_LEN)
   if (alpha > beta) {
-    barcode = alpha beta;
-    order = "ab";
+    barcode = alpha beta
+    order = "ab"
   } else {
-    barcode = beta alpha;
-    order = "ba";
+    barcode = beta alpha
+    order = "ba"
   }
-  name1 = $1;
-  name2 = $2;
-  seq1 = substr($3, TAG_LEN + INVARIANT + 1);
-  seq2 = substr($4, TAG_LEN + INVARIANT + 1);
-  qual1 = substr($7, TAG_LEN + INVARIANT + 1);
-  qual2 = substr($8, TAG_LEN + INVARIANT + 1);
-  print barcode, order, name1, seq1, qual1, name2, seq2, qual2;
+  name1 = $1
+  name2 = $2
+  seq1 = substr($3, TAG_LEN + INVARIANT + 1)
+  seq2 = substr($4, TAG_LEN + INVARIANT + 1)
+  qual1 = substr($7, TAG_LEN + INVARIANT + 1)
+  qual2 = substr($8, TAG_LEN + INVARIANT + 1)
+  print barcode, order, name1, seq1, qual1, name2, seq2, qual2
 }


Reorder episode tests

Reorder episode tests

--- getMHzFromSitemap.awk
+++ getMHzFromSitemap.awk
@@ -211,7 +211,13 @@
     gsub (/&/,"\\&",episodeTitle)
     sub (/^[[:space:]]/,"",episodeTitle)
     sub (/[[:space:]]+$/,"",episodeTitle)
-    #
+
+    # Make Montalbano titles agree with MHz listing
+    if (episodeTitle ~ /^Montalbano|^Detective Montalbano:/) {
+        sub (/^Montalbano:/,"Detective Montalbano:",episodeTitle)
+        sub (/^Montalbano and Me/,"Detective Montalbano: Montalbano and Me",episodeTitle)
+    }
+
     # Episode Types(s)
     # Default episodeType to "E"
     episodeType = "E"
@@ -226,38 +232,27 @@
         prEpisodeNumber += 1
         # print shortEpisodeURL " pr " prEpisodeNumber >"/dev/stderr"
     }
-    # If episode is a upcoming, i.e. - EP 507" Available... use its episode number
+    # print "==> episodeType = " episodeType > "/dev/stderr"
+
+    # Season and episode numbers
+    # If season only has one episode, set snEpisodeNumber to 1
+    if (seasonEpisodes == 1)
+        snEpisodeNumber = 1
+    # If episode is upcoming, i.e. - EP 507" Available... use its episode number
         if (match (episodeTitle, /-[[:space:]]{1,2}EP [[:digit:]]{3,4}/)) {
             snEpisodeNumber = substr(episodeTitle, RSTART+RLENGTH-2, 2)
         # print shortEpisodeURL " pr " prEpisodeNumber >"/dev/stderr"
     }
-    # print "==> episodeType = " episodeType > "/dev/stderr"
-    #
-    # Season and episode numbers
-    #
-    # Special case episode numbers
-    # Montalbano episodes have no season, make them season 1
-    if (episodeTitle ~ /^Montalbano|^Detective Montalbano:/) {
-        sub (/\(Ep/,"(Sn 1 Ep",episodeTitle)
-        sub (/^Montalbano:/,"Detective Montalbano:",episodeTitle)
-        sub (/^Montalbano and Me/,"Detective Montalbano: Montalbano and Me",episodeTitle)
-    }
+    # Grab the Episode Number from the trailing (Sn 1 Ep 1)
     # Baantjer Sn 1 Ep 12 is missing a parens
     sub (/Brotherhood of Blood Murder Sn/, "Brotherhood of Blood Murder (Sn",episodeTitle)
-    # A Night in ... is missing episode numbers
-    if (shortEpisodeURL ~ /season:1\/videos\/a-night-in/)
-        snEpisodeNumber = 1
-
-    # Grab the Episode Number from the trailing (Sn 1 Ep 1)
     # Episode Number(s)
     if (match (episodeTitle,/\(.*[Ee][Pp][ ]*[[:digit:]]+[[:space:]]*\)/)) {
-        # print "==> showTitle = " showTitle > "/dev/stderr"
         snEpisodeNumber = substr(episodeTitle, RSTART, RLENGTH)
         sub (/.*[[:space:]]/,"",snEpisodeNumber)
         sub (/\).*/,"",snEpisodeNumber)
         # print shortEpisodeURL " sn " snEpisodeNumber >"/dev/stderr"
     }
-
     # Octopus and some others uses -c-0
     if (match (shortEpisodeURL, /-c-[[:digit:]]{5}/)) {
         if (snEpisodeNumber == "" && prEpisodeNumber == "") {
@@ -265,6 +260,11 @@
             # print shortEpisodeURL " c- " snEpisodeNumber >"/dev/stderr"
          }
     }
+
+    # Special case episode numbers
+    # A Night in ... is missing episode numbers
+    if (shortEpisodeURL ~ /season:1\/videos\/a-night-in/)
+        snEpisodeNumber = 1

     # print "==> episodeTitle = " episodeTitle > "/dev/stderr"
     # Handle normal (Sn 1 Ep 1) with variations in spacing and capitalization


Languages: add Mizo

Languages: add Mizo

--- include/Languages.awk
+++ include/Languages.awk
@@ -1075,19 +1075,6 @@
     Locale["mr"]["glotto"]             = "mara1378"
     Locale["mr"]["script"]             = "Deva"

-    #65 Mongolian, Cyrillic alphabet
-    Locale["mn"]["name"]               = "Mongolian"
-    Locale["mn"]["endonym"]            = "Монгол"
-    Locale["mn"]["translations-of"]    = "%s-н орчуулга"
-    Locale["mn"]["definitions-of"]     = "%s үгийн тодорхойлолт"
-    Locale["mn"]["synonyms"]           = "Ойролцоо утгатай"
-    Locale["mn"]["examples"]           = "Жишээнүүд"
-    Locale["mn"]["see-also"]           = "Мөн харах"
-    Locale["mn"]["family"]             = "Mongolic"
-    Locale["mn"]["iso"]                = "mon"
-    Locale["mn"]["glotto"]             = "mong1331"
-    Locale["mn"]["script"]             = "Cyrl"
-
     # Meiteilon / Manipuri
     Locale["mni-Mtei"]["name"]         = "Meiteilon"
     Locale["mni-Mtei"]["name2"]        = "Manipuri"
@@ -1103,6 +1090,32 @@
     Locale["mni-Mtei"]["iso"]          = "mni"
     Locale["mni-Mtei"]["glotto"]       = "mani1292"
     Locale["mni-Mtei"]["script"]       = "Mtei"
+
+    # Mizo
+    Locale["lus"]["name"]              = "Mizo"
+    Locale["lus"]["endonym"]           = "Mizo ṭawng"
+    #Locale["lus"]["translations-of"]
+    #Locale["lus"]["definitions-of"]
+    #Locale["lus"]["synonyms"]
+    #Locale["lus"]["examples"]
+    #Locale["lus"]["see-also"]
+    Locale["lus"]["family"]            = "Sino-Tibetan"
+    Locale["lus"]["iso"]               = "lus"
+    Locale["lus"]["glotto"]            = "lush1249"
+    Locale["lus"]["script"]            = "Latn"
+
+    #65 Mongolian, Cyrillic alphabet
+    Locale["mn"]["name"]               = "Mongolian"
+    Locale["mn"]["endonym"]            = "Монгол"
+    Locale["mn"]["translations-of"]    = "%s-н орчуулга"
+    Locale["mn"]["definitions-of"]     = "%s үгийн тодорхойлолт"
+    Locale["mn"]["synonyms"]           = "Ойролцоо утгатай"
+    Locale["mn"]["examples"]           = "Жишээнүүд"
+    Locale["mn"]["see-also"]           = "Мөн харах"
+    Locale["mn"]["family"]             = "Mongolic"
+    Locale["mn"]["iso"]                = "mon"
+    Locale["mn"]["glotto"]             = "mong1331"
+    Locale["mn"]["script"]             = "Cyrl"

     #66 Myanmar / Burmese
     Locale["my"]["name"]               = "Myanmar"