Languages: add scriptName(code); update getDetails(code)

--- include/Languages.awk
+++ include/Languages.awk
@@ -40,7 +40,7 @@
     Locale["sq"]["glotto"]             = "alba1267"
     Locale["sq"]["script"]             = "Latn"

-    #3 Arabic
+    #3 Arabic (Standard Arabic)
     Locale["ar"]["name"]               = "Arabic"
     Locale["ar"]["endonym"]            = "العربية"
     Locale["ar"]["translations-of"]    = "ترجمات %s"
@@ -50,11 +50,11 @@
     Locale["ar"]["see-also"]           = "انظر أيضًا"
     Locale["ar"]["family"]             = "Afro-Asiatic"
     Locale["ar"]["iso"]                = "ara"
-    Locale["ar"]["glotto"]             = "arab1395"
+    Locale["ar"]["glotto"]             = "stan1318"
     Locale["ar"]["script"]             = "Arab"
     Locale["ar"]["rtl"]                = "true" # RTL language

-    #4 Armenian
+    #4 Armenian (Modern Armenian)
     Locale["hy"]["name"]               = "Armenian"
     Locale["hy"]["endonym"]            = "Հայերեն"
     Locale["hy"]["translations-of"]    = "%s-ի թարգմանությունները"
@@ -64,10 +64,10 @@
     Locale["hy"]["see-also"]           = "Տես նաև"
     Locale["hy"]["family"]             = "Indo-European"
     Locale["hy"]["iso"]                = "hye"
-    Locale["hy"]["glotto"]             = "arme1241"
+    Locale["hy"]["glotto"]             = "nucl1235"
     Locale["hy"]["script"]             = "Armn"

-    #5 Azerbaijani
+    #5 Azerbaijani (North Azerbaijani)
     Locale["az"]["name"]               = "Azerbaijani"
     Locale["az"]["endonym"]            = "Azərbaycanca"
     Locale["az"]["translations-of"]    = "%s sözünün tərcüməsi"
@@ -77,7 +77,7 @@
     Locale["az"]["see-also"]           = "Həmçinin, baxın:"
     Locale["az"]["family"]             = "Turkic"
     Locale["az"]["iso"]                = "aze"
-    Locale["az"]["glotto"]             = "azer1255"
+    Locale["az"]["glotto"]             = "nort2697"
     Locale["az"]["script"]             = "Latn"

     #6 Basque
@@ -88,7 +88,7 @@
     Locale["eu"]["synonyms"]           = "Sinonimoak"
     Locale["eu"]["examples"]           = "Adibideak"
     Locale["eu"]["see-also"]           = "Ikusi hauek ere"
-    #Locale["eu"]["family"]
+    Locale["eu"]["family"]             = "Language Isolate"
     Locale["eu"]["iso"]                = "eus"
     Locale["eu"]["glotto"]             = "basq1248"
     Locale["eu"]["script"]             = "Latn"
@@ -145,7 +145,7 @@
     Locale["bg"]["glotto"]             = "bulg1262"
     Locale["bg"]["script"]             = "Cyrl"

-    #11 Catalan
+    #11 Catalan (Standard Catalan)
     Locale["ca"]["name"]               = "Catalan"
     Locale["ca"]["endonym"]            = "Català"
     Locale["ca"]["translations-of"]    = "Traduccions per a %s"
@@ -184,7 +184,7 @@
     Locale["ny"]["glotto"]             = "nyan1308"
     Locale["ny"]["script"]             = "Latn"

-    #14a Chinese (Simplified)
+    #14a Chinese (Mandarin Chinese), Simplified
     Locale["zh-CN"]["name"]            = "Chinese Simplified"
     Locale["zh-CN"]["endonym"]         = "简体中文"
     Locale["zh-CN"]["translations-of"] = "%s 的翻译"
@@ -197,7 +197,7 @@
     Locale["zh-CN"]["glotto"]          = "mand1415"
     Locale["zh-CN"]["script"]          = "Hans"

-    #14b Chinese (Traditional)
+    #14b Chinese (Mandarin Chinese), Traditional
     Locale["zh-TW"]["name"]            = "Chinese Traditional"
     Locale["zh-TW"]["endonym"]         = "正體中文"
     Locale["zh-TW"]["translations-of"] = "「%s」的翻譯"
@@ -262,7 +262,7 @@
     Locale["nl"]["glotto"]             = "dutc1256"
     Locale["nl"]["script"]             = "Latn"

-    #19 English
+    #19 English (Standard English)
     Locale["en"]["name"]               = "English"
     Locale["en"]["endonym"]            = "English"
     Locale["en"]["translations-of"]    = "Translations of %s"
@@ -327,7 +327,7 @@
     Locale["fi"]["glotto"]             = "finn1318"
     Locale["fi"]["script"]             = "Latn"

-    #24 French
+    #24 French (Standard French)
     Locale["fr"]["name"]               = "French"
     Locale["fr"]["endonym"]            = "Français"
     Locale["fr"]["translations-of"]    = "Traductions de %s"
@@ -353,7 +353,7 @@
     Locale["gl"]["glotto"]             = "gali1258"
     Locale["gl"]["script"]             = "Latn"

-    #26 Georgian, Mkhedruli
+    #26 Georgian (Modern Georgian)
     Locale["ka"]["name"]               = "Georgian"
     Locale["ka"]["endonym"]            = "ქართული"
     Locale["ka"]["translations-of"]    = "%s-ის თარგმანები"
@@ -366,7 +366,7 @@
     Locale["ka"]["glotto"]             = "nucl1302"
     Locale["ka"]["script"]             = "Geor"

-    #27 German
+    #27 German (Standard German)
     Locale["de"]["name"]               = "German"
     Locale["de"]["endonym"]            = "Deutsch"
     Locale["de"]["translations-of"]    = "Übersetzungen für %s"
@@ -379,7 +379,7 @@
     Locale["de"]["glotto"]             = "stan1295"
     Locale["de"]["script"]             = "Latn"

-    #28 Greek (Modern)
+    #28 Greek (Modern Greek)
     Locale["el"]["name"]               = "Greek"
     Locale["el"]["endonym"]            = "Ελληνικά"
     Locale["el"]["translations-of"]    = "Μεταφράσεις του %s"
@@ -418,7 +418,7 @@
     Locale["ht"]["glotto"]             = "hait1244"
     Locale["ht"]["script"]             = "Latn"

-    #31 Hausa, Latin / Boko alphabet
+    #31 Hausa, Latin alphabet
     Locale["ha"]["name"]               = "Hausa"
     Locale["ha"]["endonym"]            = "Hausa"
     Locale["ha"]["translations-of"]    = "Fassarar %s"
@@ -431,7 +431,7 @@
     Locale["ha"]["glotto"]             = "haus1257"
     Locale["ha"]["script"]             = "Latn"

-    #32 Hebrew (Modern)
+    #32 Hebrew
     Locale["he"]["name"]               = "Hebrew"
     Locale["he"]["endonym"]            = "עִבְרִית"
     Locale["he"]["translations-of"]    = "תרגומים של %s"
@@ -458,7 +458,7 @@
     Locale["hi"]["glotto"]             = "hind1269"
     Locale["hi"]["script"]             = "Deva"

-    #34 Hmong
+    #34 Hmong (First Vernacular Hmong)
     Locale["hmn"]["name"]              = "Hmong"
     Locale["hmn"]["endonym"]           = "Hmoob"
     Locale["hmn"]["translations-of"]   = "Lus txhais: %s"
@@ -507,7 +507,7 @@
     Locale["ig"]["see-also"]           = "Hụkwuo"
     Locale["ig"]["family"]             = "Atlantic-Congo"
     Locale["ig"]["iso"]                = "ibo"
-    Locale["ig"]["glotto"]             = "igbo1259"
+    Locale["ig"]["glotto"]             = "nucl1417"
     Locale["ig"]["script"]             = "Latn"

     #38 Indonesian
@@ -559,7 +559,7 @@
     Locale["ja"]["see-also"]           = "関連項目"
     Locale["ja"]["family"]             = "Japonic"
     Locale["ja"]["iso"]                = "jpn"
-    Locale["ja"]["glotto"]             = "japa1256"
+    Locale["ja"]["glotto"]             = "nucl1643"
     Locale["ja"]["script"]             = "Jpan"

     #42 Javanese, Latin alphabet
@@ -575,7 +575,7 @@
     Locale["jv"]["glotto"]             = "java1254"
     Locale["jv"]["script"]             = "Latn"

-    #43 Kannada
+    #43 Kannada (Modern Kannada)
     Locale["kn"]["name"]               = "Kannada"
     Locale["kn"]["endonym"]            = "ಕನ್ನಡ"
     Locale["kn"]["translations-of"]    = "%s ನ ಅನುವಾದಗಳು"
@@ -585,7 +585,7 @@
     Locale["kn"]["see-also"]           = "ಇದನ್ನೂ ಗಮನಿಸಿ"
     Locale["kn"]["family"]             = "Dravidian"
     Locale["kn"]["iso"]                = "kan"
-    Locale["kn"]["glotto"]             = "kann1255"
+    Locale["kn"]["glotto"]             = "nucl1305"
     Locale["kn"]["script"]             = "Knda"

     #44 Kazakh, Cyrillic alphabet
@@ -644,10 +644,10 @@
     Locale["la"]["name"]               = "Latin"
     Locale["la"]["endonym"]            = "Latina"
     Locale["la"]["translations-of"]    = "Versio de %s"
-    #Locale["la"]["definitions-of"]     = ""
-    #Locale["la"]["synonyms"]           = ""
-    #Locale["la"]["examples"]           = ""
-    #Locale["la"]["see-also"]           = ""
+    #Locale["la"]["definitions-of"]
+    #Locale["la"]["synonyms"]
+    #Locale["la"]["examples"]
+    #Locale["la"]["see-also"]
     Locale["la"]["family"]             = "Indo-European"
     Locale["la"]["iso"]                = "lat"
     Locale["la"]["glotto"]             = "lati1261"
@@ -692,7 +692,7 @@
     Locale["mk"]["glotto"]             = "mace1250"
     Locale["mk"]["script"]             = "Cyrl"

-    #52 Malagasy (Merina dialect, Plateau Malagasy)
+    #52 Malagasy (Plateau Malagasy)
     Locale["mg"]["name"]               = "Malagasy"
     Locale["mg"]["endonym"]            = "Malagasy"
     Locale["mg"]["translations-of"]    = "Dikan'ny %s"
@@ -705,7 +705,7 @@
     Locale["mg"]["glotto"]             = "plat1254"
     Locale["mg"]["script"]             = "Latn"

-    #53 Malay
+    #53 Malay (Standard Malay)
     Locale["ms"]["name"]               = "Malay"
     Locale["ms"]["endonym"]            = "Bahasa Melayu"
     Locale["ms"]["translations-of"]    = "Terjemahan %s"
@@ -822,7 +822,7 @@
     Locale["no"]["glotto"]             = "norw1258"
     Locale["no"]["script"]             = "Latn"

-    #62 Persian (Farsi)
+    #62 Persian (Western Farsi)
     Locale["fa"]["name"]               = "Persian"
     Locale["fa"]["endonym"]            = "فارسی"
     Locale["fa"]["translations-of"]    = "ترجمه‌های %s"
@@ -832,11 +832,37 @@
     Locale["fa"]["see-also"]           = "همچنین مراجعه کنید به"
     Locale["fa"]["family"]             = "Indo-European"
     Locale["fa"]["iso"]                = "fas"
-    #Locale["fa"]["glotto"]
+    Locale["fa"]["glotto"]             = "west2369"
     Locale["fa"]["script"]             = "Arab"
     Locale["fa"]["rtl"]                = "true" # RTL language

-    #63 Punjabi, Brahmic / Gurmukhī alphabet
+    #63 Polish
+    Locale["pl"]["name"]               = "Polish"
+    Locale["pl"]["endonym"]            = "Polski"
+    Locale["pl"]["translations-of"]    = "Tłumaczenia %s"
+    Locale["pl"]["definitions-of"]     = "%s – definicje"
+    Locale["pl"]["synonyms"]           = "Synonimy"
+    Locale["pl"]["examples"]           = "Przykłady"
+    Locale["pl"]["see-also"]           = "Zobacz też"
+    Locale["pl"]["family"]             = "Indo-European"
+    Locale["pl"]["iso"]                = "pol"
+    Locale["pl"]["glotto"]             = "poli1260"
+    Locale["pl"]["script"]             = "Latn"
+
+    #64 Portuguese
+    Locale["pt"]["name"]               = "Portuguese"
+    Locale["pt"]["endonym"]            = "Português"
+    Locale["pt"]["translations-of"]    = "Traduções de %s"
+    Locale["pt"]["definitions-of"]     = "Definições de %s"
+    Locale["pt"]["synonyms"]           = "Sinônimos"
+    Locale["pt"]["examples"]           = "Exemplos"
+    Locale["pt"]["see-also"]           = "Veja também"
+    Locale["pt"]["family"]             = "Indo-European"
+    Locale["pt"]["iso"]                = "por"
+    Locale["pt"]["glotto"]             = "port1283"
+    Locale["pt"]["script"]             = "Latn"
+
+    #65 Punjabi, Gurmukhī alphabet
     Locale["pa"]["name"]               = "Punjabi"
     Locale["pa"]["endonym"]            = "ਪੰਜਾਬੀ"
     Locale["pa"]["translations-of"]    = "ਦੇ ਅਨੁਵਾਦ%s"
@@ -848,32 +874,6 @@
     Locale["pa"]["iso"]                = "pan"
     Locale["pa"]["glotto"]             = "panj1256"
     Locale["pa"]["script"]             = "Guru"
-
-    #64 Polish
-    Locale["pl"]["name"]               = "Polish"
-    Locale["pl"]["endonym"]            = "Polski"
-    Locale["pl"]["translations-of"]    = "Tłumaczenia %s"
-    Locale["pl"]["definitions-of"]     = "%s – definicje"
-    Locale["pl"]["synonyms"]           = "Synonimy"
-    Locale["pl"]["examples"]           = "Przykłady"
-    Locale["pl"]["see-also"]           = "Zobacz też"
-    Locale["pl"]["family"]             = "Indo-European"
-    Locale["pl"]["iso"]                = "pol"
-    Locale["pl"]["glotto"]             = "poli1260"
-    Locale["pl"]["script"]             = "Latn"
-
-    #65 Portuguese
-    Locale["pt"]["name"]               = "Portuguese"
-    Locale["pt"]["endonym"]            = "Português"
-    Locale["pt"]["translations-of"]    = "Traduções de %s"
-    Locale["pt"]["definitions-of"]     = "Definições de %s"
-    Locale["pt"]["synonyms"]           = "Sinônimos"
-    Locale["pt"]["examples"]           = "Exemplos"
-    Locale["pt"]["see-also"]           = "Veja também"
-    Locale["pt"]["family"]             = "Indo-European"
-    Locale["pt"]["iso"]                = "por"
-    Locale["pt"]["glotto"]             = "port1283"
-    Locale["pt"]["script"]             = "Latn"

     #66 Romanian
     Locale["ro"]["name"]               = "Romanian"
@@ -1308,16 +1308,57 @@
     return Locale[getCode(code)]["rtl"] ? 1 : 0
 }

+# Return the name of script (writing system).
+# See: <https://en.wikipedia.org/wiki/ISO_15924#List_of_codes>
+function scriptName(code) {
+    switch (code) {
+    case "Arab": return "Arabic"
+    case "Armn": return "Armenian"
+    case "Beng": return "Bengali"
+    case "Cyrl": return "Cyrillic"
+    case "Deva": return "Devanagari"
+    case "Geor": return "Georgian (Mkhedruli)"
+    case "Grek": return "Greek"
+    case "Gujr": return "Gujarati"
+    case "Guru": return "Gurmukhi"
+    case "Hani": return "Han"
+    case "Hans": return "Han (Simplified)"
+    case "Hant": return "Han (Traditional)"
+    case "Hebr": return "Hebrew"
+    case "Jpan": return "Japanese (Han + Hiragana + Katakana)"
+    case "Khmr": return "Khmer"
+    case "Knda": return "Kannada"
+    case "Kore": return "Korean (Hangul + Han)"
+    case "Laoo": return "Lao"
+    case "Latn": return "Latin"
+    case "Mlym": return "Malayalam"
+    case "Mymr": return "Myanmar"
+    case "Sinh": return "Sinhala"
+    case "Taml": return "Tamil"
+    case "Telu": return "Telugu"
+    case "Thai": return "Thai"
+    default: return "Unknown"
+    }
+}
+
 # Return detailed information of a language as a string.
-function getDetails(code) {
-    return sprintf("%s\n", getName(code))                     \
-        sprintf("%s\n", getDisplay(code))                     \
-        sprintf("%-22s%s\n", "family", getFamily(code))       \
-        sprintf("%-22s%s\n", "code", getCode(code))           \
-        sprintf("%-22s%s\n", "iso", getISO(code))             \
-        sprintf("%-22s%s\n", "glotto", getGlotto(code))       \
-        sprintf("%-22s%s\n", "script", getScript(code))       \
-        sprintf("%-22s%s", "rtl", isRTL(code))
+function getDetails(code,    group, ws, iso) {
+    if (code == "auto" || !getCode(code))
+        return prettify("languages", sprintf("%-22s%s\n", "Unknown code", ansi("bold", code)))
+
+    ws = scriptName(getScript(code))
+    if (isRTL(code)) ws = ws " (R-to-L)"
+    split(getISO(code), group, "-")
+    iso = group[1]
+    return sprintf("%s\n", prettify("translation", getDisplay(code)))   \
+        prettify("languages",                                           \
+                 sprintf("%-22s%s\n", "Name", ansi("bold", getName(code))) \
+                 sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code))) \
+                 sprintf("%-22s%s\n", "Writing system", ansi("bold", ws)) \
+                 sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code))) \
+                 sprintf("%-22s%s\n", "ISO 639-3", ansi("bold", iso))   \
+                 sprintf("%-22s%s\n", "Ethnologue", ansi("bold", "http://www.ethnologue.com/language/" iso)) \
+                 sprintf("%-22s%s", "Glottolog", ansi("bold", "http://glottolog.org/resource/languoid/id/" getGlotto(code))))
 }

 # Add /slashes/ for IPA phonemic notations and (parentheses) for others.


build.awk: update

build.awk: update

--- build.awk
+++ build.awk
@@ -94,6 +94,8 @@

     print "***" length(Locale) "*** *languages in total. "              \
         "Generated from the source code of Translate Shell " Version ".*\n" > WikiLanguages
+    print "*Version: [English](https://github.com/soimort/translate-shell/wiki/Languages) " \
+        "| [Chinese Simplified](https://github.com/soimort/translate-shell/wiki/Languages-%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29)*\n" > WikiLanguages
     print "| Code | Name | Family | [Writing system](https://github.com/soimort/translate-shell/wiki/Writing-Systems-and-Fonts) | Is [RTL](http://en.wikipedia.org/wiki/Right-to-left)? | Has dictionary? |" > WikiLanguages
     print "| :--: | ---: | -----: | :------------: | :---------------------------------------------------: | :-------------: |" > WikiLanguages
     saveSortedIn = PROCINFO["sorted_in"]


adding dataset-independent global params recognition in convert.sh; added dataset change in update-e-params.awk

--- bin/util/update-e-params-subject-discrim.awk
+++ bin/util/update-e-params-subject-discrim.awk
@@ -9,7 +9,7 @@
       printf("      conversion:subject_discriminator \"%s\";\n",subjectDiscriminator)

    }else if( $0~"conversion:dataset_version" ) {                          # TODO: DEPRECATED (but converter not recognizing it)
-      printf("   conversion:dataset_version \"%s\";\n",datasetVersion)
+      printf("   conversion:dataset_version    \"%s\";\n",datasetVersion)
    }else if( $0~"conversion:version_identifier" ) {
       printf("   conversion:version_identifier \"%s\";\n",datasetVersion)


added owl ns and fixed slash escape WARNING.

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -40,6 +40,7 @@
    }
    print "@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> ."
    if(length(conversionID)) {
+      print "@prefix owl:        <http://www.w3.org/2002/07/owl#> ."
       print "@prefix vann:       <http://purl.org/vocab/vann/> ."
       print "@prefix skos:       <http://www.w3.org/2004/02/skos/core#> ."
       print "@prefix time:       <http://www.w3.org/2006/time#> ."
@@ -90,7 +91,7 @@
    if(length(subjectDiscriminator)) printf("      conversion:subject_discriminator  \"%s\";\n",subjectDiscriminator);
                                      print
    if(length(person_uri)&&length(machine_uri)&&length(whoami)) {
-                                    printf("      dcterms:creator <%s%s\>;\n",machine_uri,whoami);
+                                    printf("      dcterms:creator <%s%s>;\n",machine_uri,whoami);
    }else if(length(person_uri)) {
                                     printf("      dcterms:creator \"%s\";\n",person_uri);
    }else if(length(whoami)) {


use nt positions from gspan for vertex dict

--- bin/gspan2vertex_dict.awk
+++ bin/gspan2vertex_dict.awk
@@ -7,18 +7,11 @@
 /^t/{
 	seqid++;
 	vertex_id=0;
-	nt_pos=0;
 }
 # new entry on viewpoint vertice (omitting relational vertices)
-/^v/&&!/\^/&&!/#/{
-	print seqid, vertex_id++, $3, nt_pos++;
+/^v/ && !/\^/ && !/#/ {
+	print seqid, vertex_id++, $3, $4-1;
 }
 # non-viewpoint  vertices only increment nucleotide position
-/^V/&&!/\^/&&!/#/{
-	nt_pos++
+/^V/ && !/\^/ && !/#/ {
 }
-# restart sequence numbering on new subgraph
-# (this does not work with shifted shreps!)
-/^s/||/^u/||/^w/{
-	nt_pos=0
-}


LanguageData: update section R

LanguageData: update section R

--- include/LanguageData.awk
+++ include/LanguageData.awk
@@ -1919,9 +1919,7 @@
     Locale["otq"]["spoken-in"]         = "Querétaro in Mexico"
     Locale["otq"]["supported-by"]      = "bing"

-
-
-    #75 Romanian
+    # Romanian / Moldovan, Latin alphabet
     Locale["ro"]["name"]               = "Romanian"
     Locale["ro"]["endonym"]            = "Română"
     Locale["ro"]["translations-of"]    = "Traduceri pentru %s"
@@ -1930,11 +1928,30 @@
     Locale["ro"]["examples"]           = "Exemple"
     Locale["ro"]["see-also"]           = "Vedeți și"
     Locale["ro"]["family"]             = "Indo-European"
+    Locale["ro"]["branch"]             = "Eastern Romance"
     Locale["ro"]["iso"]                = "ron"
     Locale["ro"]["glotto"]             = "roma1327"
     Locale["ro"]["script"]             = "Latn"
-
-    #76 Russian
+    Locale["ro"]["spoken-in"]          = "Romania; Moldova"
+    Locale["ro"]["supported-by"]       = "google; bing; yandex"
+
+    # Romansh
+    Locale["rm"]["name"]               = "Romansh"
+    Locale["rm"]["endonym"]            = "Rumantsch"
+    #Locale["rm"]["translations-of"]
+    #Locale["rm"]["definitions-of"]
+    #Locale["rm"]["synonyms"]
+    #Locale["rm"]["examples"]
+    #Locale["rm"]["see-also"]
+    Locale["rm"]["family"]             = "Indo-European"
+    Locale["rm"]["branch"]             = "Western Romance"
+    Locale["rm"]["iso"]                = "roh"
+    Locale["rm"]["glotto"]             = "roma1326"
+    Locale["rm"]["script"]             = "Latn"
+    Locale["rm"]["spoken-in"]          = "the Swiss canton of the Grisons"
+    Locale["rm"]["supported-by"]       = ""
+
+    # Russian
     Locale["ru"]["name"]               = "Russian"
     Locale["ru"]["endonym"]            = "Русский"
     Locale["ru"]["translations-of"]    = "%s: варианты перевода"
@@ -1943,10 +1960,15 @@
     Locale["ru"]["examples"]           = "Примеры"
     Locale["ru"]["see-also"]           = "Похожие слова"
     Locale["ru"]["family"]             = "Indo-European"
+    Locale["ru"]["branch"]             = "East Slavic"
     Locale["ru"]["iso"]                = "rus"
     Locale["ru"]["glotto"]             = "russ1263"
     Locale["ru"]["script"]             = "Cyrl"
     Locale["ru"]["dictionary"]         = "true" # has dictionary
+    Locale["ru"]["spoken-in"]          = "the Russian-speaking world"
+    Locale["ru"]["supported-by"]       = "google; bing; yandex"
+
+

     #77 Samoan
     Locale["sm"]["name"]               = "Samoan"
@@ -2510,20 +2532,6 @@
     Locale["oc"]["iso"]                = "oci"
     Locale["oc"]["glotto"]             = "occi1239"
     Locale["oc"]["script"]             = "Latn"
-
-    #? Romansh
-    Locale["rm"]["support"]            = "unstable"
-    Locale["rm"]["name"]               = "Romansh"
-    Locale["rm"]["endonym"]            = "Rumantsch"
-    #Locale["rm"]["translations-of"]
-    #Locale["rm"]["definitions-of"]
-    #Locale["rm"]["synonyms"]
-    #Locale["rm"]["examples"]
-    #Locale["rm"]["see-also"]
-    Locale["rm"]["family"]             = "Indo-European"
-    Locale["rm"]["iso"]                = "roh"
-    Locale["rm"]["glotto"]             = "roma1326"
-    Locale["rm"]["script"]             = "Latn"

     #? Tibetan (Standard Tibetan)
     Locale["bo"]["support"]            = "unstable"
@@ -2623,6 +2631,8 @@
     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["moldavian"] = "ro"
+    LocaleAlias["moldovan"] = "ro"
     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!)
     LocaleAlias["nn"] = "no"


Distinguish the cases when a dup symbol is in different versions
(evil, needs a error) or in the same version (harmless, deserves
a mere warning).

Noticed by:     grehan@, tinderbox

--- share/mk/version_gen.awk
+++ share/mk/version_gen.awk
@@ -34,12 +34,12 @@
 #                  version name.
 #   symbols[][] - array index by [version name, symbol index], contains
 #                 names of symbols defined for each version.
-#   names[] - array index is symbol name and value is count,
+#   names[] - array index is symbol name and value is its first version seen,
 #	      used to check for duplicate symbols and warn about them.
 #
 BEGIN {
 	brackets = 0;
-	errors = 0;
+	errors = warns = 0;
 	version_count = 0;
 	current_version = "";
 	stderr = "/dev/stderr";
@@ -148,12 +148,30 @@
 		count = versions[current_version];
 		versions[current_version]++;
 		symbols[current_version, count] = $1;
-		if (names[$1]++) {
-			printf("File %s, line %d: Duplicated symbol `%s'. " \
+		if ($1 in names && names[$1] != current_version) {
+			#
+			# A graver case when a dup symbol appears under
+			# different versions in the map.  That can result
+			# in subtle problems with the library later.
+			#
+			printf("File %s, line %d: Duplicated symbol `%s' " \
+			    "in version `%s', first seen in `%s'. " \
 			    "Did you forget to move it to ObsoleteVersions?\n",
-			    filename, FNR, $1) > stderr;
+			    filename, FNR, $1,
+			    current_version, names[$1]) > stderr;
 			errors++;
 		}
+		else if (names[$1] == current_version) {
+			#
+			# A harmless case: a dup symbol with the same version.
+			#
+			printf("File %s, line %d: warning: " \
+			    "Duplicated symbol `%s' in version `%s'.\n",
+			    filename, FNR, $1, current_version) > stderr;
+			warns++;
+		}
+		else
+			names[$1] = current_version;
 	}
 	else {
 		printf("File %s, line %d: Symbol `%s' outside version scope.\n",
@@ -221,7 +239,7 @@

 END {
 	if (errors) {
-		printf("%d errors total.\n", errors) > stderr;
+		printf("%d error(s) total.\n", errors) > stderr;
 		exit(1);
 	}
 	# OK, no errors.


Comment fixes from Larry Rosenman" <ler@lerctr.org>.

--- contrib/mac/ouiparse.awk
+++ contrib/mac/ouiparse.awk
@@ -1,4 +1,4 @@
-# $Id: ouiparse.awk,v 1.1 2000/08/23 06:02:23 thomas Exp $
+# $Id: ouiparse.awk,v 1.2 2000/08/23 13:44:14 thomas Exp $
 #
 # ouiparse.awk
 # Author: Lawrence E. Rosenman <ler@lerctr.org>
@@ -10,10 +10,9 @@
 #        manufacturer text);
 # the table name is set by setting the AWK variable TABLE
 #
-# we translate the character apostrophe (') to space inside the company name
-# to avoid SQL errors.
+# we translate the character apostrophe (') to double apostrophe ('') inside
+# the company name to avoid SQL errors.
 #
-# match ONLY lines that begin with 2 hex numbers, -, and another hex number

 BEGIN {
 	TABLE="macoui";
@@ -27,6 +26,7 @@
 	printf "COMMIT TRANSACTION;";
 }

+# match ONLY lines that begin with 2 hex numbers, -, and another hex number
 /^[0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F]/ {
 #	if (nrec >= 100) {
 #		printf "COMMIT TRANSACTION;";
@@ -47,7 +47,7 @@
 		Company=Company " " $i;
 	# Modify any apostrophes (') to avoid grief below.
 	gsub("'","''",Company);
-	# Print out for the 'C' structure in mac.c
+	# Print out for the SQL table insert
 	printf "INSERT INTO %s (addr, name) VALUES (trunc(macaddr \'%s\'),\'%s\');\n",
 		TABLE,OUI,Company;
 }


Minor cleanup of instructions

Minor cleanup of instructions

--- generateLinkFrom-text.awk
+++ generateLinkFrom-text.awk
@@ -12,9 +12,14 @@
 # https://www.netflix.com/title/80203122
 # Luxury Travel Show: Season 1: "Chiang Mai & Eze"
 #
-# Paste them in the same order they are in the Netflix "viewing activity" page
+# https://www.amazon.com/gp/video/detail/B07QBFM357/ref=stream_prime_hd_ep?autoplay=1&t=3128
+# Silent Witness, S16E001, Change, Part One
+#
+# Paste them in the same order they are in the Netflix or Amazon "viewing activity" page
+#
+# INVOCATION:
+#    awk -f generateLinkFrom-text.awk watched.txt

-# https://www.amazon.com/gp/video/detail/B07XZ8G9WJ/ref=stream_prime_hd_ep?autoplay=1&t=0
 /ref=stream_prime/ {
     sub (/\/ref=stream.*/,"")
 }


- handle fedora no modversions

- handle fedora no modversions

--- scripts/modpost.awk
+++ scripts/modpost.awk
@@ -1459,6 +1459,8 @@
     }
     if (count_syms)
 	close(file)
+    else
+	system_command("touch " file)
     print_vinfo(1,"w: syssymver, syms " count_syms)
 }
 function write_modsymver(file,    sym,line,count_syms,mod)
@@ -1485,6 +1487,8 @@
     }
     if (count_syms)
 	close(file)
+    else
+	system_command("touch " file)
     print_vinfo(1,"w: modsymver, syms " count_syms)
 }
 function create_missing_symsets(	progress,count,count_syms,count_sets,sym,set,setmiss,n,symbols,hash,symfile,pos)


Languages: add Guarani language

Languages: add Guarani language

--- include/Languages.awk
+++ include/Languages.awk
@@ -117,6 +117,19 @@
     Locale["fj"]["iso"]                = "fij"
     Locale["fj"]["glotto"]             = "fiji1243"
     Locale["fj"]["script"]             = "Latn"
+
+    #? Guarani
+    Locale["gn"]["name"]               = "Guarani"
+    Locale["gn"]["endonym"]            = "Avañe'ẽ"
+    #Locale["gn"]["translations-of"]
+    #Locale["gn"]["definitions-of"]
+    #Locale["gn"]["synonyms"]
+    #Locale["gn"]["examples"]
+    #Locale["gn"]["see-also"]
+    Locale["gn"]["family"]             = "Tupian"
+    Locale["gn"]["iso"]                = "grn"
+    Locale["gn"]["glotto"]             = "para1311"
+    Locale["gn"]["script"]             = "Latn"

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


Languages: update

Languages: update

--- include/Languages.awk
+++ include/Languages.awk
@@ -170,7 +170,7 @@
     Locale["ky"]["glotto"]             = "kirg1245"
     Locale["ky"]["script"]             = "Cyrl"

-    #? Kurdish, Latin alphabet
+    #? Kurdish (Central Kurdish, Sorani), Latin alphabet
     Locale["ku"]["name"]               = "Kurdish"
     Locale["ku"]["endonym"]            = "Kurdî"
     #Locale["ku"]["translations-of"]
@@ -304,7 +304,7 @@

     #? Shona
     Locale["sn"]["name"]               = "Shona"
-    Locale["sn"]["endonym"]            = "ChiShona"
+    Locale["sn"]["endonym"]            = "chiShona"
     #Locale["sn"]["translations-of"]
     #Locale["sn"]["definitions-of"]
     #Locale["sn"]["synonyms"]


Start testing 2013.

Start testing 2013.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@29110 4f837ed2-42f5-46e7-a7a5-fa17313484d4

--- scripts/tdb/statuses_gln.awk
+++ scripts/tdb/statuses_gln.awk
@@ -8,7 +8,7 @@

 {
   # add a loop to add line only if either status is _not_ manifest or ending year is gt or eq to contract year
-  current_year = 2012
+  current_year = 2013
   end_year = 0
   incontract = 0
   test_year = ""


filtering for 10 only

filtering for 10 only

--- lib/obs.awk
+++ lib/obs.awk
@@ -200,7 +200,7 @@
 	  else
 		{
 		  print "
Recent observations
" ;
-		  if (n > 10) start = n-10 ;
+		  if (n > 10) start = n-9 ;
 		  else start = 1;
 		}
 	  # print the table header


library tweaks

library tweaks

--- library.awk
+++ library.awk
@@ -168,7 +168,7 @@

 # random permutation of k=n integers between 1 and n
 # the distribution of this isn't great, but it does cover the whole range of permutations
-# a random deck is: split(permute(52,52), deck)
+# a random deck is: split(permute(52,52), deck, SUBSEP)
 function permute(n,  k,   i, r, p) {
     k = checkpos(k, n, "permute: second argument must be positive")
     p = SUBSEP
@@ -1288,7 +1288,7 @@
 }

-function dirname(path, suffix) {
+function dirname(path) {
     if (!sub(/\/[^\/]*\/?$/, "", path))
         return "."
     else if (path != "")


refactor to remove a global variable

refactor to remove a global variable

--- csvquote.awk
+++ csvquote.awk
@@ -16,37 +16,33 @@
     # these are volatile global variables
     quote_in_effect = 0; # false
     maybe_escaped_quote_char = 0; # false
-    writebuf = "";
 }

 function replace_special_chars(c) {
+    answer = c; # default to pass-through
     if (maybe_escaped_quote_char) {
         if (c != quotechar) {
             # this is the end of a quoted field
             quote_in_effect = 0; # false
         }
-        writebuf = writebuf c; # concat
         maybe_escaped_quote_char = 0; # false
     } else if (quote_in_effect) {
         if (c == quotechar) {
             # this is either an escaped quote char or the end of a quoted
             # field. need to read one more character to decide which
-            writebuf = writebuf c; # concat
             maybe_escaped_quote_char = 1; # true
         } else if (c == delimiter) {
-            writebuf = writebuf delimiter_code; # concat
+            answer = delimiter_code; # override pass-through behavior
         } else if (c == recordsep) {
-            writebuf = writebuf recordsep_code; # concat
-        } else {
-            writebuf = writebuf c; # concat
+            answer = recordsep_code; # override pass-through behavior
         }
     } else {
         # quote not in effect
-        writebuf = writebuf c; # concat
         if (c == quotechar) {
             quote_in_effect = 1; # true
         }
     }
+    return answer;
 }

 (replace_mode) {
@@ -60,17 +56,16 @@
         }
     }
     if (fastrack) {
-        print writebuf $0;
-        writebuf = "";
+        print $0;
     } else {
         # otherwise we scan the line for quote characters
+        writebuf = "";
         numchars = length($0);
         for (i=1;i<=numchars;i++) {
-            replace_special_chars(substr($0,i,1));
+            writebuf = writebuf (replace_special_chars(substr($0,i,1)));
         }
+        writebuf = writebuf (replace_special_chars(RS));
         printf("%s", writebuf);
-        writebuf = "";
-        replace_special_chars(RS);
     }
 }

@@ -82,7 +77,3 @@
     sub(/\034/, recordsep, writebuf); # Beware ! recordsepcode repeated
     print writebuf;
 }
-
-END {
-    printf("%s", writebuf); #flush
-}


List all the IP address and calculate how many sites it accessed

--- HASH/ip-example.awk
+++ HASH/ip-example.awk
@@ -1,5 +1,17 @@
-awk '{Ip[$3]++;}
-END
-{ for (var in Ip)
-  print var, "access", Ip[var]," times"
+#!/usr/bin/awk -f
+
+#awk '{Ip[$3]++;} END { for (var in Ip) print var, "access", Ip[var]," times"}
+
+#awk '{ip_count[$0]++}; END {for (ip in ip_count) printf "%15s: %d\n",ip,ip_count[ip];}'
+
+BEGIN {
+print "IP Address\tAccess Count\tNumber of sites";
 }
+{
+Ip[$3]++;
+count[$3]+=$NF;
+}
+END{
+for (var in Ip)
+	print var,"\t",Ip[var],"\t\t",count[var];
+}


I changed my mind about some of the previous style changes and changed some more

--- d.awk
+++ d.awk
@@ -524,10 +524,10 @@
                 r = r "<" tg a ">";
             } else if(match(tg, "^[[:alpha:]]+://[[:graph:]]+$")) {
                 if(!a) a = tg;
-                r = r "" a "";
+                r = r "" a "";
             } else if(match(tg, "^[[:graph:]]+@[[:graph:]]+$")) {
                 if(!a) a = tg;
-                r = r "" obfuscate(a) "";
+                r = r "" obfuscate(a) "";
             } else {
                 r = r "<";
                 continue;
@@ -562,7 +562,7 @@
     # LinkUrls[href] = "#" href;

     svg = "<svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\"><g transform=\"rotate(-30, 8, 8)\" stroke=\"#000000\" opacity=\"0.25\"><rect fill=\"none\" height=\"6\" width=\"8\" x=\"2\" y=\"6\" rx=\"1.5\"/><rect fill=\"none\" height=\"6\" width=\"8\" x=\"6\" y=\"4\" rx=\"1.5\"/></g></svg>";
-    text = "" svg " " st "" (TopLinks?"  ↑ Top":"");
+    text = "" st " " svg "" (TopLinks?"  ↑ Top":"");

     res = tag("h" level, text, "id=\"" href "\"");
     for(;ToCLevel < level; ToCLevel++) {
@@ -577,7 +577,7 @@
     }
     for(;ToCLevel > level; ToCLevel--)
         ToC = ToC "
";
-    ToC = ToC "
" st "\n";
+    ToC = ToC "
" st "\n";
     ToCLevel = level;
     return res;
 }
@@ -644,7 +644,7 @@
             if(img)
                 res = res "";
             else
-                res = res "" lt "";
+                res = res "" lt "";
         } else if(match(st, /^[[:space:]]*\[[^\]]*\]/)) {
             lt = substr(rx, 2, length(rx) - 2);
             match(st, /\[[^\]]*\]/);
@@ -659,7 +659,7 @@
             if(img)
                 res = res "";
             else if(url)
-                res = res "" lt "";
+                res = res "" lt "";
             else
                 res = res "[" lt "][" lr "]";
         } else
@@ -746,24 +746,28 @@

     css["body"] = "color:%color1%;font-family:%font-family%;font-size:%font-size%;line-height:1.5em;" \
                 "padding:1em 2em;width:80%;max-width:%maxwidth%;margin:0 auto;min-height:100%;float:none;";
-    css["h1"] = "color:%color1%;border-bottom:1px solid %color1%;padding:0.3em 0.1em;";
+    css["h1"] = "border-bottom:1px solid %color1%;padding:0.3em 0.1em;";
+    css["h1 a"] = "color:%color1%;";
     css["h2"] = "color:%color2%;border-bottom:1px solid %color2%;padding:0.2em 0.1em;";
+    css["h2 a"] = "color:%color2%;";
     css["h3"] = "color:%color3%;border-bottom:1px solid %color3%;padding:0.1em 0.1em;";
-    css["h4,h5,h6"] = "color:%color4%;padding:0.1em 0.1em;";
-    css["h1,h2,h3,h4,h5,h6"] = "font-weight:normal;line-height:1.2em;";
+    css["h3 a"] = "color:%color3%;";
+    css["h4,h5,h6"] = "padding:0.1em 0.1em;";
+    css["h4 a,h5 a,h6 a"] = "color:%color4%;";
+    css["h1,h2,h3,h4,h5,h6"] = "font-weight:bolder;line-height:1.2em;";
     css["h4"] = "border-bottom:1px solid %color4%";
     css["p"] = "margin:0.5em 0.1em;"
     css["hr"] = "background:%color1%;height:1px;border:0;"
-    css["a"] = "color:%color2%;";
-    css["a:visited"] = "color:%color2%;";
-    css["a:active"] = "color:%color4%;";
-    css["a:hover"] = "color:%color4%;";
+    css["a.normal, a.toc"] = "color:%color2%;";
+    #css["a.normal:visited"] = "color:%color2%;";
+    #css["a.normal:active"] = "color:%color4%;";
+    css["a.normal:hover, a.toc:hover"] = "color:%color4%;";
     css["a.top"] = "font-size:x-small;text-decoration:initial;float:right;";
     css["a.header svg"] = "opacity:0;";
     css["a.header:hover svg"] = "opacity:1;";
     css["a.header"] = "text-decoration: none;";
     css["strong,b"] = "color:%color1%";
-    css["code"] = "color:%color2%;";
+    css["code"] = "color:%color2%;font-weight:bold;";
     css["blockquote"] = "margin-left:1em;color:%color2%;border-left:0.2em solid %color3%;padding:0.25em 0.5em;overflow-x:auto;";
     css["pre"] = "color:%color2%;background:%color5%;border:1px solid;border-radius:2px;line-height:1.25em;margin:0.25em 0.5em;padding:0.75em;overflow-x:auto;";
     css["table"] = "border-collapse:collapse;margin:0.5em;";
@@ -790,7 +794,8 @@
 	css["ul.toc"] = "list-style-type:none;";

     # Colors:
-    c1="#314070";c2="#465DA6";c3="#6676A8";c4="#A88C3F";c5="#E8E4D9";
+    #c1="#314070";c2="#465DA6";c3="#6676A8";c4="#A88C3F";c5="#E8E4D9";
+    c1="#314070";c2="#384877";c3="#6676A8";c4="#738FD0";c5="#FBFCFF";
     # Font Family:
     ff = "sans-serif";
     fs = "11pt";


Update the list of config parameters that point to /tmp on unix.

--- src/condor_examples/convert_config_to_win32.awk
+++ src/condor_examples/convert_config_to_win32.awk
@@ -93,7 +93,7 @@

 # There's no reasonable default place to put log files for
 # daemons that run as a user (on Unix we use /tmp). Use NUL.
-/(^GRIDMANAGER_LOG)|(^C_GAHP_LOG)|(^C_GAHP_WORKER_THREAD_LOG)|(^VM_GAHP_LOG)/ {
+/(^C_GAHP_LOG)|(^C_GAHP_LOCK)|(^C_GAHP_WORKER_THREAD_LOG)|(^C_GAHP_WORKER_THREAD_LOCK)|(^VM_GAHP_LOG)/ {
 	printf "%s = NUL\n", $1
 	next
 }


stringify KBUILD_MODNAME

stringify KBUILD_MODNAME

--- scripts/modpost.awk
+++ scripts/modpost.awk
@@ -1732,7 +1732,7 @@
 #define KBUILD_MODNAME " base "\n\
 \n\
 #ifdef KBUILD_MODNAME\n\
-MODULE_INFO(name, KBUILD_MODNAME);\n\
+MODULE_INFO(name, __stringify(KBUILD_MODNAME));\n\
 struct module __this_module\n\
 __attribute__((section(\".gnu.linkonce.this_module\"))) = {\n\
 	.name = __stringify(KBUILD_MODNAME),\


ctx: fetch `wpa_cli status` into ctx.wifi.*

--- src/ctx.awk
+++ src/ctx.awk
@@ -56,4 +56,10 @@
     setCtx("wdir", ENVIRON["PWD"])
     if(get("ctx.file.dirname"))
 	setCtx("wdir", get("ctx.file.dirname"))
+
+    # current wifi
+    split(btick("wpa_cli status"), m, "\n")
+    for(i = 1; i <= length(m); ++i)
+	if(match(m[i], /^([^=]*)=(.*)$/, a))
+	    setCtx("wifi_" a[1], a[2])
 }


BUG#15734: Fix undefined awk behaviour breaking compilation on Debian.

--- bdb/dist/gen_rec.awk
+++ bdb/dist/gen_rec.awk
@@ -180,7 +180,7 @@
 		t = types[i];
 		if (modes[i] == "POINTER") {
 			ndx = index(t, "*");
-			t = substr(types[i], 0, ndx - 2);
+			t = substr(types[i], 1, ndx - 2);
 		}
 		printf("\t%s\t%s;\n", t, vars[i]) >> HFILE
 	}


Clean up series mismatch messages in Acorn

--- getAcornFrom-seriesPages.awk
+++ getAcornFrom-seriesPages.awk
@@ -247,15 +247,15 @@
         /\/jamaicainn\/bonus\/|\/jamaicainn\/trailer\/|\/newworlds\/bonus\/|\/newtonslaw\/bonus\// \
         && seasonNumber != 1) {
         split (episodeURL, part, "/")
-        printf ("==> Corrected mismatch: https://acorn.tv/%s/%s was series %d\n", \
-               part[4], part[5], seasonNumber) >> ERROR_FILE
+        printf ("==> Corrected S%02d: https://acorn.tv/%s/%s to S01\n", \
+               seasonNumber, part[4], part[5]) >> ERROR_FILE
         seasonNumber = 1
     }
     # Plain christmasspecial, seriesfinale don't increment seasonNumber
     if (episodeURL ~ /\/christmasspecial\/|\/seriesfinale\//) {
         split (episodeURL, part, "/")
-        printf ("==> Corrected mismatch: https://acorn.tv/%s/%s was series %d\n", \
-               part[4], part[5], seasonNumber) >> ERROR_FILE
+        printf ("==> Corrected S%02d: https://acorn.tv/%s/%s to S%02d\n", \
+               seasonNumber, part[4], part[5], seasonNumber-1) >> ERROR_FILE
         seasonNumber -= 1
     }
     #
@@ -281,8 +281,8 @@
         sub (/christmasspecial/,"",URLseasonNumber)
         sub (/[[:alpha:]]*/,"",URLseasonNumber)
         if (URLseasonNumber != seasonNumber) {
-            printf ("==> Corrected mismatch: https://acorn.tv/%s/%s was series %d\n", \
-               part[4], part[5], seasonNumber) >> ERROR_FILE
+            printf ("==> Corrected S%02d: https://acorn.tv/%s/%s to S%02d\n", \
+               seasonNumber, part[4], part[5], URLseasonNumber) >> ERROR_FILE
             seasonNumber = URLseasonNumber
         }
     }


Fix MHz site's change to page=2 link

Fix MHz site's change to page=2 link

--- getMHzFrom-seriesPages.awk
+++ getMHzFrom-seriesPages.awk
@@ -26,8 +26,8 @@
 # ---
 #       Show More
+#       class="js-load-more-link btn btn-site-secondary btn-nowrap"
+#       href="/detective-montalbano?html=1&page=2">
 #
 # OUTPUT:
 #       $MARQUEE_FILE, $DESCRIPTION_FILE, $HEADER_FILE,
@@ -120,7 +120,11 @@
 }

 # If there is more to load ...
+#       href="/detective-montalbano?html=1&page=2">
 /class="js-load-more-link/ {
+    if (getline <= 0) {
+        print "==> Missing page=2 link: " shortURL "  " seriesTitle >> ERROR_FILE
+    }
     sub (/.*href="/,"https://watch.mhzchoice.com")
     sub (/">.*/,"")
     print $0 >> EPISODE_URL_FILE


Remove translations from SIP server config (will move to sip2proxy)

--- files/templates/instance/SIPconfig.template_account.awk
+++ files/templates/instance/SIPconfig.template_account.awk
@@ -3,37 +3,5 @@
 }
 {
 	print "\t<login encoding=\""$1"\" id=\""$2"\" password=\""$3"\" delimiter=\"|\" error-detect=\"enabled\" institution=\""$4"\" checked_in_ok=\"1\">"
-	print "\t\t<!-- General messages -->"
-	print "\t\t<screen_msg_regex find=\"^.*Invalid password.*$\" replace=\"Feil passord\" />"
-	print "\t\t<!-- Checkout screen messages we can translate directly -->"
-	print "\t\t<screen_msg_regex find=\"Item checked out to another patron.*$\" replace=\"Materialet er lånt ut til en annen låner.\" />"
-	print "\t\t<screen_msg_regex find=\"Item already checked out to you: renewing item.\" replace=\"Denne fornyes siden du allerede har lånt den.\" />"
-	print "\t\t<screen_msg_regex find=\"Item was reserved for you.\" replace=\"Du hadde reservert denne.\" />"
-	print "\t\t<screen_msg_regex find=\"Item is reserved for another patron upon return.\" replace=\"Materialet er reservert av en annen låner.\" />"
-	print "\t\t<screen_msg_regex find=\"Item already checked out to another patron.  Please return item for check-in.\" replace=\"Materialet er allerede lånt ut til en annen låner. Vennligst returner det.\" />"
-	print "\t\t<screen_msg_regex find=\"Outstanding Fines block issue.*\" replace=\"Du kan ikke låne grunnet utestående gebyrer.\" />"
-	print "\t\t<screen_msg_regex find=\"Loan period reduced for high-demand item\" replace=\"Låneperioden er redusert pga stor etterspørsel\" />"
-	print "\t\t<screen_msg_regex find=\"Item is on hold shelf for another patron\" replace=\"Materialet står til avhenting av en annen låner\" />"
-	print "\t\t<screen_msg_regex find=\"Invalid Item\" replace=\"Ugyldig eksemplar\" />"
-	print "\t\t<screen_msg_regex find=\"Invalid Patron\" replace=\"Ugyldig lånekort\" />"
-	print "\t\t<screen_msg_regex find=\"Invalid cardnumber\" replace=\"Ugyldig lånekort\" />"
-	print "\t\t<screen_msg_regex find=\"^.*Borrower.s card reported lost.*$\" replace=\"Lånekortet er meldt tapt. Vennligst kontakt personalet.\" />"
-	print "\t\t<screen_msg_regex find=\"^.*Borrower has no valid address.*$\" replace=\"Feil i adresse. Vennligst kontakt personalet.\" />"
-	print "\t\t<!-- Renew -->"
-	print "\t\t<screen_msg_regex find=\"Item unavailable due to outstanding holds\" replace=\"Materialet er utilgjengelig pga ventende reservasjoner\" />"
-	print "\t\t<screen_msg_regex find=\"Item has reached maximum renewals\" replace=\"Materialet kan ikke lånes flere ganger\" />"
-	print "\t\t<screen_msg_regex find=\"NO_MORE_RENEWALS[\\:]*\" replace=\"Maks antall fornyelser oversteget.\" />"
-	print "\t\t<!-- Missing screen messages in Koha and other quirks -->"
-	print "\t\t<screen_msg_regex find=\"^.*Patron owes.+$\" replace=\"Du har utestående gebyrer - henvend deg til personalet.\" />"
-	print "\t\t<screen_msg_regex find=\"^Patron Blocked$\" replace=\"Lånekortet er sperret - henvend deg til personalet.\" />"
-	print "\t\t<screen_msg_regex find=\"Aldersgrense\" replace=\"Du kan ikke låne denne - aldersgrense\" />"
-	print "\t\t<screen_msg_regex find=\"TOO_MANY_CHECKOUTS\" replace=\"For mange utlån\" />"
-	print "\t\t<screen_msg_regex find=\"NOT_FOR_LOAN.*$\" replace=\"Materialet er ikke til utlån.\" />"
-	print "\t\t<screen_msg_regex find=\"item_notforloan.*$\" replace=\"Materialet er ikke til utlån.\" />"
-	print "\t\t<!-- Bug 15438 - Checking out an on-hold item sends holder's borrowernumber in AF (screen message) field. -->"
-	print "\t\t<!-- gjelder også utlån av samme eksemplar to ganger -->"
-	print "\t\t<screen_msg_regex find=\"^\d{1,}$\" replace=\"Materialet er allerede utlånt/reservert.\" />"
-	print "\t\t<!-- Last resort -->"
-	print "\t\t<screen_msg_regex find=\"Greetings from Koha.\" replace=\"Melding fra biblioteket:\" />"
 	print "\t</login>"
 }


Fixed formatting again.

Fixed formatting again.

--- scripts/misc/one-vs-rest.awk
+++ scripts/misc/one-vs-rest.awk
@@ -3,7 +3,7 @@
 	possible_labels=$1;
 	rowid=$2;
 	label=$3;
-    features=$4;
+	features=$4;

 	label_count = split(possible_labels, label_array, ",");


fixed space detection

fixed space detection

--- get_ver.awk
+++ get_ver.awk
@@ -1,7 +1,7 @@
 # fetch libssh2 version number from input file and write them to STDOUT
 BEGIN {
   while ((getline < ARGV[1]) > 0) {
-    if (match ($0, /^#define LIBSSH2_VERSION[\s|\t]+"[^"]+"/)) {
+    if (match ($0, /^#define LIBSSH2_VERSION[ |\t]+"[^"]+"/)) {
       my_ver_str = substr($3, 2, length($3) - 2);
       split(my_ver_str, v, ".");
       if (v[3])


fix comments in the git log massager to explain what format it processes

--- src/log-massage.awk
+++ src/log-massage.awk
@@ -1,34 +1,9 @@
 #!/bin/awk
-# commit 989fb6102add218589e8779c76fd61f91e113684
-# Author: Tad Hunt <tadhunt@tad-hunts-macbook-pro.local>
-# Date:   2009-11-30
-#
-#     ignore objects
-#
-# 4       0       .gitignore
-#
-# commit 54f97a5baf887f0d2a73745efaa0a647ed20512e
-# Author: Tad Hunt <tadhunt@tad-hunts-macbook-pro.local>
-# Date:   2009-11-30
-#
-#     reorg & add pitch
-#
-# 0       46      Makefile
-# 0       62      bwcalc.c
-# 0       32      dedupgain.sh
-# 0       56      dedupgaintree.sh
-# 0       391     sha1block.c
-# 0       73      sha1speed.c
-# 46      0       src/Makefile
-# 62      0       src/bwcalc.c
-# 32      0       src/dedupgain.sh
-# 56      0       src/dedupgaintree.sh
-# 391     0       src/sha1block.c
-# 73      0       src/sha1speed.c
-#
-# commit 509aff7e53df7406749274d943ed573a0a78af02
-# ...
-#
+#
+# This script parses the git log output from the following git command, and turns it into csv
+#
+#	git log --reverse --numstat --date=short
+#
 BEGIN {
 	stderr = "/dev/stderr"

@@ -37,7 +12,6 @@
 #		"Number of Insertions",
 #		"Number of Deletions",
 #		"Author",
-#		"Date",
 #		"Filename")

 	last = "none"


add call of close() in sleep()

add call of close() in sleep()

--- lib_util.awk
+++ lib_util.awk
@@ -47,7 +47,7 @@
 function rep(str, num,     res) { while (num--) res = res str; return res }

 # sleep
-function sleep(sec,    dummy) { "sleep " sec | getline dummy }
+function sleep(sec,    dummy) { "sleep " sec | getline dummy ; close("sleep " sec) }

 # length of multi bytes character string
 #function wlength(str) { gsub(/./, "a", str); return blength(str) }


remove groff -D option (fix #40)

remove groff -D option (fix #40)

--- include/Main.awk
+++ include/Main.awk
@@ -93,7 +93,7 @@
         if (RSTART) {
             if (ENVIRON["TRANS_MANPAGE"])
                 system("echo -E \"${TRANS_MANPAGE}\" | " \
-                       "groff -Wall -mtty-char -mandoc -Tutf8 -Dutf8 -rLL=${COLUMNS}n -rLT=${COLUMNS}n | " \
+                       "groff -Wall -mtty-char -mandoc -Tutf8 -rLL=${COLUMNS}n -rLT=${COLUMNS}n | " \
                        (system("most 2>/dev/null") ?
                         "less -s -P\"\\ \\Manual page " Command "(1) line %lt (press h for help or q to quit)\"" :
                         "most -Cs"))


Fixed comments at beginning of program

Fixed comments at beginning of program

--- segTable/generate_all.awk
+++ segTable/generate_all.awk
@@ -4,7 +4,10 @@
 # - input two seperate data files and output transliterated characters
 #
 # file1 format is "hexnum chars" where hexnum = hex entry index, char = "on" led segmemts
-# file2 consists a stream of "abcdefgh" char lists
+# file2 consists a index and a text string
+# file3 is a template file for the output of the text strings after translation
+#  into an LED segment pattern.
+#  This output is then included in the source stream for complilation
 #
 # file1 converts raw led segment letters to a translated hex number
 # which is stored in an array with the characters hex number being the index
@@ -16,14 +19,42 @@
 #   ... repeats for 127 chars total
 #
 # file2:
-#   CL
-#   AL
-#   BEEP
-#
-# output:
-#   CL      0x31,0x4A   // CL
-#   AL      0x37,0x48   // AL
-#   BEEP    0x6A,0x88,0x9F,0x4C // BEEP
+#
+#    <41>  SEt,_
+#    <42>  bEE,P
+#
+# Where <41> is the pattern used for matching in the output template file.
+#
+# file3:
+#
+#  #if DIGIT_3_FLIP
+#      <4F1>
+#      <4F2>
+#
+# This template has <4F1> replaced with the hex code for string <41> with the character rotated
+# (flipped) 180 degrees. In other locations, you will see the index markers:
+#
+#  #else
+#      <4N1>
+#      <4N2>
+#
+# Where the "N" character in the marker means do not flip or rotate the character pattern
+# This is only needed in the third digit position due to lazy hardware engineers.
+#
+# The output from this GAW program thus becomes:
+#
+#  #if DIGIT_3_FLIP
+#      0x92,0x86,0xB8,0xFF,       // SEt_
+#      0x83,0x86,0xB0,0x8C,       // bEEP
+#
+# and lower in the listing:
+#
+#  #else
+#      0x92,0x86,0x87,0xFF,       // SEt
+#      0x83,0x86,0x86,0x8C,       // bEEP
+#
+# Note the difference in the value of the third hex number, this is
+# the "flipped" LED segment pattern
 #
 BEGIN {


cellify tweaks

cellify tweaks

--- bin/util/cell-ify-eparams.awk
+++ bin/util/cell-ify-eparams.awk
@@ -131,12 +131,15 @@
    }

    if( $1 == "ov:csvHeader" ) {
-      current_header=$2;
+      current_header=$2; # Old approach missed header after first space.
+      current_header=$0; gsub(/^[^"]*"/,"",current_header);
+                         gsub(/".*$/,   "",current_header);
       gsub(/"/,"",current_header);
       gsub(/;/,"",current_header);
       print annotate("         a scovo:Item;",PADDING,"");
+      print annotate("         a qb:Observation;",PADDING,"");
    }
-   if( length(label_up) > 0 && $1 == "conversion:label" ) {
+   if( length(label_up) > 0 && ( $1 == "conversion:label" || $1 == "#conversion:label" ) ) {
       datatype = length(up_range) > 0 ? "^^"up_range : "";
       if( up_object == ":" ) {
          print annotate("         conversion:object :"current_header";",PADDING,"");


INTEGRATION: CWS localedata5 (1.4.36); FILE MERGED 2005/05/31 16:53:15 er 1.4.36.1: [NatNum#] is not a currency

--- i18npool/source/localedata/data/currency-check.awk
+++ i18npool/source/localedata/data/currency-check.awk
@@ -83,7 +83,7 @@
         split( arr[3], code, /(\[\$)|(-[0-9a-fA-F]+\])/ )
         for ( j in code )
         {
-            if ( code[j] && code[j] !~ /\#|0/ )
+            if ( code[j] && code[j] !~ /\#|0|\[NatNum/ )
             {
                 FormatLine[nFormats] = file " line " line
                 FormatAuto[nFormats] = bFormatAuto


comments

comments

--- scripts/generate-URI_label.awk
+++ scripts/generate-URI_label.awk
@@ -1,20 +1,21 @@
 #! /usr/bin/awk -f
-# generate-URI_label.awk
+# ${DIPPER}/scripts/generate-URI_label.awk \
 # ${DIPPER}/dipper/curie_map.yaml ${DIPPER}/translationtable/GLOBAL_TERMS.yaml

 # Reconstitutes the label an URI has based on Dipper's mapping files.
+# note: this relies on uninforced yaml quoting disipline

-# curie_map.yaml    'pfx': 'buri'
+# in: curie_map.yaml    'pfx': 'buri'
 NR == FNR && !/^#/{
 	FS="'"
 	a[$2]=$4
 }

-# GLOBAL_TERMS.yaml  "label": "curie",
+# in: GLOBAL_TERMS.yaml  "label": "curie",
 NR != FNR && !/^#/{
 	FS="\""
 	split($4, t,":");
 	if(t[1] in a)
 		print a[t[1]] t[2] "\t" $2
 }
-
+# out: URI label


Remove extraneous \

Remove extraneous \

--- getBBoxCatalogFromSitemap.awk
+++ getBBoxCatalogFromSitemap.awk
@@ -260,11 +260,11 @@
     if (title == "A Midsummer Night's Dream") {
         if (EntityId == "_26179") {
             revisedTitles += 1
-            printf ("==> Changed title '%s' to 'A Midsummer Night\'s Dream (1981)'\n", title) >> ERRORS
+            printf ("==> Changed title '%s' to 'A Midsummer Night's Dream (1981)'\n", title) >> ERRORS
             title = "A Midsummer Night's Dream (1981)"
         } else if (EntityId == "_15999") {
             revisedTitles += 1
-            printf ("==> Changed title '%s' to 'A Midsummer Night\'s Dream (2016)'\n", title) >> ERRORS
+            printf ("==> Changed title '%s' to 'A Midsummer Night's Dream (2016)'\n", title) >> ERRORS
             title = "A Midsummer Night's Dream (2016)"
         }
         # print "==> title = " title > "/dev/stderr"


Don't pass /& to csv files

Don't pass /& to csv files

--- getBritBoxFrom-scrapy_xml.awk
+++ getBritBoxFrom-scrapy_xml.awk
@@ -8,6 +8,7 @@
     sub (/<\/item>$/,"")
     gsub (/<value>/,"")
     gsub (/<\/value>/,"")
+    gsub (/&/,"\\&")
 }

 # if needed for debugging record placment, replace "/nosuchrecord/" below


Filter out current year

Filter out current year

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@24401 4f837ed2-42f5-46e7-a7a5-fa17313484d4

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

 {
   # add a loop to add line only if ending year is gt or eq to contract year
+  current_year = 2013
   end_year = 0
   incontract = 0
   test_year = ""
@@ -21,7 +22,9 @@
   }
   #printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $1,$2,$3,$4,$7,end_year,test_year
   if (end_year >= test_year) {
-    incontract = 1
+    if ((end_year < current_year) || ((end_year >= current_year) && (incl_cur == 1))) {
+      incontract = 1
+    }
   }

   if (incontract == 1) {


bump version to 0.9.1-dev

bump version to 0.9.1-dev

--- metainfo.awk
+++ metainfo.awk
@@ -1,7 +1,7 @@
 BEGIN {
     Name        = "Translate Shell"
     Description = "Google Translate to serve as a command-line tool"
-    Version     = "0.9.0.7"
+    Version     = "0.9.1-dev"
     ReleaseDate = "2015-06-08"
     Command     = "trans"
     EntryPoint  = "translate.awk"


Fixes for untime

Fixes for untime

Skip RIL files, and a sp fix I missed

--- diff_tools/untime.awk
+++ diff_tools/untime.awk
@@ -1,9 +1,9 @@
 # remove time stamp
 /^--- stock_/  { print $1 " " $2; next; }
-/^+++ moded_/ { print $1 " " $2; next; }
+/^+++ modded_/ { print $1 " " $2; next; }

 # convert obsolete form
-/^diff -Npru /  { sub(/diff -Npru /, "diff -NpruEbB "); }
+/^diff -Npru /  { sub(/diff -Npru /, "diff -NpruEbB -x '*RIL'"); }
 /stock-/  { sub(/stock-/, "stock_"); sub(/modded-/, "modded_"); print; next; }

 # keep rest of file as is:


Use float for calculating fractional part of STARTTIME to support busybox awk.
Also print used start time is various representations.

Compared to gawk, busybox awk does only support 32 bit integers.

--- recipes-core/systemd/systemd-units/candump.awk
+++ recipes-core/systemd/systemd-units/candump.awk
@@ -3,8 +3,11 @@
     {
         startTimestamp = substr($1, 2, length($1) - 2)
         printf(";$FILEVERSION=1.3\n")
-        printf(";$STARTTIME=%u.%u\n", mktime(strftime("%Y %m %d 0 0 0", startTimestamp)) / 86400 + 25569, \
-                10000000000 / 86400 * (mktime(strftime("%Y %m %d %H %M %S", startTimestamp)) - mktime(strftime("%Y %m %d 0 0 0", startTimestamp))))
+        printf(";$STARTTIME=%u.%.0f\n", mktime(strftime("%Y %m %d 0 0 0", startTimestamp)) / 86400 + 25569, \
+                10000000000.0 / 86400.0 * (mktime(strftime("%Y %m %d %H %M %S", startTimestamp)) - mktime(strftime("%Y %m %d 0 0 0", startTimestamp))))
+        printf(";\n; Start time: %s\n", startTimestamp)
+        printf(";             %u\n", mktime(strftime("%Y %m %d %H %M %S", startTimestamp)))
+        printf(";             %s\n;\n", strftime("%Y-%m-%dT%H:%M:%S%z (%Z)", startTimestamp))
         currentTimeOffset = 0.0
     }
     else


make this extensible and do not omit inherited without patterns

Change-Id: I97a554169637740aab4282b303a32f476f294e2f

--- i18npool/source/localedata/data/list-dateacceptancepattern.awk
+++ i18npool/source/localedata/data/list-dateacceptancepattern.awk
@@ -23,7 +23,9 @@
         --ARGC
     }
     file = ""
-    nopatterns = 0
+    offlocale = 0
+    offpatterns = 1
+    offinherit = 2
     inheritedcount = 0
     if (html)
         print "
"
@@ -58,6 +60,11 @@
 END {
     if (file)
         endFile()
+
+    PROCINFO["sorted_in"] = "@ind_str_asc"
+
+    fillAllInherited()
+
     if (html)
     {
         print "
"
@@ -70,19 +77,19 @@
     if (html)
     {
         print "
"
-        for (i=0; i<inheritedcount; ++i)
+        for (i in LocaleList)
         {
-            if (LocaleHasPatterns[InheritedList[i][1]])
-                print InheritedList[i][0] " = " InheritedList[i][1] "    "
+            if (LocaleList[i][offinherit] && LocaleList[i][offpatterns])
+                print LocaleList[i][offlocale] " = " LocaleList[i][offinherit] "    "
         }
         print "\n
"
     }
     else
     {
-        for (i=0; i<inheritedcount; ++i)
+        for (i in LocaleList)
         {
-            if (LocaleHasPatterns[InheritedList[i][1]])
-                print InheritedList[i][0] " = " InheritedList[i][1]
+            if (LocaleList[i][offinherit] && LocaleList[i][offpatterns])
+                print LocaleList[i][offlocale] " = " LocaleList[i][offinherit]
         }
         print "\n"
     }
@@ -95,16 +102,18 @@
         print "
"
     if (html)
     {
-        for (i=0; i<nopatterns; ++i)
+        for (i in LocaleList)
         {
-            print NoPatternList[i] "    "
+            if (!LocaleList[i][offpatterns])
+                print LocaleList[i][offlocale] "    "
         }
     }
     else
     {
-        for (i=0; i<nopatterns; ++i)
+        for (i in LocaleList)
         {
-            print NoPatternList[i]
+            if (!LocaleList[i][offpatterns])
+                print LocaleList[i][offlocale]
         }
     }
 }
@@ -112,7 +121,8 @@

 function endFile() {
     locale =  getLocale( file)
-    LocaleHasPatterns[locale] = patterns
+    LocaleList[locale][offlocale] = locale
+    LocaleList[locale][offpatterns] = patterns
     if (patterns)
     {
         if (html)
@@ -135,21 +145,31 @@
         }
     }
     else if (inherited)
-    {
-        InheritedList[inheritedcount][0] = locale
-        InheritedList[inheritedcount][1] = inherited
-        ++inheritedcount
-    }
-    else
-        NoPatternList[nopatterns++] = locale
+        LocaleList[locale][offinherit] = inherited
 }

-function getLocale( file, tmp ) {
+function getLocale( file,       tmp ) {
     tmp = file
     gsub( /.*\//, "", tmp )
     gsub( /\.xml/, "", tmp )
     return tmp
 }

+
+function fillInherited( locale ) {
+    if (!LocaleList[locale][offpatterns] && LocaleList[locale][offinherit])
+        LocaleList[locale][offpatterns] = fillInherited( LocaleList[locale][offinherit])
+    return LocaleList[locale][offpatterns]
+}
+
+
+function fillAllInherited(      i ) {
+    for (i in LocaleList)
+    {
+        if (!LocaleList[i][offpatterns] && LocaleList[i][offinherit])
+            LocaleList[i][offpatterns] = fillInherited( LocaleList[i][offinherit])
+    }
+}
+
 # vim:set shiftwidth=4 softtabstop=4 expandtab:


bump version to 0.9.1-dev

bump version to 0.9.1-dev

--- metainfo.awk
+++ metainfo.awk
@@ -1,7 +1,7 @@
 BEGIN {
     Name        = "Translate Shell"
     Description = "Google Translate to serve as a command-line tool"
-    Version     = "0.9.0.8"
+    Version     = "0.9.1-dev"
     ReleaseDate = "2015-09-01"
     Command     = "trans"
     EntryPoint  = "translate.awk"


Callouts in docs are now processed language-specific. Python uses '#' to comment them out, all other languages will currently fall back to '//'.

--- docs/preprocessor/awk/prepare.awk
+++ docs/preprocessor/awk/prepare.awk
@@ -20,6 +20,7 @@
 #
 BEGIN {
   p = 0
+  c = "//"
 }

 function escape_string(string) {
@@ -32,7 +33,7 @@
 }

 function transform_callouts(code) {
-  return gensub(/\s*((<[0-9]+>\s*)*<[0-9]+>)\s*$/, " //// \\1", "g", code)
+  return gensub(/\s*((<[0-9]+>\s*)*<[0-9]+>)\s*$/, " " c c " \\1", "g", code)
 }

 function remove_callouts(code) {
@@ -66,6 +67,18 @@

 /^\[gremlin-/ {
   inCodeSection = 1
+  split($0, a, "-")
+  b = gensub(/]'/, "", "g", a[2])
+  split(b, l, ",")
+  lang = l[1]
+  switch (lang) {
+    case "python":
+      c = "#"
+      break
+    default:
+      c = "//"
+      break
+  }
 }

 END {


documented CSV2RDF4LOD_CONVERT_PERSON_URI and MACHINE and changed output if missing headers2params2.awk

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -71,11 +71,17 @@
    printf("@prefix :           <%s/source/%s/dataset/%s/version/%s/conversion/%s> .\n",surrogate,sourceID,datasetID,datasetVersion,STEP);

                                      print
-   if(length(person_uri)&&length(machine_uri)&&length(whoami)) {
+   if( length(machine_uri) && length(whoami) ) {
+      if(length(person_uri)) {
                                     printf("<%s> foaf:holdsAccount <%s%s> .\n",person_uri,machine_uri,whoami);
-                                    printf("<%s%s>\n   a foaf:OnlineAccount;\n   foaf:accountName \"%s\";\n   sioc:account_of <%s>;\n.\n",machine_uri,whoami,whoami,person_uri);
+      }
+                                    printf("<%s%s>\n   a foaf:OnlineAccount;\n   foaf:accountName \"%s\";\n",machine_uri,whoami,whoami);
+      if(length(person_uri)) {
+                                    printf("   sioc:account_of <%s>;\n",machine_uri);
+      }
+                                    printf(".\n");
    }else if(length(person_uri)&&length(whoami)) {
-                                    printf("<%s> dcterms:identifier <%s> .\n",person_uri,whoami);
+                                    printf("<%s> dcterms:identifier \"%s\" .\n",person_uri,whoami);
    }
                                      print
                                      print ":dataset a void:Dataset;"
@@ -92,10 +98,13 @@
                                      print
    if(length(person_uri)&&length(machine_uri)&&length(whoami)) {
                                     printf("      dcterms:creator <%s%s>;\n",machine_uri,whoami);
-   }else if(length(person_uri)) {
-                                    printf("      dcterms:creator \"%s\";\n",person_uri);
+   }else if(length(machine_uri) && length(whoami)) {
+                                    printf("      dcterms:creator <%s%s>;\n",machine_uri,whoami); # TODO: same as above.
+   }else if(length(person_uri)  && length(whoami)) {
+                                    printf("      dcterms:creator [ a foaf:OnlineAccount; foaf:accountName \"%s\";\n",whoami);
+                                    printf("                        sioc:account_of <%s> ];\n",person_uri);
    }else if(length(whoami)) {
-                                    printf("      dcterms:creator \"%s\";\n",whoami);
+                                    printf("      dcterms:creator [ a foaf:OnlineAccount; foaf:accountName \"%s\" ];\n",whoami);
    }
    if(length(nowXSD)) {
                                     printf("      dcterms:created \"%s\"^^xsd:dateTime;\n",nowXSD);


fixes comment

fixes comment

--- omfgene.awk
+++ omfgene.awk
@@ -14,7 +14,7 @@
 }

 # Parse SAM
-# If primary alignment AND mate mapped AND (mate is on different chr OR mate is more than 500k away)
+# If mate mapped AND (mate is on different chr OR mate is more than 500k away)
 # print alignments rounded to nearest 100
 # Format: mate 1 chrom TAB mate 1 rounded coordinate TAB mate 2 chrom TAB mate 2 rounded coordinate TAB 1 if secondary else 0
 $7 != "*" && ($7 != "=" && $7 != $3 || (abs($4-$8) > 500000)) {


Typo.

Typo.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@7046 4f837ed2-42f5-46e7-a7a5-fa17313484d4

--- test/scripts/tdb.awk
+++ test/scripts/tdb.awk
@@ -271,7 +271,7 @@
   _pub = xml(getValue($3))
   printf  " <property name=\"org.lockss.titleSet\">\n"
   printf  "\n"
-  printf  "  <property name=\"%s\">\n", _pub)
+  printf  "  <property name=\"%s\">\n", _pub
   printOneXmlProperty("name=All " _pub " Titles")
   printOneXmlProperty("class=xpath")
   printOneXmlProperty("xpath=[attributes/publisher='" _pub "']")


Languages: getCode(): remove unidentified region or script code

--- include/Languages.awk
+++ include/Languages.awk
@@ -1785,15 +1785,20 @@
 }

 # Get locale key by language code or alias.
-function getCode(code) {
+function getCode(code,    group) {
     if (code == "auto" || code in Locale)
         return code
     else if (code in LocaleAlias)
         return LocaleAlias[code]
     else if (tolower(code) in LocaleAlias)
         return LocaleAlias[tolower(code)]
-    else
-        return # return nothing if not found
+
+    # Remove unidentified region or script code
+    match(code, /^([[:alpha:]][[:alpha:]][[:alpha:]]?)-(.*)$/, group)
+    if (group[1])
+        return group[1]
+
+    return # return nothing if not found
 }

 # Return the name of a language.


Languages: add Assamese language

Languages: add Assamese language

--- include/Languages.awk
+++ include/Languages.awk
@@ -26,6 +26,19 @@
     Locale["am"]["iso"]                = "amh"
     Locale["am"]["glotto"]             = "amha1245"
     Locale["am"]["script"]             = "Ethi"
+
+    #? Assamese
+    Locale["as"]["name"]               = "Assamese"
+    Locale["as"]["endonym"]            = "অসমীয়া"
+    #Locale["as"]["translations-of"]
+    #Locale["as"]["definitions-of"]
+    #Locale["as"]["synonyms"]
+    #Locale["as"]["examples"]
+    #Locale["as"]["see-also"]
+    Locale["as"]["family"]             = "Indo-European"
+    Locale["as"]["iso"]                = "asm"
+    Locale["as"]["glotto"]             = "assa1263"
+    Locale["as"]["script"]             = "Beng"

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


include locales inheriting patterns

include locales inheriting patterns

Change-Id: I06f4578f6d681064a8e41e4bef45a7034b7b5a64

--- i18npool/source/localedata/data/list-dateacceptancepattern.awk
+++ i18npool/source/localedata/data/list-dateacceptancepattern.awk
@@ -8,8 +8,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.

 # Usage: gawk -f list-dateacceptancepattern.awk *.xml [--html]
-# Outputs two lists of locales, one with DateAcceptancePattern elements
-# defined, and one where none are defined.
+#
+# Outputs three lists of locales, one with DateAcceptancePattern elements
+# defined, one with inherited LC_FORMAT elements and thus date patterns, and
+# one where no DateAcceptancePattern are defined.
+#
 # If --html is given as the last parameter, format output suitable for
 # inclusion in HTML.

@@ -21,6 +24,7 @@
     }
     file = ""
     nopatterns = 0
+    inheritedcount = 0
     if (html)
         print "
"
     else
@@ -36,7 +40,7 @@
         endFile()
     file = FILENAME
     patterns = 0
-    noFormatCode = 1
+    inherited = ""
 }

 /<DateAcceptancePattern>/ {
@@ -44,10 +48,10 @@
     pattern[patterns++] = a[3]
 }

-# No FormatCode element means inherited LC_FORMAT ref=...
-# hence pattern inherited as well.
-/<FormatCode>/ {
-    noFormatCode = 0
+# pattern inherited as well
+/<LC_FORMAT[^>]* ref="[^>"]+"[^>]*>/ {
+    split( $0, a, /.* ref="|"/ )
+    inherited = a[2]
 }

@@ -61,6 +65,28 @@
     }
     else
         print "\n"
+
+    print "Locales inheriting patterns:"
+    if (html)
+    {
+        print "
"
+        for (i=0; i<inheritedcount; ++i)
+        {
+            if (LocaleHasPatterns[InheritedList[i][1]])
+                print InheritedList[i][0] " = " InheritedList[i][1] "    "
+        }
+        print "\n
"
+    }
+    else
+    {
+        for (i=0; i<inheritedcount; ++i)
+        {
+            if (LocaleHasPatterns[InheritedList[i][1]])
+                print InheritedList[i][0] " = " InheritedList[i][1]
+        }
+        print "\n"
+    }
+
     print "Locales without explicit DateAcceptancePattern elements:"
     if (html)
         print "
"
@@ -85,11 +111,13 @@

 function endFile() {
+    locale =  getLocale( file)
+    LocaleHasPatterns[locale] = patterns
     if (patterns)
     {
         if (html)
         {
-            print "
 " getLocale( file) ":"
+            print "
 " locale ":"
             print "
"
             for ( i=0; i<patterns; ++i )
             {
@@ -99,15 +127,21 @@
         }
         else
         {
-            print getLocale( file) ":"
+            print locale ":"
             for ( i=0; i<patterns; ++i )
             {
                 print "    " pattern[i]
             }
         }
     }
-    else if (!noFormatCode)
-        NoPatternList[nopatterns++] = getLocale( file)
+    else if (inherited)
+    {
+        InheritedList[inheritedcount][0] = locale
+        InheritedList[inheritedcount][1] = inherited
+        ++inheritedcount
+    }
+    else
+        NoPatternList[nopatterns++] = locale
 }


Convert transcript to all lower case

Convert transcript to all lower case

git-svn-id: a8b04003a33e1d3e001b9d20391fa392a9f62d91@1411 94700074-3cef-4d97-a70e-9c8c206c02f5

--- scripts/unbundleHub4.awk
+++ scripts/unbundleHub4.awk
@@ -74,6 +74,7 @@
             transcript = transcript " " $i;
         }
     }
+    transcript = tolower(transcript);

     audioName = directory source "." audioCount "." speechClass ".raw";


remove the influence of LC_ALL environment locale

Fixes #3539

--- sql/parser/all_keywords.awk
+++ sql/parser/all_keywords.awk
@@ -6,7 +6,7 @@
     print "var keywords = map[string]int{"

     # This variable will be associated with a pipe for intermediate output.
-    sort = "sort"
+    sort = "env LC_ALL=C sort"
 }

 /^.*_keyword:/ {


Got rid of the funny for loop

Got rid of the funny for loop

--- jni/scripts/gen_jnienv_h.awk
+++ jni/scripts/gen_jnienv_h.awk
@@ -33,10 +33,10 @@
 	name = ""
 	family = ""
 	declaration = ""
-	j = 0
-	for (i in declarations) {
-		declaration = declarations[j]
-		next_declaration = declarations[j+1]
+	j = length(declarations)
+	for (i = 0; i < j; ++i) {
+		declaration = declarations[i]
+		next_declaration = declarations[i+1]
 		name = get_name(declaration)
 		next_name = get_name(next_declaration)
 		if (next_name == name "V") {
@@ -60,7 +60,6 @@
 			print declaration
 			print ""
 		}
-		j++
 	}

 	# Ending Stub


Skip invalid lines, probably should emit a warning

--- sourcetab.awk
+++ sourcetab.awk
@@ -1 +1 @@
-{env=""; for (i=4; i<=NF; i++) {env=$i" "env}; print env "handlers/"$1 " " $2 " " $3;}
+{env=""; if (NF<3) next; for (i=4; i<=NF; i++) {env=$i" "env}; print env "handlers/"$1 " " $2 " " $3;}


Include the dynamically generated constants in the brlapi_keys group. (dm)

git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@2833 91a5dbb7-01b9-0310-9b5f-b28072856b6e

--- Programs/brlapi_constants.awk
+++ Programs/brlapi_constants.awk
@@ -17,12 +17,15 @@

 BEGIN {
   writeHeaderPrologue("BRLAPI_INCLUDED_CONSTANTS", "brlapi.h")
-  beginDoxygenFile("BrlAPI Commans")
-  beginDoxygenGroup("brlapi_commands", "Defines for BrlAPI Commands")
+  beginDoxygenFile()
+  print "/** \\ingroup brlapi_keys"
+  print " * @{ */"
+  print ""
 }

 END {
-  endDoxygenGroup()
+  print "/** @} */"
+  print ""
   writeHeaderEpilogue()
 }


Use URN in rdf-n3.awk

Use URN in rdf-n3.awk

--- misc/rdf-n3.awk
+++ misc/rdf-n3.awk
@@ -25,7 +25,8 @@

     if (nsenses == 0 || nisas == 0) next;

-    print ":c" $1, TYPE, CONCEPT, ".";
+    print "<urn:linked:c" $1 ">", TYPE,  CONCEPT,           ".";
+    print "<urn:linked:c" $1 ">", LABEL, "\"synset" $1 "\"", ".";

     for (sense_id in senses) {
         sense = senses[sense_id];
@@ -42,20 +43,20 @@
             if (!(word in windex)) {
                 windex[word] = wcount++;

-                print ":w" windex[word], TYPE,          WORD,              ".";
-                print ":w" windex[word], LABEL,         "\"" word "\"",    ".";
-                print ":f" windex[word], TYPE,          FORM,              ".";
-                print ":f" windex[word], LABEL,         "\"" word "\"",    ".";
-                print ":f" windex[word], WRITTENREP,    "\"" word "\"",    ".";
-                print ":w" windex[word], CANONICALFORM, ":f" windex[word], ".";
+                print "<urn:linked:w" windex[word] ">", TYPE,          WORD,                             ".";
+                print "<urn:linked:w" windex[word] ">", LABEL,         "\"" word "\"",                   ".";
+                print "<urn:linked:f" windex[word] ">", TYPE,          FORM,                             ".";
+                print "<urn:linked:f" windex[word] ">", LABEL,         "\"" word "\"",                   ".";
+                print "<urn:linked:f" windex[word] ">", WRITTENREP,    "\"" word "\"",                   ".";
+                print "<urn:linked:w" windex[word] ">", CANONICALFORM, "<urn:linked:f" windex[word] ">", ".";
             }

-            print ":s" sindex[sense], TYPE,          LEXICALSENSE,       ".";
-            print ":s" sindex[sense], LABEL,         "\"" sense "\"",    ".";
-            print ":s" sindex[sense], ISSENSEOF,     ":w" windex[word],  ".";
-            print ":w" windex[word],  SENSE,         ":s" sindex[sense], ".";
-            print ":s" sindex[sense], REFERENCE,     ":c" $1,            ".";
-            print ":c" $1,            ISREFERENCEOF, ":s" sindex[sense], ".";
+            print "<urn:linked:s" sindex[sense] ">", TYPE,          LEXICALSENSE,       ".";
+            print "<urn:linked:s" sindex[sense] ">", LABEL,         "\"" sense "\"",    ".";
+            print "<urn:linked:s" sindex[sense] ">", ISSENSEOF,     "<urn:linked:w" windex[word] ">",  ".";
+            print "<urn:linked:w" windex[word] ">",  SENSE,         "<urn:linked:s" sindex[sense] ">", ".";
+            print "<urn:linked:s" sindex[sense] ">", REFERENCE,     "<urn:linked:c" $1 ">",            ".";
+            print "<urn:linked:c" $1 ">",            ISREFERENCEOF, "<urn:linked:s" sindex[sense] ">", ".";
         }

         for (isa_id in isas) {
@@ -73,22 +74,22 @@
                 if (!(word in windex)) {
                     windex[word] = wcount++;

-                    print ":w" windex[word], TYPE,          WORD,              ".";
-                    print ":w" windex[word], LABEL,         "\"" word "\"",    ".";
-                    print ":f" windex[word], TYPE,          FORM,              ".";
-                    print ":f" windex[word], LABEL,         "\"" word "\"",    ".";
-                    print ":f" windex[word], WRITTENREP,    "\"" word "\"",    ".";
-                    print ":w" windex[word], CANONICALFORM, ":f" windex[word], ".";
+                    print "<urn:linked:w" windex[word] ">", TYPE,          WORD,              ".";
+                    print "<urn:linked:w" windex[word] ">", LABEL,         "\"" word "\"",    ".";
+                    print "<urn:linked:f" windex[word] ">", TYPE,          FORM,              ".";
+                    print "<urn:linked:f" windex[word] ">", LABEL,         "\"" word "\"",    ".";
+                    print "<urn:linked:f" windex[word] ">", WRITTENREP,    "\"" word "\"",    ".";
+                    print "<urn:linked:w" windex[word] ">", CANONICALFORM, "<urn:linked:f" windex[word] ">", ".";
                 }

-                print ":s" sindex[isa],  TYPE,      LEXICALSENSE,      ".";
-                print ":s" sindex[isa],  LABEL,     "\"" isa "\"",     ".";
-                print ":s" sindex[isa],  ISSENSEOF, ":w" windex[word], ".";
-                print ":w" windex[word], SENSE,     ":s" sindex[isa],  ".";
+                print "<urn:linked:s" sindex[isa] ">",  TYPE,      LEXICALSENSE,      ".";
+                print "<urn:linked:s" sindex[isa] ">",  LABEL,     "\"" isa "\"",     ".";
+                print "<urn:linked:s" sindex[isa] ">",  ISSENSEOF, "<urn:linked:w" windex[word] ">", ".";
+                print "<urn:linked:w" windex[word] ">", SENSE,     "<urn:linked:s" sindex[isa] ">",  ".";
             }

-            print ":s" sindex[sense], BROADER,  ":s" sindex[isa],   ".";
-            print ":s" sindex[isa],   NARROWER, ":s" sindex[sense], ".";
+            print "<urn:linked:s" sindex[sense] ">", BROADER,  "<urn:linked:s" sindex[isa] ">",   ".";
+            print "<urn:linked:s" sindex[isa] ">",   NARROWER, "<urn:linked:s" sindex[sense] ">", ".";
         }
     }
 }


feat: Add plaintext option

feat: Add plaintext option

--- changelog.awk
+++ changelog.awk
@@ -23,12 +23,18 @@
 	sub(/.*tag: /, "", input)
 	# Cut out text after tag
 	sub(/,.*/, "", input)
-	printf("\n## %s\n", input)
+	if (TYPE == "plain")
+		printf("\n%s\n", input)
+	else
+		printf("\n## %s\n", input)
 }
 function printCommit(input, longHash, shortHash) {
 	if ( match(input, CHANGELOG_REGEX) ) {
 		sub(CHANGELOG_REGEX, "", input)
-		printf("- %s (%s)\n", input, makeCommitLink(REPO_URL, shortHash, longHash) )
+		if (TYPE == "plain")
+			printf("\t- %s\n", input, makeCommitLink(REPO_URL, shortHash, longHash) )
+		else
+			printf("- %s (%s)\n", input, makeCommitLink(REPO_URL, shortHash, longHash) )
 	}
 }
 function makeCommitLink(repoUrl, shortHash, longHash) {


Include "First Look" episodes

Include "First Look" episodes

But don't add them to episode count or total duration

--- calculateMHzShowDurations.awk
+++ calculateMHzShowDurations.awk
@@ -33,28 +33,36 @@

 # Accumulate total time on any line that has a valid duration, it must be an episode
 $4 != "" {
+    # Are we a "First Look" episode? Print it, but don't count it as a real episode
+    if ($1 ~ /, PR \| /) {
+        # Don't use its duration
+        $4 = ""
+        print >> LONG_SPREADSHEET
+        # Skip everything else
+        next
+    }
+    # We have a normal episode
+    episodesCounted += 1
+    # print "==> episodesCounted = " episodesCounted > "/dev/stderr"
     print >> LONG_SPREADSHEET
     # Check all durations for strict HH:MM:SS format
     if ($4 !~ /^[[:digit:]]{1,2}:[[:digit:]]{2}:[[:digit:]]{2}$/) {
-        # print "==> Bad duration " $4 " in " $0 >> ERRORS
         print "==> Bad duration " $4 " in " $0 >> ERRORS
         next
-    } else {
-        split ($4, tm, ":")
-        totalTime[3] += tm[3]
-        totalTime[2] += tm[2] + int(totalTime[3] / 60)
-        totalTime[1] += tm[1] + int(totalTime[2] / 60)
-        totalTime[3] %= 60; totalTime[2] %= 60
-        totalEpisodes += 1
-        # Accumulate episode times to use when a show line is found
-        secs += tm[3]
-        mins += tm[2] + int(secs / 60)
-        hrs += tm[1] + int(mins / 60)
-        secs %= 60; mins %= 60
-        episodesCounted += 1
-        # print "==> episodesCounted = " episodesCounted > "/dev/stderr"
-        next
     }
+    # We have a valid duration, add to total
+    split ($4, tm, ":")
+    totalTime[3] += tm[3]
+    totalTime[2] += tm[2] + int(totalTime[3] / 60)
+    totalTime[1] += tm[1] + int(totalTime[2] / 60)
+    totalTime[3] %= 60; totalTime[2] %= 60
+    totalEpisodes += 1
+    # Accumulate episode times to use when a show line is found
+    secs += tm[3]
+    mins += tm[2] + int(secs / 60)
+    hrs += tm[1] + int(mins / 60)
+    secs %= 60; mins %= 60
+    next
 }

 # If a line has seasons, it must be a show - Add it to the short spreadsheet
@@ -65,7 +73,7 @@
         $4 = sprintf ("%02d:%02d:%02d", hrs, mins, secs)
         # Print line with episodesCounted and duration to short spreadsheet
         print
-        # Don't print show duration to LONG_SPREADSHEET so durations icolumn can be summed
+        # Don't print show duration to LONG_SPREADSHEET so durations column can be summed
         $4 = ""
         print >> LONG_SPREADSHEET
         totalShows += 1


Reassign testers.

Reassign testers.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@30476 4f837ed2-42f5-46e7-a7a5-fa17313484d4


s/pckbd_keydesc_precisionbook/gsckbd_keydesc_precisionbook/g

--- arch/hppa/gsc/makemap.awk
+++ arch/hppa/gsc/makemap.awk
@@ -1,5 +1,5 @@
 #! /usr/bin/awk -f
-#	$OpenBSD: makemap.awk,v 1.3 2005/05/04 20:07:07 miod Exp $
+#	$OpenBSD: makemap.awk,v 1.4 2005/05/06 18:04:37 mickey Exp $
 #
 # Copyright (c) 2003, Miodrag Vallat.
 # All rights reserved.
@@ -228,7 +228,7 @@
 		# Add 241 to the US map...
 		print "    KC(241),\tKS_Delete"
 		print $0
-		print "\nstatic const keysym_t pckbd_keydesc_precisionbook[] = {"
+		print "\nstatic const keysym_t gsckbd_keydesc_precisionbook[] = {"
 		print "/*  pos      command\t\tnormal		shifted */"
 		print "    KC(7),   KS_Cmd_Screen0,\tKS_f1,"
 		print "    KC(15),  KS_Cmd_Screen1,\tKS_f2,"
@@ -268,7 +268,7 @@
 	mapnum++
 }
 /{0, 0, 0, 0}/ {
-	printf("\tKBD_MAP(KB_US | KB_MACHDEP,\tKB_US,\tpckbd_keydesc_precisionbook),\n");
+	printf("\tKBD_MAP(KB_US | KB_MACHDEP,\tKB_US,\tgsckbd_keydesc_precisionbook),\n");
 }
 {
 	if (declk)


msg_parser.awk: including extra headers in the generated parser table.

darcs-hash:20061207172708-65a35-a9577448d54623753513bc66ff31012de9f35ba4.gz

--- libsofia-sip-ua/msg/msg_parser.awk
+++ libsofia-sip-ua/msg/msg_parser.awk
@@ -55,14 +55,21 @@
   split("", Comments);
   split("", COMMENTS);

+  # indexed by the C name of the header
+  split("", Since);		# Non-NUL if extra
+  split("", Extra);		# Offset in extra headers
+
   template="";
   template1="";
   template2="";
   template3="";
   prefix="";
   tprefix="";
+  extra=0;
   failed=0;
   success=0;
+
+  extra_struct = "msg_pub_extra";

   ERRNO="error";
 }
@@ -143,6 +150,10 @@
   COMMENTS[N] = COMMENT;

   symbols[name] = comment;
+  if (since) {
+    Since[name] = since;
+    Extra[name] = extra++;
+  }

   if (PR) {
     replace(template, hash, name, NAME, comment, Comment, COMMENT, since);
@@ -322,7 +333,7 @@
 }

 /^#### EXTRA HEADER LIST STARTS HERE ####$/ { HLIST=1; templates(); }
-HLIST && /^[a-z]/ { protos($1, $0, 0, $2); }
+HLIST && /^[a-z]/ { protos($1, $0, 0, $2); headers[total++] = $1; }
 /^#### EXTRA HEADER LIST ENDS HERE ####$/ { HLIST=0;  }

@@ -410,6 +421,13 @@
     }

     # printf("extern msg_hclass_t msg_multipart_class[];\n\n") > PT;
+
+    if (extra > 0) {
+      printf("struct %s {\n", extra_struct) > PT;
+      printf("  %s_t base;\n", module) > PT;
+      printf("  msg_header_t *extra[%u];\n", extra) > PT;
+      printf("};\n\n") > PT;
+    }

     printf("msg_mclass_t const %s_mclass[1] = \n{{\n", module) > PT;
     printf("# if defined (%s_HCLASS)\n", toupper(module)) > PT;
@@ -472,8 +490,14 @@
 	n = header_hash[i];
         flags = header_flags[n]; if (flags) flags = ",\n      " flags;

-	printf("    { %s_%s_class, offsetof(%s_t, %s_%s)%s }%s\n",
-	       tprefix, n, module, prefix, n, flags, c) > PT;
+	if (Since[n]) {
+	  printf("    { %s_%s_class, offsetof(struct %s, extra[%u])%s }%s\n",
+		 tprefix, n, extra_struct, Extra[n], flags, c) > PT;
+	}
+	else {
+	  printf("    { %s_%s_class, offsetof(%s_t, %s_%s)%s }%s\n",
+		 tprefix, n, module, prefix, n, flags, c) > PT;
+	}
       }
       else {
 	printf("    { NULL, 0 }%s\n", c) > PT;


Commons: add squeeze()

Commons: add squeeze()

--- include/Commons.awk
+++ include/Commons.awk
@@ -110,6 +110,18 @@
     return temp
 }

+# Squeeze a source line of AWK code.
+function squeeze(line) {
+    # Remove preceding spaces
+    gsub(/^[[:space:]]+/, "", line)
+    # Remove in-line comment
+    gsub(/#[^"]*$/, "", line)
+    # Remove trailing spaces
+    gsub(/[[:space:]]+$/, "", line)
+
+    return line
+}
+
 # Return 1 if the array contains anything; otherwise return 0.
 function anything(array,
                   ####


load helpers after config and meta have been processed

--- lib/render.awk
+++ lib/render.awk
@@ -34,7 +34,7 @@

 # Done processing meta
 # Since data is loaded now, load the helpers
-action != "meta" && helpers_loaded == "no" && helpers == "yes" {
+action != "meta" && action != "config" && helpers_loaded == "no" && helpers == "yes" {
   load_helpers()
   helpers_loaded = "yes"
 }


Not ever Acorn show has a "-- Viewers Also Watched --"

--- getAcornFrom-seriesPages.awk
+++ getAcornFrom-seriesPages.awk
@@ -303,7 +303,7 @@
     next
 }

-/-- Viewers Also Watched --/ {
+/<footer>/ {
     print (episodeLinesFound == 1 ? "=0" : "=" numEpisodesStr) >> NUM_EPISODES_FILE
     if (description == "")
         printf ("==> No description: %d\t%s  %s\n", SERIES_NUMBER, shortURL, seriesTitle) >> ERROR_FILE


Correct error in number variables printed

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@23951 4f837ed2-42f5-46e7-a7a5-fa17313484d4


Main: set default engine to auto

Main: set default engine to auto

--- include/Main.awk
+++ include/Main.awk
@@ -20,7 +20,7 @@
     Option["debug"] = 0

     # Translation engine
-    Option["engine"] = "google"
+    Option["engine"] = "auto"

     # Display
     Option["verbose"] = 1
@@ -780,8 +780,11 @@
         print getList(Option["tl"])
         exit ExitCode
     case "list-engines":
+        saveSortedIn = PROCINFO["sorted_in"]
+        PROCINFO["sorted_in"] = "@ind_num_asc"
         for (translator in Translator)
             print (Option["engine"] == translator ? "* " : "  ") translator
+        PROCINFO["sorted_in"] = saveSortedIn
         exit ExitCode
     case "upgrade":
         upgrade()


- Fixed typo in kern_params initialization (was kern_parms) - Fixed handing of kernel parameter entries to allow spaces - Enabled acpi - Specified bridge network interface gt #1079

--- src/condor_vm-gahp/libvirt_simple_script.awk
+++ src/condor_vm-gahp/libvirt_simple_script.awk
@@ -24,13 +24,18 @@
 # that the entire classad has been sent to us.
 {
     gsub(/\"/, "")
-    attrs[$1] = $3
+    key = $1
+    # Matching value should be $3-$NR
+    $1 = ""
+    $2 = ""
+    sub(/^  /, "")
+    attrs[key] = $0
     bootloader = ""
     root = ""
     initrd = ""
     kernel = ""
-    kern_parms = ""
-    print "Received attribute: " $1 "=" attrs[$1] >debug_file
+    kern_params = ""
+    print "Received attribute: " key "=" attrs[key] >debug_file
 }

 END {
@@ -85,6 +90,11 @@
     {
 	print "<bootloader>" bootloader "</bootloader>"
     }
+
+    # Make sure guests destroy on power off
+    print "<features><acpi/><apic/><pae/></features>" ;
+    print "<on_poweroff>destroy</on_poweroff><on_reboot>restart</on_reboot><on_crash>restart</on_crash>" ;
+
     print "<devices>" ;
     if(attrs["JobVMNetworking"] == "TRUE")
     {
@@ -94,7 +104,7 @@
 	}
 	else
 	{
-	    print "<interface type='bridge'><mac address='" attrs["JobVM_MACADDR"] "'/></interface>" ;
+	    print "<interface type='bridge'><mac address='" attrs["JobVM_MACADDR"] "'/><source bridge='br0'/></interface>" ;
 	}
     }
     print "<disk type='file'>" ;


input file allowed not to have two fields

--- scripts/get_vectors.awk
+++ scripts/get_vectors.awk
@@ -14,11 +14,11 @@
     while ((ret = (getline < ifile)) > 0) {
 	if (!NF)
 	    continue
-	else if (NF != 2) {
-	    printf("Incorrect line format: %s", $0) > "/sys/stderr"
-	    exit 2
-	}
-        $1 = lower($1)
+	# else if (NF != 2) {
+	#     printf("Incorrect line format: %s", $0) > "/sys/stderr"
+	#     exit 2
+	# }
+        $1 = tolower($1)
         if ($1 in WORD2SEEK)
           continue