rnc2rng.awk: Support define/@combine in compact syntax

--- rnc2rng.awk
+++ rnc2rng.awk
@@ -427,13 +427,29 @@
   }
   else {
     nameix = index($0, "=");
+    combine = "";
     if (nameix < 1) next;
-    name = substr($0, 1, nameix - 1);
+    if (substr($0, nameix - 1, 1) == "|") {
+      combine = "choice";
+      name = substr($0, 1, nameix - 2);
+    }
+    else if (substr($0, nameix - 1, 1) == "&") {
+      combine = "interleave";
+      name = substr($0, 1, nameix - 2);
+    }
+    else {
+      name = substr($0, 1, nameix - 1);
+    }
     sub(/ /, "", name);
     if (name == "start")
       stack[++stack_i] = "<start>"
-    else
-      stack[++stack_i] = sprintf("<define name='%s'>", name);
+    else {
+      define = sprintf("<define name='%s'", name);
+      if (combine != "")
+        define = define " combine='" combine "'"
+      define = define ">"
+      stack[++stack_i] = define;
+    }
     mode = "pattern";
     if (length($0) >= nameix + 1)
       parse_pattern(substr($0, nameix + 1))


LanguageData: update section E

LanguageData: update section E

--- include/LanguageData.awk
+++ include/LanguageData.awk
@@ -563,9 +563,7 @@
     Locale["dz"]["spoken-in"]          = "Bhutan"
     Locale["dz"]["supported-by"]       = ""

-
-
-    #21 English (Standard English)
+    # English
     Locale["en"]["name"]               = "English"
     Locale["en"]["endonym"]            = "English"
     Locale["en"]["translations-of"]    = "Translations of %s"
@@ -574,12 +572,15 @@
     Locale["en"]["examples"]           = "Examples"
     Locale["en"]["see-also"]           = "See also"
     Locale["en"]["family"]             = "Indo-European"
+    Locale["en"]["branch"]             = "West Germanic"
     Locale["en"]["iso"]                = "eng"
     Locale["en"]["glotto"]             = "stan1293"
     Locale["en"]["script"]             = "Latn"
     Locale["en"]["dictionary"]         = "true" # has dictionary
-
-    #22 Esperanto
+    Locale["en"]["spoken-in"]          = "worldwide"
+    Locale["en"]["supported-by"]       = "google; bing; yandex"
+
+    # Esperanto
     Locale["eo"]["name"]               = "Esperanto"
     Locale["eo"]["endonym"]            = "Esperanto"
     Locale["eo"]["translations-of"]    = "Tradukoj de %s"
@@ -588,11 +589,15 @@
     Locale["eo"]["examples"]           = "Ekzemploj"
     Locale["eo"]["see-also"]           = "Vidu ankaŭ"
     Locale["eo"]["family"]             = "Constructed language"
+    #Locale["eo"]["branch"]
     Locale["eo"]["iso"]                = "epo"
     Locale["eo"]["glotto"]             = "espe1235"
     Locale["eo"]["script"]             = "Latn"
-
-    #23 Estonian
+    Locale["eo"]["spoken-in"]          = "worldwide"
+    Locale["eo"]["description"]        = "the world's most widely spoken constructed international auxiliary language, designed to be a universal second language for international communication"
+    Locale["eo"]["supported-by"]       = "google; yandex"
+
+    # Estonian
     Locale["et"]["name"]               = "Estonian"
     Locale["et"]["endonym"]            = "Eesti"
     Locale["et"]["translations-of"]    = "Sõna(de) %s tõlked"
@@ -601,9 +606,12 @@
     Locale["et"]["examples"]           = "Näited"
     Locale["et"]["see-also"]           = "Vt ka"
     Locale["et"]["family"]             = "Uralic"
+    Locale["et"]["branch"]             = "Finnic"
     Locale["et"]["iso"]                = "est"
     Locale["et"]["glotto"]             = "esto1258"
     Locale["et"]["script"]             = "Latn"
+    Locale["et"]["spoken-in"]          = "Estonia"
+    Locale["et"]["supported-by"]       = "google; bing; yandex"

     # Ewe
     Locale["ee"]["name"]               = "Ewe"
@@ -614,9 +622,14 @@
     #Locale["ee"]["examples"]
     #Locale["ee"]["see-also"]
     Locale["ee"]["family"]             = "Atlantic-Congo"
+    Locale["ee"]["branch"]             = "Gbe"
     Locale["ee"]["iso"]                = "ewe"
     Locale["ee"]["glotto"]             = "ewee1241"
     Locale["ee"]["script"]             = "Latn"
+    Locale["ee"]["spoken-in"]          = "Ghana; Togo; Benin"
+    Locale["ee"]["supported-by"]       = "google"
+
+

     #24 Filipino / Tagalog
     Locale["tl"]["name"]               = "Filipino"


MONDRIAN: Integrate new checkFile rule from //open/util/bin/checkFile.awk.

[git-p4: depot-paths = "//open/mondrian/": change = 13379]

--- bin/checkFile.awk
+++ bin/checkFile.awk
@@ -356,6 +356,9 @@
         error(fname, FNR, "operator '" a[1] "' must not be at end of line");
     }
 }
+match(s, /^ *(=) /, a) {
+    error(fname, FNR, "operator '" a[1] "' must not be at start of line");
+}
 s ~ /\<[[:digit:][:lower:]][[:alnum:]_]*</ {
     # E.g. "p<" but not "Map<"
     if (!matchFile(fname)) {}


collapse exceptions into prefixes, cover lagging http(no S)://monarch

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -65,16 +65,12 @@
 function contract(uri){
 	u = uri
 	# shorten till longest uri in curi map is found (or not)
-	while(!(u in prefix) && (0 < length(u)))
+	while(!(u in prefix))
 		u = stripid(substr(u,1,length(u)-1))
 	if(u in prefix)
 		return prefix[u]
 	else
-		for(ex in exception){
-			if((0 < match(uri, ex)) && exception[substr(uri,1,RLENGTH)])
-				return exception[substr(uri,1,RLENGTH)]
-		}
-		return "___" simplify(uri)
+		return simplify(uri)
 }

 # get the final (incl fragment identifier) portion of a slashed path
@@ -88,21 +84,22 @@
 }

 BEGIN{
+	# exceptions
 	prefix["BNODE"]="BNODE"  # is a fixed point
 	prefix["https://monarchinitiative.org/_"]="BNODE"
 	# just until skolemized bnodes get in the curie map?
-	exception["https://monarchinitiative.org/.well-known/genid"]="BNODE"
+	prefix["https://monarchinitiative.org/.well-known/genid"]="BNODE"
 	# revisit if exceptions are still necessary
-	exception["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]="rdf"
-	exception["http://www.w3.org/2000/01/rdf-schema#"]="rdfs"
-	exception["http://www.w3.org/2002/07/owl#"]="owl"
+	prefix["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]="rdf"
+	prefix["http://www.w3.org/2000/01/rdf-schema#"]="rdfs"
+	prefix["http://www.w3.org/2002/07/owl#"]="owl"
 	# in mgi
-	exception["https://www.mousephenotype.org"]="IMPC"
+	prefix["https://www.mousephenotype.org"]="IMPC"
 	# in panther
-	exception["http://identifiers.org/wormbase"]="WormBase"
+	prefix["http://identifiers.org/wormbase"]="WormBase"
 	# till all non httpS: are purged
-	exception["http://monarchinitiative.org/"]="BASE"
-	exception["https://monarchinitiative.org/MONARCH_"]="MONARCH"
+	prefix["http://monarchinitiative.org/"]="BASE"
+	prefix["http://monarchinitiative.org/MONARCH_"]="MONARCH"
 }

 # main loop


comments

comments

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -1,21 +1,24 @@
 #! /usr/bin/gawk -f

 #  Reduce the subject and object of RDF triples (ntriples format)
-# down to their @prefix (or literal object class)
-#  Reduce predicates to the specific identifier and
-# the ontology they are from.(curi form)
+#  down to their @prefix (or literal object class)
+#  Reduce predicates to the specific identifier
+#  and the ontology they are from.(curi form)
 #  Express the subject and object as nodes with a directed edge
-# labeled with the predicate in the graphviz dot format
+#  labeled with the predicate in the graphviz dot format
 #  Include a tally of each combination of nodes and edge

 #  This may over generalize in some cases because I do not have
-# a handy way to differentiate uri for subjects and objects
-# which may belong to a "structural" ontology as opposed to
+#  a handy way to differentiate uri for subjects and objects
+#  which may belong to a "structural" ontology as opposed to
 # a data uri.

 #  Perhaps an improvement would be to also
-# express subject and objects as individual curies (ala predicates)
-# iff their namespace is also used by a predicate.
+#  express subject and objects as individual curies (ala predicates)
+#  iff their namespace is also used by a predicate.
+
+#  Post processing to augment predicate identifiers
+#  with their labels seems to improve usefulness.

 ##########################################################
 # remove first and last chars from input string <>
@@ -210,4 +213,3 @@
 	print "label=\"" substr(title,1,length(title)-3) " (" datestamp ")\";"
 	print "}"
 }
-


library: entab only replace 2 or more spaces

--- library.awk
+++ library.awk
@@ -701,7 +701,7 @@
     siz = checkpos(siz, 8, "detab: second argument must be positive")
     str = detab(str, siz)
     gsub(".{" siz "}", "&\1", str)
-    gsub(" +\1", "\t", str)
+    gsub("  +\1", "\t", str)
     gsub("\1", "", str)
     return str
 }


Rename default to default_function, for compatibility with GNU awk. (For cross-compiling out-of-tree kernel modules, for example.)

--- sys/tools/makeobjops.awk
+++ sys/tools/makeobjops.awk
@@ -240,7 +240,7 @@
 		lineno++
 	}

-	default = "";
+	default_function = "";
 	if (!match(line, /\};?/)) {
 		warnsrc("Premature end of file");
 		error = 1;
@@ -248,9 +248,9 @@
 	}
 	extra = substr(line, RSTART + RLENGTH);
 	if (extra ~ /[	 ]*DEFAULT[ 	]*[a-zA-Z_][a-zA-Z_0-9]*[ 	]*;/) {
-		default = extra;
-		sub(/.*DEFAULT[	 ]*/, "", default);
-		sub(/[; 	]+.*$/, "", default);
+		default_function = extra;
+		sub(/.*DEFAULT[	 ]*/, "", default_function);
+		sub(/[; 	]+.*$/, "", default_function);
 	}
 	else if (extra && opt_d) {
 		#   Warn about garbage at end of line.
@@ -294,8 +294,8 @@

 	firstvar = varnames[1];

-	if (default == "")
-		default = "kobj_error_method";
+	if (default_function == "")
+		default_function = "kobj_error_method";

 	# the method description
 	printh("/** @brief Unique descriptor for the " umname "() method */");
@@ -308,7 +308,7 @@

 	# Print out the method desc
 	printc("struct kobj_method " mname "_method_default = {");
-	printc("\t&" mname "_desc, (kobjop_t) " default);
+	printc("\t&" mname "_desc, (kobjop_t) " default_function);
 	printc("};\n");

 	printc("struct kobjop_desc " mname "_desc = {");


rnc2rng: Allow combine on start

rnc2rng: Allow combine on start

--- rnc2rng.awk
+++ rnc2rng.awk
@@ -467,14 +467,13 @@
     sub(/^ */, "", name);
     sub(/ *$/, "", name);
     if (name == "start")
-      stack[++stack_i] = "<start>"
-    else {
+      define = "<start"
+    else
       define = sprintf("<define name='%s'", name);
-      if (combine != "")
-        define = define " combine='" combine "'"
-      define = define ">"
-      stack[++stack_i] = define;
-    }
+    if (combine != "")
+      define = define " combine='" combine "'"
+    define = define ">"
+    stack[++stack_i] = define;
     mode = "pattern";
     if (length($0) >= nameix + 1)
       parse_pattern(substr($0, nameix + 1))


(#4109) change .awk script so that VMWARE_LOCAL_SETTINGS_FILE config is commented out by default. ===VersionHistory:Pending===

--- src/condor_examples/convert_config_to_win32.awk
+++ src/condor_examples/convert_config_to_win32.awk
@@ -192,7 +192,7 @@
 	next
 }
 /^#VMWARE_LOCAL_SETTINGS_FILE/ {
-	print "VMWARE_LOCAL_SETTINGS_FILE = $(RELEASE_DIR)/condor_vmware_local_settings"
+	print "#VMWARE_LOCAL_SETTINGS_FILE = $(RELEASE_DIR)/condor_vmware_local_settings"
 	next
 }


update

update

--- sedbot.awk
+++ sedbot.awk
@@ -1,12 +1,10 @@
 #!/usr/bin/gawk -f
-
 # https://github.com/FoobarBazbot/sedbot
 # https://github.com/FoobarBazbot/sedbot/blob/master/LICENSE
 # by FoobarBazbot
 # modified by crutchy
 # https://github.com/crutchy-/test/blob/master/sedbot.awk
 # 21-july-2014
-
 function lineout(old,new,nouser) {
   if(old!=new) print (nouser?"":"<" tauntuser(user) "> ") new >outfile; close(outfile);
   if(taunt[tolower(user)]>0) taunt[tolower(user)]--;
@@ -16,6 +14,7 @@
   return u;
 }
 BEGIN {
+  #outfile=( ENVIRON["HOME"] "/sedbotirc/irc.sylnt.us/#soylent/in");
   line_re="^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2} <([^>]*)> (.*)$";
   blag_re="world wide web|internet|interweb|intersphere|intertubes|interblag|blogosphere|blagonet|blagosphere|blagoblag|webnet|webweb";
   blag_n=split(blag_re,blag_word,/\|/);


Fix order of opening and closing tags

Fix order of opening and closing tags

- When generating HTML from a manual page ensure that opening
  and closing tags always come in the right order
- Allow combining bold and underline statements

--- doxy/mantohtml.awk
+++ doxy/mantohtml.awk
@@ -10,10 +10,28 @@
 	# The backspace character is used to combine characters
 	BS = "\x08"

-	# Special character substitutions
+	# special HTML character substitutions
 	SUB["&"] = "&"
 	SUB["<"] = "<"
 	SUB[">"] = ">"
+
+	# formatting flags
+	FMT_REGULAR    = 0
+	FMT_BOLD       = 1
+	FMT_UNDERLINE  = 2
+
+	# formatting selectors
+	SELECT["_"] = FMT_UNDERLINE
+
+	# opening tags
+	OPEN[FMT_BOLD]                 = ""
+	OPEN[FMT_UNDERLINE]            = ""
+	OPEN[FMT_BOLD + FMT_UNDERLINE] = ""
+
+	# closing tags
+	CLOSE[FMT_BOLD]                 = ""
+	CLOSE[FMT_UNDERLINE]            = ""
+	CLOSE[FMT_BOLD + FMT_UNDERLINE] = ""

 	print "
"
 }
@@ -79,31 +97,32 @@
 	n = p

 	#
-	# replace special characters
+	# detect per character formatting
 	#
+	delete format
+	delete ochars
+
+	olen = 0
 	for (i = 1; i <= n; ++i) {
-		uchars[i] in SUB && uchars[i] = SUB[uchars[i]]
+		# skip ahead of formatting to the output character
+		while (uchars[i + 1] == BS) {
+			i += 2
+			continue
+		}
+		# add character
+		ochars[++olen] = uchars[i]
+		# apply formatting
+		for (p = i - 2; uchars[p + 1] == BS; p -= 2) {
+			format[olen] = SELECT[uchars[p]]
+			format[olen] += (uchars[i] == uchars[p] ? FMT_BOLD : FMT_REGULAR)
+		}
 	}

 	#
-	# detect per character formatting
+	# replace special characters
 	#
-	delete hide
-	delete formatted
-	delete bold
-	delete underline
-	delete strike
-
-	for (i = 1; i <= n; ++i) {
-		if (uchars[i] != BS) {
-			continue
-		}
-		# hide composed characters
-		hide[i - 1] = hide[i] = 1
-		# detect formatting
-		bold[i + 1] = (uchars[i - 1] == uchars[i + 1]) || bold[i - 1];
-		underline[i + 1] = !bold[i + 1] && (uchars[i - 1] == "_") || underline[i - 1];
-		strike[i + 1] = !bold[i + 1] && (uchars[i - 1] == "-") || strike[i - 1];
+	for (i = 1; i <= olen; ++i) {
+		ochars[i] in SUB && ochars[i] = SUB[ochars[i]]
 	}

 	#
@@ -111,48 +130,15 @@
 	#
 	$0 = ""

-	bmode = 0
-	umode = 0
-	smode = 0
-	for (i = 1; i <= n; ++i) {
-		if (hide[i]) {
-			continue
+	last = FMT_REGULAR
+	for (i = 1; i <= olen; ++i) {
+		if (format[i] != last) {
+			$0 = $0 CLOSE[last] OPEN[format[i]]
 		}
-		if (!bmode && bold[i]) {
-			$0 = $0 ""
-			bmode = 1
-		}
-		if (!umode && underline[i]) {
-			$0 = $0 ""
-			umode = 1
-		}
-		if (!smode && strike[i]) {
-			$0 = $0 ""
-			smode = 1
-		}
-		if (smode && !strike[i]) {
-			$0 = $0 ""
-			smode = 0
-		}
-		if (umode && !underline[i]) {
-			$0 = $0 ""
-			umode = 0
-		}
-		if (bmode && !bold[i]) {
-			$0 = $0 ""
-			bmode = 0
-		}
-		$0 = $0 uchars[i]
+		$0 = $0 ochars[i]
+		last = format[i]
 	}
-	if (smode && !strike[i]) {
-		$0 = $0 ""
-	}
-	if (umode && !underline[i]) {
-		$0 = $0 ""
-	}
-	if (bmode && !bold[i]) {
-		$0 = $0 ""
-	}
+	$0 = $0 CLOSE[last]

 	print
 }


gbuild: Replace SHOWINCLUDES_PREFIX without regexp.

With MSVC Japanese, SHOWINCLUDES_PREFIX includes regexp special
charactor \x5b (left square bracket). In this case replacing
SHOWINCLUDES_PREFIX with regexp fails. To fix it, this commit
changes the script not to use regexp.

Example value of $SHOWINCLUDES_PREFIX from MSVC Japanese:
$ echo $SHOWINCLUDES_PREFIX | hexdump -C
83 81 83 82 3a 20 83 43 83 93 83 4e 83 8b 81 5b |....:.C...N...[|
83 68 20 83 74 83 40 83 43 83 8b 3a 20 20 43 3a |.h.t.@.C..:  C:|
5c 54 65 6d 70 5c 73 74 64 69 6f 2e 68 0d 0a    |\Temp\stdio.h..|

Change-Id: Ic7d85fc3a93807de11155488e9d0368427375c78
Reviewed-on: https://gerrit.libreoffice.org/3579
Reviewed-by: Kohei Yoshida <6e47bc5169e040ede988a669348d2aebab98c987@suse.de>
Tested-by: Kohei Yoshida <6e47bc5169e040ede988a669348d2aebab98c987@suse.de>

--- solenv/gbuild/platform/filter-showIncludes.awk
+++ solenv/gbuild/platform/filter-showIncludes.awk
@@ -31,8 +31,6 @@
     if (!showincludes_prefix) {
         showincludes_prefix = "Note: including file:"
     }
-    regex = "^ *" showincludes_prefix " *"
-    pattern = "/" regex "/"

     # to match especially drive letters in whitelist case insensitive
     IGNORECASE = 1
@@ -42,8 +40,10 @@
 }

 {
-    if ($0 ~ regex) {
-        sub(regex, "")
+    sub(/^ */, "")
+    if (index($0, showincludes_prefix) == 1) {
+        $0 = substr($0, 1, length(showincludes_prefix))
+        sub(/^ */, "")
         gsub(/\\/, "/")
         gsub(/ /, "\\ ")
         if ($0 ~ whitelist) { # filter out system headers


#i10000# workaround limitations of solaris awk

--- solenv/gbuild/processdelivered.awk
+++ solenv/gbuild/processdelivered.awk
@@ -30,6 +30,6 @@
     FS=":"
 }

-NF == 2 {
+length($1) > 0 && length($2) > 0 {
     print "COPY " $1 " " $2;
 }


output edges in a sorted order, make gawk explicit

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -1,4 +1,4 @@
-#! /usr/bin/awk -f
+#! /usr/bin/gawk -f

 #  Reduce the subject and object of RDF triples (ntriples format)
 # down to their @prefix (or literal object class)
@@ -195,7 +195,10 @@
 	print "digraph {"
 	print "rankdir=LR;"
 	print "charset=\"utf-8\";"
-	for(edge in edgelist){
+	# sort the edges to facilitate future inter dot comparisons
+	n=asorti(edgelist, sortlist)
+	for (i=1; i<=n; i++) {
+		edge=sortlist[i]
 		split(edge ,spo, SUBSEP);
 		print simplify(spo[1]) " -> " simplify(spo[3]) \
 		" [label=\"" spo[2] " (" edgelist[edge] ")\"];"


- Use 'options DEBUG_VFS_LOCKS' instead of the DEBUG_ALL_VFS_LOCKS    environment variable to enable the lock verifiction code.


nasty conversion:dataset_identifier replacement bug fixed.


Better changelog creator.

Better changelog creator.

--- make/log_to_changelog.awk
+++ make/log_to_changelog.awk
@@ -1,147 +1,161 @@
 BEGIN{
-	key=0
+	revision_key=0
+}
+
+function gline()
+{
+	if(!getline)
+		error("Unexpected EOF")
+	return 1
+}
+
+function error(s)
+{
+	print s > "/dev/stderr"
+	exit(1)
+}
+
+/^?/{next}
+
+#Process a file entry
+/^Working file:/{
+
+	#Get the filename
+	filename=$3
+
+	#Find the tags
+	while(gline() && !/^symbolic names:/);
+
+	#Extract tags
+	delete revision_to_tag
+	while(gline() && ! /^keyword substitution:/)
+	{
+		tagname=substr($1, 1, length($1)-1)
+		revision_to_tag[$2]=tagname
+	}
+
+	#Skip over the rest until the revisions
+	while(gline() && !/^----------------/);
+
+	#There is always at least one revision
+	do
+	{
+		#The revision number
+		gline()
+		revision=$2
+
+		#The commit line
+		gline()
+		commit_line=$0
+		author=substr($6, 1, length($6)-1)
+
+		#Store the date* 10 for extra precision
+		date = $2" "$3
+		gsub(/[^0-9]+/, " ", date)
+		date=mktime(date)*10
+
+		#The commit message
+		message=""
+		while(gline() && !/^[-=]+$/)
+			message = message $0 "\n"
+
+		#The commit line is the primary key.
+
+		#Keep track of commits
+		date_to_line[date]=commit_line
+		line_to_message[commit_line]=message
+		line_to_author[commit_line]=author
+		line_to_files[commit_line]=line_to_files[commit_line] " " filename
+		line_to_revision[commit_line]=line_to_revision[commit_line] " " revision
+
+		#The last file commit which has a certain tag
+		#happens just before the tag.
+		if(tag_to_date[revision_to_tag[revision]] < date)
+			tag_to_date[revision_to_tag[revision]] = date
+	}
+	while(!/^=+$/)
 }

+END{
+	#Delete the null tag for untagged revisions
+	delete tag_to_date[""]

-
-#A log entry
-/RCS file:/{
-	getline
-	sub(/^Working file: /,"")
-	filename=$0
-
-	do
-		getline
-	while(!/symbolic names/)
-
-	delete sym
-
-	getline
-	for(;!/keyword substitution/;getline)
-	{
-		sub(/:/,"",$1)
-		sym[$2]=$1
+	#The last
+	for(i in tag_to_date)
+	{
+		#Put the tag in just after the last commit
+		date = tag_to_date[i] + 1
+		date_to_line[date]="hello"
+		date_to_tag[date]=i
 	}

-	while(!/----------/)
-		getline
+	#Sort commits by date
+	num_dates=asorti(date_to_line, sorted_dates)
+
+	#Iterate through all commits, newest first
+	for(i=num_dates; i > 0; i--)
+	{
+		date = sorted_dates[i]

-	while(1)
-	{
-		getline
-		revision=$2
-		getline
-		date=$2" "$3
-
-		datestamp=date
-		gsub(/[^0-9]+/, " ", datestamp)
-
-		epoch=mktime(datestamp)
-		date = strftime("%a %e %b, %Y %H:%M:%S", epoch)
-
-
-		author = $6
-		sub(/;$/, "", author)
-
-		#Try to build a checkin stamp
-
-		tag=sym[revision]
-
-		#Find the most recent date for the tag (if present)
-		if(tag != "" && alltags[tag] < datestamp)
-			alltags[tag] = datestamp
-
-		text=""
-		#Get text
-		while(getline && !/-----/ && !/======/)
-			text=text (text == "" ? "" : "\n") $0
-
-		#Now we have: filename revision date datestamp author tag text key
-		authors[key] = author
-		revisions[key] = revision
-		tags[key] =  tag
-		texts[key] = text
-		files[key] = filename
-
-		dates[datestamp] = date
-
-		entries[datestamp] = entries[datestamp] " " key
-
-		key++
-
-		if(/========/)
-			break
-	}
-}
-
-
-
-END{
-	#Put tags in to entries
-	for(i in alltags)
-		entries[alltags[i]] = "tag " i
-
-
-	n = asorti(entries, se)
-
-	for(i=n; i >0; i--)
-	{
-		ds = se[i]
-		keylist = entries[ds]
-		nk = split(keylist, keys)
-
-		#Try to concatenate non-atomic commits
-		concat=""
-		nc=1
-		for(;;)
+		if(date in date_to_tag)
 		{
-			ds1 = se[i-1]
-			kl1 = entries[ds1]
-			nk1 = split(kl1, k1)
-			if(authors[keys[1]] == authors[k1[1]] && texts[keys[1]] == texts[k1[1]])
-			{
-				keylist = keylist " " kl1
-				nk = split(keylist, keys)
-				i--
-				concat = concat ", "(ds1 - ds) "s"
-				nc++
-			}
-			else
-				break
-		}
-
-		if(concat != "")
-			concat = "(Concatenated " nc " entries at 0s" concat ")"
-
-
-
-
-		if(keys[1] == "tag")
-		{
-			print "====================================================================="
-			print "Repository tagged as " keys[2]
-			print "====================================================================="
-			print ""
-			print ""
+			print "=========================================="
+			print "Repository tagged as " date_to_tag[date]
+			print "=========================================="
 		}
 		else
 		{
-			print dates[ds] " author: " authors[keys[1]] " " concat
+			line = date_to_line[date]

-			for(j=1; j <= nk; j++)
+			author=line_to_author[line]
+			message=line_to_message[line]
+
+			file_list=line_to_files[line]
+			rev_list=line_to_revision[line]
+
+			print ""
+			#Long commits can get spread over several seconds.
+			#Try to concatenate entries which differ by a few
+			#seconds, but have the same commit messsage and
+			#author
+			#We allow 20 seconds
+			concatenation=""
+			num_concat=0
+			for(j=i-1; j>0 &&
+					   author==line_to_author[date_to_line[sorted_dates[j]]] &&
+					   message==line_to_message[date_to_line[sorted_dates[j]]] &&
+					   date - sorted_dates[j] < 20; j--)
 			{
-				k = keys[j]
-				print "   File: " files[k] " (Rev. " revisions[k] ")"
+				#Reset i, so that the fragment appears once only.
+				i=j
+
+				#Append to the file and revision list
+				file_list=file_list " " line_to_files[date_to_line[sorted_dates[j]]];
+				rev_list=rev_list " " line_to_revision[date_to_line[sorted_dates[j]]];
+
+				#Make a note of teh concatenations
+				concatenation=concatenation ", " date - sorted_dates[j] "s"
+				num_concat++
 			}

-			print ""
-			print texts[keys[1]]
-			print ""
-			print "-----------------------------------"
-			print ""
+			#Create a message based on concatenation
+			if(num_concat)
+				concatenation = " (Concatenated " num_concat+1 " entries at " substr(concatenation, 3) ")"
+
+			#Leader line
+			print strftime("%a %e %b, %Y %H:%M:%S", date/10) " author: " author concatenation
+
+			#List files commit happened on
+			numfiles=split(file_list, files);
+			split(rev_list, revisions);
+
+			for(j=1; j <= numfiles; j++)
+				print "    File: " files[j] " (Rev. " revisions[j] ")"
+
+			#Print the commit message
+			print "\n" message "\n--------------"
 		}
 	}
-
 }


Use color "0" (black) is no session information is found.

git-svn-id: 392d0e5ce652024192c571322d40dcc23d6d83b0@20 8a65f31f-a56f-4bd6-98e8-2755f64920ec

--- awk-scripts/callflow.awk
+++ awk-scripts/callflow.awk
@@ -173,6 +173,8 @@
 		# If over 11 colors, choose black color as default...
 		# TODO: change color behavior
 		if (strtonum(c)>11) {c="0"}
+	 } else {
+		c = 0
 	 }
 	 l1 = sprintf("%s:%s", $2,$3);
 	 l2 = sprintf("%s:%s", $5,$6);


include systm.h in vnode_if.c so that panic is defined when we're doing DEBUG_ALL_VFS_LOCKS.

--- sys/tools/vnode_if.awk
+++ sys/tools/vnode_if.awk
@@ -128,6 +128,7 @@
 if (cfile) {
 	printc(common_head \
 	    "#include <sys/param.h>\n" \
+	    "#include <sys/systm.h>\n" \
 	    "#include <sys/vnode.h>\n" \
 	    "\n" \
 	    "struct vnodeop_desc vop_default_desc = {\n" \


add a usage fx

add a usage fx

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -13,12 +13,15 @@
 #  which may belong to a "structural" ontology as opposed to
 # a data uri.

-#  Perhaps an improvement would be to also
-#  express subject and objects as individual curies (ala predicates)
-#  iff their namespace is also used by a predicate.
-
 #  Post processing to augment predicate identifiers
 #  with their labels seems to improve usefulness.
+
+
+function usage(){
+	print "usage: ntriple2dot.awk curie_map.yaml rdf.nt > rdf.dot"
+}
+
+

 ##########################################################
 # remove first and last chars from input string <>


fix for relation between p tag and other block elem


Remove special processing that BBox fixed

--- getBBoxCatalogFromSitemap.awk
+++ getBBoxCatalogFromSitemap.awk
@@ -246,13 +246,6 @@
         missingEntityIds += 1
         printf ("==> Missing EntityId for %s %s '%s' in show %s at line %d\n", contentType, contentId,
                 title, showContentId, firstLineNum) >> ERRORS
-        # Special processing for tv_episode p07gnw9f in show p07gnpx0 - add missing EntityId
-        if (contentId == "p07gnw9f") {
-            EntityId = "_23842"
-            printf ("==> Added EntityId %s for %s %s '%s' in show %s\n", EntityId, contentType, contentId,
-                    title, showContentId) >> ERRORS
-            # print "==> EntityId = " EntityId > "/dev/stderr"
-        }
     }

     if (contentType == "movie") {


Add totals to bottom line of output

Add totals to bottom line of output

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

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -15,6 +15,8 @@
   }
   b[$1,$2,$3]++
   c[$1,$2,$3,$4]++
+  x[$4]++
+  tt++
 }

 END {
@@ -43,4 +45,9 @@
     }
     printf "\n"
   }
+    printf "Publisher\tContract\tYear\t%d", tt
+    for (j = 0 ; j < sn ; j++) {
+    	printf "\t%d", x[s[j]]
+    }
+
 }


Shortened the parameter list by applying Go syntax (omit duplicated parameter types)

--- jni/scripts/gen_jnienv_go.awk
+++ jni/scripts/gen_jnienv_go.awk
@@ -121,8 +121,13 @@
 	}
 	for (pi = 1; pi <= param_indices[mi]; ++pi) {
 		pt = parameter_types[mi, pi]
+		pt1 = parameter_types[mi, pi + 1]
 		pn = parameter_names[mi, pi]
-		pa[pi] = transform_parameter_name(pn) " " transform_type(pt)
+		if (pt == pt1) {
+			pa[pi] = transform_parameter_name(pn)
+		} else {
+			pa[pi] = transform_parameter_name(pn) " " transform_type(pt)
+		}
 	}
 	return join(pa, ", ", param_indices[mi])
 }


- 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'>" ;


LanguageData: update section J

LanguageData: update section J

--- include/LanguageData.awk
+++ include/LanguageData.awk
@@ -1079,7 +1079,7 @@
     Locale["ikt"]["spoken-in"]         = "the Canadian Arctic"
     Locale["ikt"]["supported-by"]      = "bing"

-    # Inuktitut
+    # Inuktitut (Eastern Canadian Inuktitut)
     Locale["iu"]["name"]               = "Inuktitut"
     Locale["iu"]["endonym"]            = "ᐃᓄᒃᑎᑐᑦ"
     #Locale["iu"]["translations-of"]
@@ -1095,7 +1095,7 @@
     Locale["iu"]["spoken-in"]          = "the Canadian Arctic"
     Locale["iu"]["supported-by"]       = "bing"

-    # Inuktitut, Latin alphabet
+    # Inuktitut (Eastern Canadian Inuktitut), Latin alphabet
     Locale["iu-Latn"]["name"]          = "Inuktitut (Latin)"
     Locale["iu-Latn"]["endonym"]       = "Inuktitut"
     #Locale["iu-Latn"]["translations-of"]
@@ -1145,9 +1145,7 @@
     Locale["it"]["spoken-in"]          = "Italy; Switzerland; San Marino; Vatican City"
     Locale["it"]["supported-by"]       = "google; bing; yandex"

-
-
-    #44 Japanese
+    # Japanese
     Locale["ja"]["name"]               = "Japanese"
     Locale["ja"]["endonym"]            = "日本語"
     Locale["ja"]["translations-of"]    = "「%s」の翻訳"
@@ -1156,12 +1154,15 @@
     Locale["ja"]["examples"]           = "例"
     Locale["ja"]["see-also"]           = "関連項目"
     Locale["ja"]["family"]             = "Japonic"
+    #Locale["ja"]["branch"]
     Locale["ja"]["iso"]                = "jpn"
     Locale["ja"]["glotto"]             = "nucl1643"
     Locale["ja"]["script"]             = "Jpan"
     Locale["ja"]["dictionary"]         = "true" # has dictionary
-
-    #45 Javanese, Latin alphabet
+    Locale["ja"]["spoken-in"]          = "Japan"
+    Locale["ja"]["supported-by"]       = "google; bing; yandex"
+
+    # Javanese, Latin alphabet
     Locale["jv"]["name"]               = "Javanese"
     Locale["jv"]["endonym"]            = "Basa Jawa"
     Locale["jv"]["translations-of"]    = "Terjemahan %s"
@@ -1170,9 +1171,14 @@
     Locale["jv"]["examples"]           = "Conto"
     Locale["jv"]["see-also"]           = "Deleng uga"
     Locale["jv"]["family"]             = "Austronesian"
+    Locale["jv"]["branch"]             = "Malayo-Polynesian"
     Locale["jv"]["iso"]                = "jav"
     Locale["jv"]["glotto"]             = "java1254"
     Locale["jv"]["script"]             = "Latn"
+    Locale["jv"]["spoken-in"]          = "Java, Indonesia"
+    Locale["jv"]["supported-by"]       = "google; yandex"
+
+

     #46 Kannada (Modern Kannada)
     Locale["kn"]["name"]               = "Kannada"


Remove makeDistortosConfiguration.awk script

--- scripts/makeDistortosConfiguration.awk
+++ scripts/makeDistortosConfiguration.awk
@@ -1,62 +0,0 @@
-#!/usr/bin/awk -f
-
-#
-# file: makeDistortosConfiguration.awk
-#
-# author: Copyright (C) 2015 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
-#
-# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
-# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-BEGIN {
-	configPattern = "CONFIG_[A-Za-z0-9_]+"
-	booleanTrueConfigPattern = "^" configPattern "=y$"
-	booleanFalseConfigPattern = "^" configPattern "=n$"
-	notSetConfigPattern = "^# " configPattern " is not set$"
-	numericConfigPattern = "^" configPattern "=(([[:digit:]]+)|(0x[[:xdigit:]]+))$"
-	stringConfigPattern = "^" configPattern "=\"([^\"\\\\]|\\\\.)*\"$"
-
-	print "/**"
-	print " * \\file"
-	print " * \\brief distortos configuration"
-	print " *"
-	print " * \\warning"
-	print " * Automatically generated file - do not edit!"
-	print " *"
-	print " * \\date " strftime("%Y-%m-%d %H:%M:%S")
-	print " */"
-	print ""
-	print "#ifndef INCLUDE_DISTORTOS_DISTORTOSCONFIGURATION_H_"
-	print "#define INCLUDE_DISTORTOS_DISTORTOSCONFIGURATION_H_"
-	print ""
-}
-
-$0 ~ booleanTrueConfigPattern {
-	split($0, array, "=")
-	print "#define " array[1]
-}
-
-$0 ~ booleanFalseConfigPattern {
-	split($0, array, "=")
-	print "#undef " array[1]
-}
-
-$0 ~ notSetConfigPattern {
-	print "#undef " $2
-}
-
-$0 ~ numericConfigPattern {
-	split($0, array, "=")
-	print "#define " array[1] " " array[2]
-}
-
-$0 ~ stringConfigPattern {
-	equalsSign = index($0, "=")
-	print "#define " substr($0, 1, equalsSign - 1) " " substr($0, equalsSign + 1)
-}
-
-END {
-	print ""
-	print "#endif	/* INCLUDE_DISTORTOS_DISTORTOSCONFIGURATION_H_ */"
-}


Fix decimal number regex and change err msg

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -31,7 +31,7 @@
     print "function are_headers_valid(valid_headers) { v=0; split($0, h, \",\"); split(valid_headers, vh, \"|\"); return eql(h, vh); }"
     print "function is_unique(i, val) { if (vals[i,val]) { return 0; } else { vals[i,val] = 1; return 1; } }"
     print "function is_integer(x) { return x ~ /^-?[0-9]+$/ }"
-    print "function is_number(x) { return x ~ /^-?[0-9]+.[0-9]+$/ }"
+    print "function is_number(x) { return x ~ /^-?[0-9]+\.[0-9]+$/ }"
     print "function print_cats(categories) { for (category in categories) { if (categories[category]) print \"      \" category \": \" categories[category]; } }"
     print "function log_err(cat) { cats[cat]++; err_count++; }"
     print RS
@@ -123,8 +123,8 @@
         } else if (type == "number") {
             cat       = "error"
             test      = field " && !is_number(" field ")"
-            mini_msg  = field " should be a number"
-            msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be a number but was \" " field " \" "
+            mini_msg  = field " should be a decimal number"
+            msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be a decimal number but was \" " field " \" "
         }
     } else if (rule_type == "required") {
         req = params[2]


program update

program update

--- cut_files.awk
+++ cut_files.awk
@@ -1,8 +1,9 @@
 #!/bin/awk -f
+#encoding:utf-8
 #
 # Author : Yoshihiro Tanaka
 # Date   : 2014-11-04
-# Version: 0.1.0
+# Version: 0.1.2

 function output(chrom, header, seq) {
     filename = "db/Canis_familiaris.CanFam3.1.dna.chromosome." chrom ".fa";
@@ -12,7 +13,9 @@
     print "Successful output: " filename;
 }
 BEGIN {
-    c = 0
+    "wc -l " ARGV[1] " | xargs -n 1 | head -n 1" | getline wc;
+    wc = wc ".0"
+    c  = 0
 }
 {
     if (">" == substr($1, 1, 1)) {
@@ -27,7 +30,8 @@
     } else {
         seq = seq "\n" $0
     }
-    c++
+    c++;
+    printf("progress: %f%%\r\b", (c / wc)*100)
 }
 END {
     output(chrom, header, seq)


speed improvements, reducing use of for loops

--- csvquote.awk
+++ csvquote.awk
@@ -5,7 +5,7 @@

 BEGIN {
     # read one line at a time
-    FS="";
+    FS="\033"; # not used!
     OFS=FS;
     delimiter=",";
     recordsep="\n";
@@ -13,21 +13,13 @@
     delimiter_code="\035";
     recordsep_code="\034";
     replace_mode = 1; # true. if restore mode then 0
-    # existing_state is a global variable
-    existing_state[1] = 0; # false
-    existing_state[2] = 0; # false
-    existing_state[3] = ""; # empty buffer
+    # these are volatile global variables
+    quote_in_effect = 0; # false
+    maybe_escaped_quote_char = 0; # false
+    writebuf = "";
 }

 function replace_special_chars(c) {
-    # existing_state is a global variable. it could be passed in as an array
-    # (pass-by-ref) but we still need to persist its state from one input
-    # line to the next and it needs to be altered by this function, so
-    # can't be simple variables
-    quote_in_effect = existing_state[1];
-    maybe_escaped_quote_char = existing_state[2];
-    writebuf = existing_state[3];
-
     if (maybe_escaped_quote_char) {
         if (c != quotechar) {
             # this is the end of a quoted field
@@ -55,45 +47,42 @@
             quote_in_effect = 1; # true
         }
     }
-
-    existing_state[1] = quote_in_effect;
-    existing_state[2] = maybe_escaped_quote_char;
-    existing_state[3] = writebuf;
-}
-
-function restore_special_chars(c) {
-    writebuf = existing_state[3];
-    if (c == delimiter_code) {
-        writebuf = writebuf delimiter; # concat
-    } else if (c == recordsep_code) {
-        writebuf = writebuf recordsep; # concat
-    } else {
-        writebuf = writebuf c; # concat
-    }
-    existing_state[3] = writebuf;
 }

 (replace_mode) {
     # do this for every input line
-    for (i=1;i<=NF;i++) {
-        replace_special_chars($i);
+    fastrack = 0; # speed optimization
+    if (!(quote_in_effect)) {
+        quoteposition = index($0, quotechar); # index() is faster than our for loop
+        if (quoteposition == 0) {
+            # we don't need to scan this line. there are no quote characters in it
+            fastrack = 1;
+        }
     }
-    printf("%s", existing_state[3]);
-    existing_state[3] = "";
-    replace_special_chars(RS);
+    if (fastrack) {
+        print writebuf $0;
+        writebuf = "";
+    } else {
+        # otherwise we scan the line for quote characters
+        numchars = length($0);
+        for (i=1;i<=numchars;i++) {
+            replace_special_chars(substr($0,i,1));
+        }
+        printf("%s", writebuf);
+        writebuf = "";
+        replace_special_chars(RS);
+    }
 }

 (!replace_mode) {
     # restore the original special characters
     # do this for every input line
-    for (i=1;i<=NF;i++) {
-        restore_special_chars($i);
-    }
-    printf("%s", existing_state[3]);
-    existing_state[3] = "";
-    restore_special_chars(RS);
+    writebuf = $0;
+    sub(/\035/, delimiter, writebuf); # Beware ! delimitercode repeated
+    sub(/\034/, recordsep, writebuf); # Beware ! recordsepcode repeated
+    print writebuf;
 }

 END {
-    printf("%s", existing_state[3]); #flush
+    printf("%s", writebuf); #flush
 }


Languages: mark as stable: Shona

Languages: mark as stable: Shona

--- include/Languages.awk
+++ include/Languages.awk
@@ -317,15 +317,14 @@
     Locale["gd"]["glotto"]             = "scot1245"
     Locale["gd"]["script"]             = "Latn"

-    #? Shona
-    Locale["sn"]["support"]            = "unstable"
+    # Shona
     Locale["sn"]["name"]               = "Shona"
     Locale["sn"]["endonym"]            = "chiShona"
-    #Locale["sn"]["translations-of"]
-    #Locale["sn"]["definitions-of"]
-    #Locale["sn"]["synonyms"]
-    #Locale["sn"]["examples"]
-    #Locale["sn"]["see-also"]
+    Locale["sn"]["translations-of"]    = "Shanduro dze %s"
+    Locale["sn"]["definitions-of"]     = "Zvinoreva %s"
+    Locale["sn"]["synonyms"]           = "Mashoko anoreva zvakafana nemamwe"
+    Locale["sn"]["examples"]           = "Mienzaniso"
+    Locale["sn"]["see-also"]           = "Onawo"
     Locale["sn"]["family"]             = "Atlantic-Congo"
     Locale["sn"]["iso"]                = "sna"
     Locale["sn"]["glotto"]             = "core1255"


Make print-results.awk compatible with mawk

--- ok/bin/print-results.awk
+++ ok/bin/print-results.awk
@@ -38,8 +38,14 @@
 	system("") # Flush output buffer
 }

+function arrlen(arr,   elem, n) {
+	n = 0
+	for (elem in arr) n++
+	return n
+}
+
 function print_table(msg, table, text, first) {
-	if (length(table)) {
+	if (arrlen(table)) {
 		first = 1
 		for (id in table) {
 			print_test(msg, id, text, first)
@@ -117,7 +123,7 @@
 	} else if (fail) {
 		# Test failed
 		failed[id] = 1
-		print_test(failcol("FAILED"), id, message, length(failed) == 1)
+		print_test(failcol("FAILED"), id, message, arrlen(failed) == 1)
 	} else {
 		passed[id] = 1
 	}
@@ -140,7 +146,7 @@
 	for (id in planned) {
 		if (id in passed || id in skipped || id in failed) continue;
 		failed[id] = 1
-		print_test(failcol("FAILED"), id, message, length(failed) == 1)
+		print_test(failcol("FAILED"), id, message, arrlen(failed) == 1)
 	}

 	# Check for tests that aren't part of any plan
@@ -149,17 +155,17 @@
 	}

 	# Print test summary (finish failed tests)
-	no_plan = length(planned) == 0 && !skip_all
-	nfail = length(failed)
-	npass = length(passed) + length(skipped)
+	no_plan = arrlen(planned) == 0 && !skip_all
+	nfail = arrlen(failed)
+	npass = arrlen(passed) + arrlen(skipped)
 	n = npass + nfail
 	if (n > 0) {
 		if (nfail) {
 			printf (verbose ? "\n\t" : " ")
 		} else {
-			if (length(done) || length(repeat) || length(noplan)) {
+			if (arrlen(done) || arrlen(repeat) || arrlen(noplan)) {
 				printf warncol("OK")
-			} else if (length (skipped)) {
+			} else if (arrlen(skipped)) {
 				printf noticecol("OK")
 			} else {
 				printf okcol("OK")


Add "in numSeasons seasons" to info about shows

--- verifyBBoxDownloadsFrom-webscraper.awk
+++ verifyBBoxDownloadsFrom-webscraper.awk
@@ -14,40 +14,48 @@

 /\/us\// {
     programURL = $1
-    nflds = split (programURL,fld,"/")
-    showType = fld[3]
-    showType == "show" ? spacer = "  " : spacer = " "
-    # Must have single quotes to handle special charaters in targets
-    target = sprintf ("'%s'",fld[nflds])
-    unquotedTarget = substr(target,2,length(target)-2)
-    #
-    cmd = "grep -c " target " " EPISODES_SORTED_FILE
-    if ((cmd | getline NumEpisodes) > 0) {
-        NumEpisodes == 1 ? epiStr = " episode" : epiStr = " episodes"
-        print "==> " showType spacer target " has " NumEpisodes epiStr
+    numSeasons = $4
+
+    seaStr = ""
+    if (numSeasons != "null") {
+        sub (/ Seasons?/,"",numSeasons)
+        numSeasons == 1 ? seaStr = " in 1 season" : seaStr = " in " numSeasons " seasons"
     }
-    close (cmd)
-    if (NumEpisodes == 0) {
-        badEpisodes += 1
-        print "    " unquotedTarget >> TEMP_FILE
+
+nflds = split (programURL,fld,"/")
+showType = fld[3]
+showType == "show" ? spacer = "  " : spacer = " "
+# Must have single quotes to handle special charaters in targets
+target = sprintf ("'%s'",fld[nflds])
+unquotedTarget = substr(target,2,length(target)-2)
+#
+cmd = "grep -c " target " " EPISODES_SORTED_FILE
+if ((cmd | getline numEpisodes) > 0) {
+    numEpisodes == 1 ? epiStr = " episode" : epiStr = " episodes"
+    print "==> " showType spacer target " has " numEpisodes epiStr seaStr
+}
+close (cmd)
+if (numEpisodes == 0) {
+    badEpisodes += 1
+    print "    " unquotedTarget >> TEMP_FILE
+}
+#
+cmd = "grep " target " " SEASONS_SORTED_FILE
+while ((cmd | getline seasonLine) > 0) {
+    nfields = split (seasonLine, fields, "\t")
+    seasonField = fields[nfields-4]
+    episodeField = fields[nfields-2]
+    if (seasonField == "") {
+        print "==> " target " (blank Seasons field in " SEASONS_SORTED_FILE ")" \
+            > "/dev/stderr"
+        print "    " unquotedTarget " (blank Seasons field in " SEASONS_SORTED_FILE ")" \
+            >> TEMP_FILE
+        continue
     }
-    #
-    cmd = "grep " target " " SEASONS_SORTED_FILE
-    while ((cmd | getline seasonLine) > 0) {
-        nfields = split (seasonLine, fields, "\t")
-        seasonField = fields[nfields-4]
-        episodeField = fields[nfields-2]
-        if (seasonField == "") {
-            print "==> " target " (blank Seasons field in " SEASONS_SORTED_FILE ")" \
-                > "/dev/stderr"
-            print "    " unquotedTarget " (blank Seasons field in " SEASONS_SORTED_FILE ")" \
-                >> TEMP_FILE
-            continue
-        }
-        print "          " target " " seasonField " has " episodeField
+    print "          " target " " seasonField " has " episodeField

-    }
-    close (cmd)
+}
+close (cmd)
 }

 END {


build.awk: update

build.awk: update

--- build.awk
+++ build.awk
@@ -233,7 +233,7 @@
     return 0
 }

-function release() {
+function release(    content, group, sha1, size, temp, text) {
     ("sha1sum " Trans) | getline temp
     split(temp, group)
     sha1 = group[1]


taking care of two hads

taking care of two hads

--- src/awk/checkdouble.awk
+++ src/awk/checkdouble.awk
@@ -11,10 +11,10 @@
   prevfile = FILENAME
 }
 NF > 0{
-  if ($1 == lastword)
+  if ($1 == lastword && $1 != "had")
      printf "double %s, file %s, line %d\n", $1, FILENAME, NR
   for (i=2; i <= NF; i++)
-      if ($i == $(i-1))
+      if ($i == $(i-1) && $i != "had")
          printf "double %s, file %s, line %d\n", $i, FILENAME, NR
   if (NF > 0){
      lastword = $NF


Make season number match that in the URL

Created shortSeasonURL

--- getAcornFrom-showPages.awk
+++ getAcornFrom-showPages.awk
@@ -48,14 +48,16 @@
     if (episodeLinesFound == 1) {
         showEpisodes = fld[4]
         if (showEpisodes == "") {
-            printf ("==> Blank showEpisodes in numberOfEpisodes: %s\t%s\n", shortURL, showTitle) >> ERRORS
+            printf ("==> Blank showEpisodes in numberOfEpisodes: %s\t%s\n", shortURL,
+                    showTitle) >> ERRORS
         }
         # print "==> showEpisodes = " showEpisodes " " shortURL > "/dev/stderr"
     }
     if (episodeLinesFound != 1) {
         seasonEpisodes = seasonEpisodes "+" fld[4]
         if (seasonEpisodes == "") {
-            printf ("==> Blank seasonEpisodes in numberOfEpisodes: %s\t%s\n", shortURL, showTitle) >> ERRORS
+            printf ("==> Blank seasonEpisodes in numberOfEpisodes: %s\t%s\n", shortURL,
+                    showTitle) >> ERRORS
         }
         # print "==> seasonEpisodes = " seasonEpisodes " " shortURL > "/dev/stderr"
     }
@@ -114,10 +116,13 @@
 /<a itemprop="url"/ {
     split ($0,fld,"\"")
     episodeURL = fld[4]
+    sub (/\/$/,"",episodeURL)
     # print "==> episodeURL = " episodeURL > "/dev/stderr"
     print episodeURL >> EPISODE_URLS
     shortEpisodeURL = episodeURL
     sub (/.*acorn\.tv/,"acorn.tv",shortEpisodeURL)
+    split (episodeURL, part, "/")
+    shortSeasonURL = "acorn.tv/" part[4] "/" part[5]
     next
 }

@@ -180,15 +185,36 @@
     if (episodeURL ~ \
         /\/cryptoftears\/bonus\/|\/newworlds\/bonus\/|\/newtonslaw\/bonus\// \
         && seasonNumber != 1) {
-            printf ("==> Changed S%02d to S01: %s\n", seasonNumber, shortEpisodeURL) >> ERRORS
+            printf ("==> Changed S%02d to S01: %s\n", seasonNumber, shortSeasonURL) >> ERRORS
         seasonNumber = 1
     }
     # Plain christmasspecial, seriesfinale don't increment seasonNumber
     if (episodeURL ~ /\/christmasspecial\/|\/seriesfinale\//) {
         printf ("==> Changed S%02d to S%02d: %s\n", seasonNumber, seasonNumber-1,
-                shortEpisodeURL) >> ERRORS
+                shortSeasonURL) >> ERRORS
         seasonNumber -= 1
     }
+    #
+    # The season number should match that in the URL
+    # Birds of a Feather, Doc Martin, Murdoch, Poirot, Rebus, Vera, and others have problems
+    if (episodeURL ~ \
+           /\/series[0-9]{1,2}\/|[0-9]{1,2}bonus\/|\/murdoch\/season[0-9]{1,2}/) {
+        split (episodeURL, part, "/")
+        URLseasonNumber = part[5]
+        sub (/bonus/,"",URLseasonNumber)
+        # Foyle's War has sets: foyleswar/series9set8bonus/
+        sub (/set[0-9]/,"",URLseasonNumber)
+        # Midsomer Murders has two parts: midsomermurders/series19parttwo/
+        sub (/parttwo/,"",URLseasonNumber)
+        sub (/christmasspecial/,"",URLseasonNumber)
+        sub (/[[:alpha:]]*/,"",URLseasonNumber)
+        if (URLseasonNumber != seasonNumber) {
+            printf ("==> Changed S%02d to S%02d: %s\n", seasonNumber, URLseasonNumber,
+                    shortSeasonURL) >> ERRORS
+            seasonNumber = URLseasonNumber
+        }
+    }
+    #
     # Wrap up this episode
     # =HYPERLINK("https://acorn.tv/1900island/series1/week-one";"1900 Island, S01E01, Week One")
     episodeLink = sprintf ("=HYPERLINK(\"%s\";\"%s, %s%02d%s%02d, %s\"\)", episodeURL, showTitle,
@@ -197,7 +223,10 @@
     # =HYPERLINK("https://acorn.tv/1900island/series1/week-one";"1900 Island, S01E01, Week One") \
     # \t\t\t 00:59:17 \t As they arrive
         printf ("%s\t\t\t%s\t%s\n", episodeLink, episodeDuration, episodeDescription) >> LONG_SPREADSHEET
+    # Make sure there is no carryover
     episodeURL = ""
+    shortEpisodeURL = ""
+    shortSeasonURL = ""
     episodeType = ""
     episodeTitle = ""
     episodeNumber = ""


Account for two spaces in MHz header

Account for two spaces in MHz header

Two spaces in "|  TV" caused header to be skipped and included it in the description instead

--- getMHzFrom-seriesPages.awk
+++ getMHzFrom-seriesPages.awk
@@ -62,11 +62,11 @@
         sub (/.*name="description" content="/,"")
     }
     # If we find a header, clean it up and print it
-    if ($0 ~ /\| TV/) {
+    if ($0 ~ /\| {1,2}TV/) {
         sub (/WITH ENGLISH SUBTITLES /,"")
         sub (/SCANDINAVIAN CRIME FICTION/,"Sweden")
         sub (/NONFICTION - DOCUMENTARY/,"Documentary")
-        gsub (/ \| /,"|")
+        gsub (/ \| {1,2}/,"|")
         sub (/\r/,"")
         # Split out header fields
         numFields = split ($0,fld,"\|")


Allow KMOD with hypens and dots.

Allow KMOD with hypens and dots.

MFC after:	1 week

--- sys/tools/fw_stub.awk
+++ sys/tools/fw_stub.awk
@@ -118,6 +118,8 @@

 cfilename = opt_c;
 ctmpfilename = cfilename ".tmp";
+modname = opt_m;
+gsub(/[-\.]/, "_", modname);

 printc("#include <sys/param.h>\
 #include <sys/errno.h>\
@@ -139,7 +141,7 @@
 }

 printc("\nstatic int\n"\
-opt_m "_fw_modevent(module_t mod, int type, void *unused)\
+modname "_fw_modevent(module_t mod, int type, void *unused)\
 {\
 	const struct firmware *fp, *parent;\
 	int error;\
@@ -206,14 +208,14 @@
 	return (EINVAL);\
 }\
 \
-static moduledata_t " opt_m "_fw_mod = {\
-        \"" opt_m "_fw\",\
-        " opt_m "_fw_modevent,\
+static moduledata_t " modname "_fw_mod = {\
+        \"" modname "_fw\",\
+        " modname "_fw_modevent,\
         0\
 };\
-DECLARE_MODULE(" opt_m "_fw, " opt_m "_fw_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\
-MODULE_VERSION(" opt_m "_fw, 1);\
-MODULE_DEPEND(" opt_m "_fw, firmware, 1, 1, 1);\
+DECLARE_MODULE(" modname "_fw, " modname "_fw_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\
+MODULE_VERSION(" modname "_fw, 1);\
+MODULE_DEPEND(" modname "_fw, firmware, 1, 1, 1);\
 ");

 if (opt_c)


minor improvements for 4.19 and 5.3 kernel

- add build salt to file if available
- put KBUILD_MODNAME in name info section
- skip symbols named 'gpl' and 'strings' that appear everywhere
- generate proper EXPORT_SYMBOL strings for unused symbols

--- scripts/modpost.awk
+++ scripts/modpost.awk
@@ -586,6 +586,7 @@
 }
 function set_symbol(sym, mod, crc, expt, set, pos, own, src, use, from)
 {
+    if (sym ~ /^(gpl|strings)$/) { return }
     if (!(sym in syms)) {
 	syms[sym] = 1
 	cache_dirty = 1
@@ -771,7 +772,7 @@
 }
 function read_modobject(command, dir, own, src,
 			pfx,fmt,files,progress,SECTION,string,mod,count_syms,count_unds,
-			count_weak,count_vers,flags,val,sec,offset,sym,crc,char)
+			count_weak,count_vers,flags,val,sec,offset,sym,crc,char,unused)
 {
     pfx = "r: ko object, "
     fmt = "%3d syms, %3d unds, %3d weak, %3d vers"
@@ -809,9 +810,10 @@
 			}
 			if (sub(/^_?_?__ksymtab/,"",sec)) {
 			    sub(/\+.*/,"",sec)
+			    if (sub(/^_unused/,"",sec)) { unused = "UNUSED_" } else { unused = "" }
 			    if (sub(/^_?__ksymtab_/,"",sym)) {
 				print_debug(3,pfx "symbol: " sym)
-				set_symbol(sym, mod, "", "EXPORT_SYMBOL" toupper(sec), "", 0, own, "", 0, "ko object")
+				set_symbol(sym, mod, "", "EXPORT_" unused "SYMBOL" toupper(sec), "", 0, own, "", 0, "ko object")
 				count_syms++
 			    }
 			    continue
@@ -823,9 +825,10 @@
 		    if (substr(flags,7,1) == "O" || !values["modversions"]) {
 			if (sub(/^_?_?__ksymtab/,"",sec)) {
 			    sub(/\+.*/,"",sec)
+			    if (sub(/^_unused/,"",sec)) { unused = "UNUSED_" } else { unused = "" }
 			    if (sub(/^_?__ksymtab_/,"",sym)) {
 				print_debug(3,pfx "symbol: " sym)
-				set_symbol(sym, mod, "", "EXPORT_SYMBOL" toupper(sec), "", 0, own, "", 0, "ko object")
+				set_symbol(sym, mod, "", "EXPORT_" unused "SYMBOL" toupper(sec), "", 0, own, "", 0, "ko object")
 				count_syms++
 			    }
 			    continue
@@ -1693,9 +1696,16 @@
 function write_header(file, mod, base)
 {
     print "\
+#ifdef HAVE_KINC_LINUX_BUILD_SALT_H\n\
+#include <linux/build-salt.h>\n\
+#endif\n\
 #include <linux/module.h>\n\
 #include <linux/vermagic.h>\n\
 #include <linux/compiler.h>\n\
+\n\
+#ifdef HAVE_KINC_LINUX_BUILD_SALT_H\n\
+BUILD_SALT;\n\
+#endif\n\
 \n\
 MODULE_INFO(vermagic, VERMAGIC_STRING);\n\
 #ifdef CONFIG_SUSE_KERNEL\n\
@@ -1722,6 +1732,7 @@
 #define KBUILD_MODNAME " base "\n\
 \n\
 #ifdef KBUILD_MODNAME\n\
+MODULE_INFO(name, KBUILD_MODNAME);\n\
 struct module __this_module\n\
 __attribute__((section(\".gnu.linkonce.this_module\"))) = {\n\
 	.name = __stringify(KBUILD_MODNAME),\


Allow empty titles

Allow empty titles

Useful to order sections without have a title.


Fix number/int check to be more accurate

see: https://trello.com/c/t9k52j93/517-as-a-developer-i-will-ensure-integers-do-not-allow-decimals-during-import-this-will-ensure-that-decimals-do-not-cause-issue-load

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -30,7 +30,8 @@
     print "function eql(x,y) {v=1; for (i in x) v=(v&&x[i]==y[i]); return v;}"
     print "function are_headers_valid(valid_headers) { v=0; split($0, h, \",\"); split(valid_headers, vh, \"|\"); return eql(h, vh); }"
     print "function is_unique(i, val) { if (vals[i,val]) { return 0; } else { vals[i,val] = 1; return 1; } }"
-    print "function is_numeric(x){ return(x==x+0) }"
+    print "function is_integer(x) { return x ~ /^[0-9]+$/ }"
+    print "function is_number(x) { return x ~ /^[0-9]+.[0-9]+$/ }"
     print "function print_cats(categories) { for (category in categories) { if (categories[category]) print \"      \" category \": \" categories[category]; } }"
     print "function log_err(cat) { cats[cat]++; err_count++; }"
     print RS
@@ -114,13 +115,17 @@
     if (rule_type == "type") {
         type = params[2]

-        if (type ~ /^integer|number$/) {
+        if (type == "integer") {
             cat       = "error"
-            test      = field " && !is_numeric(" field ")"
-            mini_msg  = field " should be numeric but was a string"
-            msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be a numeric but was \" " field " \" "
-        }
-
+            test      = field " && !is_integer(" field ")"
+            mini_msg  = field " should be an integer"
+            msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be an integer but was \" " field " \" "
+        } else if (type == "number") {
+            cat       = "error"
+            test      = field " && !is_number(" field ")"
+            mini_msg  = field " should be a number"
+            msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be a number but was \" " field " \" "
+        }
     } else if (rule_type == "required") {
         req = params[2]


feature: Add new prefixes: feature, refactor and update

--- changelog.awk
+++ changelog.awk
@@ -3,7 +3,7 @@
 	# Determines whether to print 'Unreleased' banner at top
 	UNRELEASED_COMMITS = 1
 	# Prefixes that determine whether a commit will be printed
-	CHANGELOG_REGEX = "^(changelog|fix|docs|chore|feat): "
+	CHANGELOG_REGEX = "^(changelog|fix|docs|chore|feat|feature|refactor|update): "
 	FS="|"
 	while ("git log --pretty='%D|%s|%H'" | getline) {
 		IS_GIT_TAG = length($1) && match($1, /tag:/)


Clarified duration file output

Clarified duration file output

--- calculateMHzDurations.awk
+++ calculateMHzDurations.awk
@@ -10,7 +10,7 @@
 #  him disappears the same day. Directed by Alberto Sironi, 1999.
 #
 # OUTPUT:
-#       $DURATION_FILE
+#       $DURATION_FILE with one total duration of a series per line

 # Extract the duration
 BEGIN {


r5301/sofa-dev : FIX: make filter-qmake-pro.awk script more robust

--- scripts/filter-qmake-pro.awk
+++ scripts/filter-qmake-pro.awk
@@ -9,13 +9,42 @@
 # init
 BEGIN {
     infilelist=0;
+    blk_before=0;
+    blk_after=0;
+    blk_dev=0;
+}
+
+{ blk_before=blk_after; }
+
+/[{}]/ {
+  split($0,a,"#")
+  if (a[1]!="") {
+    split(a[1],beg,"{")
+    split(a[1],end,"}")
+    blk_after = blk_before + length(beg) - length(end)
+  }
+}
+
+END {
+    if (blk_after != 0) print "# ERROR: unmatched brackets"
 }

 # Match blocks conditionnally included depending on the SOFA_DEV flag
+# Note that we now count the brackets in the source file to find the
+# SOFA_DEV closing one instead of relying on the presence of a comment

-/contains[ \t]*\([ \t]*DEFINES[ \t]*,[ \t]*SOFA_DEV[ \t]*\)[ \t]*{/,/[ \t]*}.*SOFA_DEV/ {
-#    for(f=1;f<=NF && !(f==NF && $f~/\\[:space:]*/);f++)
-#        print f " -> \"" $f "\""
+blk_dev==0 && /contains[ \t]*\([ \t]*DEFINES[ \t]*,[ \t]*SOFA_DEV[ \t]*\)[ \t]*{/ {
+    blk_dev=blk_after;
+    infilelist=0;
+}
+
+blk_dev>0 && blk_after < blk_dev {
+    blk_dev=0;
+    next;
+}
+
+# /contains[ \t]*\([ \t]*DEFINES[ \t]*,[ \t]*SOFA_DEV[ \t]*\)[ \t]*{/,/[ \t]*}.*SOFA_DEV/ {
+blk_dev>0 {
     # look for a filename
     # we assume files and directories are listed inside variables containing SUBDIRS, SOURCES or HEADERS
     f0=1;
@@ -27,12 +56,13 @@
 	}
     }
     if (infilelist) {
-	for(f=f0;f<=NF && !(f==NF && $f~/\\[:space:]*/);f++) {
+	for(f=f0;f<=NF && !(f==NF && $f~/^[:space:]*\\[:space:]*$/);f++) {
 	    fname=$f
 	    gsub(/[\r\n]/,"",fname);
+	    gsub(/\\[:space:]*$/,"",fname);
 	    if (fname != "#") print fname > "/dev/stderr";
 	}
-	if (f>NF) { # no "\\" is put at the end of the line -> end of list
+	if (f>NF && (NF==0 || $NF!~/\\[:space:]*$/)) { # no "\\" is put at the end of the line -> end of list
 #	    print "end"
 	    infilelist=0;
 	}
@@ -44,4 +74,5 @@
 /SOFA_DEV/ { next; }

 # other: simply print the line
-{ print; }
+#{ print blk_before "<" $0 ">" blk_after; }
+{ print }


wireless: fix comments in genregdb.awk

wireless: fix comments in genregdb.awk

Apparently some awk versions choke on C-style comments -- who knew? :-)

Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/wireless/genregdb.awk
+++ net/wireless/genregdb.awk
@@ -26,11 +26,11 @@
 }

 /^[ \t]*#/ {
-	/* Ignore */
+	# Ignore
 }

 !active && /^[ \t]*$/ {
-	/* Ignore */
+	# Ignore
 }

 !active && /country/ {


Debug msg for restart parameters.

Debug msg for restart parameters.

--- fzn/fzn2py.awk
+++ fzn/fzn2py.awk
@@ -273,7 +273,7 @@
 	print "    solver.setThreadCount(param['threads'])";
 	print "if param['solver'] == 'Mistral':";
 	print "    # LUBY, GEOMETRIC = 0, 1"
-	print "    # print 'running %d %d %.1f' % (param['restart'], param['base'], param['factor'])";
+	print "    print '%% running Mistral with restarts: %d %d %.1f' % (param['restart'], param['base'], param['factor'])";
 	#print "    solver.solveAndRestart(GEOMETRIC, 256, 1.3)";
 	print "    solver.solveAndRestart(param['restart'], param['base'], param['factor'])";
 	print "else:";


cleaning up header2params2.awk; relics from header2params.awk

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -100,7 +100,7 @@
    if(length(conversionID))         printf("      conversion:enhancement_identifier \"%s\";\n",conversionID);
    if(length(subjectDiscriminator)) printf("      conversion:subject_discriminator  \"%s\";\n",subjectDiscriminator);
                                      print
-   if(length(person_uri)&&length(machine_uri)&&length(whoami)) {
+   if(length(person_uri)&&length(machine_uri)&&length(whoami)) { # NOTE: implemented in bin/util/user-account-cite.sh, too.
                                     printf("      dcterms:creator <%s%s>;\n",machine_uri,whoami);
    }else if(length(machine_uri) && length(whoami)) {
                                     printf("      dcterms:creator <%s%s>;\n",machine_uri,whoami); # TODO: same as above.
@@ -140,12 +140,9 @@
    }
    } # END if(showConversionProcess > 0)
 }
-#NR == 1 && length(conversionID) {
-length(conversionID) {
-#   for(i=1;i<=NF;i++) {
-#     label=$i;
+
+length(conversionID) { #NR == 1 && length(conversionID) {
       label=$0;
-#     gsub(/"/,"",label);
       (length(label)>0) ? sprintf("\n         ov:csvHeader      \"%s\";",label) : "";
       print "      conversion:enhance ["
       printf("         ov:csvCol         %s;\n",NR)
@@ -164,6 +161,7 @@
       print "      ];"
    #}
 }
+
 END {
    if (showConversionProcess > 0) print "   ];"
    printf(".");


Languages: update section D

Languages: update section D

--- include/LanguageData.awk
+++ include/LanguageData.awk
@@ -462,9 +462,7 @@
     Locale["cs"]["spoken-in"]          = "Czechia"
     Locale["cs"]["supported-by"]       = "google; bing; yandex"

-
-
-    #19 Danish
+    # Danish
     Locale["da"]["name"]               = "Danish"
     Locale["da"]["endonym"]            = "Dansk"
     Locale["da"]["translations-of"]    = "Oversættelser af %s"
@@ -473,13 +471,34 @@
     Locale["da"]["examples"]           = "Eksempler"
     Locale["da"]["see-also"]           = "Se også"
     Locale["da"]["family"]             = "Indo-European"
+    Locale["da"]["branch"]             = "North Germanic"
     Locale["da"]["iso"]                = "dan"
     Locale["da"]["glotto"]             = "dani1285"
     Locale["da"]["script"]             = "Latn"
+    Locale["da"]["spoken-in"]          = "Denmark; Greenland; the Faroe Islands; the northern German region of Southern Schleswig"
+    Locale["da"]["supported-by"]       = "google; bing; yandex"
+
+    # Dari (Dari Persian)
+    Locale["prs"]["name"]              = "Dari"
+    Locale["prs"]["endonym"]           = "دری"
+    #Locale["prs"]["translations-of"]
+    #Locale["prs"]["definitions-of"]
+    #Locale["prs"]["synonyms"]
+    #Locale["prs"]["examples"]
+    #Locale["prs"]["see-also"]
+    Locale["prs"]["family"]            = "Indo-European"
+    Locale["prs"]["branch"]            = "Iranian"
+    Locale["prs"]["iso"]               = "prs"
+    Locale["prs"]["glotto"]            = "dari1249"
+    Locale["prs"]["script"]            = "Arab"
+    Locale["prs"]["rtl"]               = "true" # RTL language
+    Locale["prs"]["spoken-in"]         = "Afghanistan; Iran"
+    Locale["prs"]["supported-by"]      = "bing"

     # Dhivehi
     Locale["dv"]["name"]               = "Dhivehi"
     Locale["dv"]["name2"]              = "Divehi"
+    Locale["dv"]["name3"]              = "Maldivian"
     Locale["dv"]["endonym"]            = "ދިވެހި"
     #Locale["dv"]["translations-of"]
     #Locale["dv"]["definitions-of"]
@@ -487,10 +506,13 @@
     #Locale["dv"]["examples"]
     #Locale["dv"]["see-also"]
     Locale["dv"]["family"]             = "Indo-European"
+    Locale["dv"]["branch"]             = "Indo-Aryan"
     Locale["dv"]["iso"]                = "div"
     Locale["dv"]["glotto"]             = "dhiv1236"
     Locale["dv"]["script"]             = "Thaa"
     Locale["dv"]["rtl"]                = "true" # RTL language
+    Locale["dv"]["spoken-in"]          = "the Maldives"
+    Locale["dv"]["supported-by"]       = "google; bing"

     # Dogri
     Locale["doi"]["name"]              = "Dogri"
@@ -501,11 +523,14 @@
     #Locale["doi"]["examples"]
     #Locale["doi"]["see-also"]
     Locale["doi"]["family"]            = "Indo-European"
+    Locale["doi"]["branch"]            = "Indo-Aryan"
     Locale["doi"]["iso"]               = "doi"
     Locale["doi"]["glotto"]            = "indo1311"
     Locale["doi"]["script"]            = "Deva"
-
-    #20 Dutch
+    Locale["doi"]["spoken-in"]         = "the Jammu region in northern India"
+    Locale["doi"]["supported-by"]      = "google"
+
+    # Dutch
     Locale["nl"]["name"]               = "Dutch"
     Locale["nl"]["endonym"]            = "Nederlands"
     Locale["nl"]["translations-of"]    = "Vertalingen van %s"
@@ -514,10 +539,31 @@
     Locale["nl"]["examples"]           = "Voorbeelden"
     Locale["nl"]["see-also"]           = "Zie ook"
     Locale["nl"]["family"]             = "Indo-European"
+    Locale["nl"]["branch"]             = "West Germanic"
     Locale["nl"]["iso"]                = "nld"
     Locale["nl"]["glotto"]             = "dutc1256"
     Locale["nl"]["script"]             = "Latn"
     Locale["nl"]["dictionary"]         = "true" # has dictionary
+    Locale["nl"]["spoken-in"]          = "the Netherlands; Belgium; Suriname; Aruba; Curaçao; Sint Maarten; the Caribbean Netherlands"
+    Locale["nl"]["supported-by"]       = "google; bing; yandex"
+
+    # Dzongkha
+    Locale["dz"]["name"]               = "Dzongkha"
+    Locale["dz"]["endonym"]            = "རྫོང་ཁ"
+    #Locale["dz"]["translations-of"]
+    #Locale["dz"]["definitions-of"]
+    #Locale["dz"]["synonyms"]
+    #Locale["dz"]["examples"]
+    #Locale["dz"]["see-also"]
+    Locale["dz"]["family"]             = "Sino-Tibetan"
+    Locale["dz"]["branch"]             = "Tibetic"
+    Locale["dz"]["iso"]                = "dzo"
+    Locale["dz"]["glotto"]             = "nucl1307"
+    Locale["dz"]["script"]             = "Tibt"
+    Locale["dz"]["spoken-in"]          = "Bhutan"
+    Locale["dz"]["supported-by"]       = ""
+
+

     #21 English (Standard English)
     Locale["en"]["name"]               = "English"
@@ -1949,16 +1995,6 @@
     Locale["zu"]["glotto"]             = "zulu1248"
     Locale["zu"]["script"]             = "Latn"

-    #* Dari (Dari Persian)
-    Locale["prs"]["support"]           = "bing-only"
-    Locale["prs"]["name"]              = "Dari"
-    Locale["prs"]["endonym"]           = "دری"
-    Locale["prs"]["family"]            = "Indo-European"
-    Locale["prs"]["iso"]               = "prs"
-    Locale["prs"]["glotto"]            = "dari1249"
-    Locale["prs"]["script"]            = "Arab"
-    Locale["prs"]["rtl"]               = "true" # RTL language
-
     #* Fijian
     Locale["fj"]["support"]            = "bing-only"
     Locale["fj"]["name"]               = "Fijian"
@@ -2058,20 +2094,6 @@
     Locale["br"]["iso"]                = "bre"
     Locale["br"]["glotto"]             = "bret1244"
     Locale["br"]["script"]             = "Latn"
-
-    #? Dzongkha
-    Locale["dz"]["support"]            = "unstable"
-    Locale["dz"]["name"]               = "Dzongkha"
-    Locale["dz"]["endonym"]            = "རྫོང་ཁ"
-    #Locale["dz"]["translations-of"]
-    #Locale["dz"]["definitions-of"]
-    #Locale["dz"]["synonyms"]
-    #Locale["dz"]["examples"]
-    #Locale["dz"]["see-also"]
-    Locale["dz"]["family"]             = "Sino-Tibetan"
-    Locale["dz"]["iso"]                = "dzo"
-    Locale["dz"]["glotto"]             = "nucl1307"
-    Locale["dz"]["script"]             = "Tibt"

     #? Eastern Mari
     Locale["mhr"]["support"]           = "yandex-only"


Translators/BingTranslator: cn.bing.com as fallback

--- include/Translators/BingTranslator.awk
+++ include/Translators/BingTranslator.awk
@@ -195,6 +195,19 @@

     # Translation
     content = postResponse(text, _sl, _tl, _hl, "translate")
+    if (content == "") {
+        # Empty content. Assume "301 Moved Permanently" and use cn.bing.com
+        HttpHost = "cn.bing.com"
+        # Just dirty hack
+        if (Option["proxy"]) {
+            HttpPathPrefix = HttpProtocol HttpHost
+        } else {
+            HttpService = "/" "inet" "/tcp/0/" HttpHost "/" HttpPort  # FIXME: inet version
+        }
+
+        # Try again
+        content = postResponse(text, _sl, _tl, _hl, "translate")
+    }
     if (Option["dump"])
         return content
     tokenize(tokens, content)


Fixed bug in how titles were rendered

Fixed bug in how titles were rendered

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

 	# populate title if not set
 	if (! ("Title" in rules)) {
-		n = split(fileparts[1], words, /[^ -_]/)
+		n = split(fileparts[1], words, /[ \-_]/)
 		for (i in words) {
 			words[i] = toupper(substr(words[i], 1, 1)) substr(words[i], 2)
 		}


Update int/number check to allow negative

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -30,8 +30,8 @@
     print "function eql(x,y) {v=1; for (i in x) v=(v&&x[i]==y[i]); return v;}"
     print "function are_headers_valid(valid_headers) { v=0; split($0, h, \",\"); split(valid_headers, vh, \"|\"); return eql(h, vh); }"
     print "function is_unique(i, val) { if (vals[i,val]) { return 0; } else { vals[i,val] = 1; return 1; } }"
-    print "function is_integer(x) { return x ~ /^[0-9]+$/ }"
-    print "function is_number(x) { return x ~ /^[0-9]+.[0-9]+$/ }"
+    print "function is_integer(x) { return x ~ /^-?[0-9]+$/ }"
+    print "function is_number(x) { return x ~ /^-?[0-9]+.[0-9]+$/ }"
     print "function print_cats(categories) { for (category in categories) { if (categories[category]) print \"      \" category \": \" categories[category]; } }"
     print "function log_err(cat) { cats[cat]++; err_count++; }"
     print RS


Fixed bug where static rendered to wrong location

Static actions would include their source directory under the build
directory.

--- lib/make_depend.awk
+++ lib/make_depend.awk
@@ -12,8 +12,8 @@
 		get_rules(adt, rule, p_rule)
 		if (p_rule["action"] == "static") {
 			# if it is a static source, add it separately, since we are just going to copy it over anyways
-			print p_rule["default_target"] ": $(patsubst %, " p_rule["buildDir"] "/%, $(shell find " rule " -type f))"
-			print p_rule["buildDir"] "/" rule "/%: " rule "/%"
+			print p_rule["default_target"] ": $(patsubst " rule "/%, " p_rule["buildDir"] "/%, $(shell find " rule " -type f))"
+			print p_rule["buildDir"] "/%: " rule "/%"
 			print "\tmkdir -p $(@D)"
 			print "\tcp $< $@"
 		} else if (p_rule["action"] == "convert"){


Main: cleanup

Main: cleanup

--- include/Main.awk
+++ include/Main.awk
@@ -17,6 +17,7 @@

     Option["debug"] = 0

+    # Display
     Option["verbose"] = 1
     Option["show-original"] = 1
     Option["show-original-phonetics"] = 1
@@ -27,35 +28,37 @@
     Option["show-original-dictionary"] = 0
     Option["show-dictionary"] = 1
     Option["show-alternatives"] = 1
-
-    Option["no-ansi"] = 0
-
     Option["width"] = ENVIRON["COLUMNS"] ? ENVIRON["COLUMNS"] : 64
     Option["indent"] = 4
-
+    Option["no-ansi"] = 0
+    Option["theme"] = "default"
+
+    # Audio
+    Option["play"] = 0
+    Option["player"] = ENVIRON["PLAYER"]
+
+    # Terminal paging and web
     Option["view"] = 0
     Option["pager"] = ENVIRON["PAGER"]
-
     Option["browser"] = ENVIRON["BROWSER"]

-    Option["play"] = 0
-    Option["player"] = ENVIRON["PLAYER"]
-
+    # Networking
     Option["proxy"] = ENVIRON["HTTP_PROXY"] ? ENVIRON["HTTP_PROXY"] : ENVIRON["http_proxy"]
     Option["user-agent"] = ENVIRON["USER_AGENT"]

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

+    # I/O
     Option["input"] = NULLSTR
     Option["output"] = STDOUT

+    # Language preference
     Option["hl"] = ENVIRON["HOME_LANG"] ? ENVIRON["HOME_LANG"] : UserLang
     Option["sl"] = ENVIRON["SOURCE_LANG"] ? ENVIRON["SOURCE_LANG"] : "auto"
     Option["tl"][1] = ENVIRON["TARGET_LANG"] ? ENVIRON["TARGET_LANG"] : UserLang
-
-    Option["theme"] = "default"
 }

 # Initialization script.
@@ -86,39 +89,13 @@
     }
 }

-# Theme initialization.
-function initTheme() {
-    # Set theme
-    setTheme()
+# Miscellany initialization.
+function initMisc(    group) {
+    initHttpService()

     # Disable ANSI escape codes if required
     if (Option["no-ansi"])
         delete AnsiCode
-}
-
-# Miscellany initialization.
-function initMisc(    group) {
-    initHttpService()
-
-    # Initialize pager
-    if (Option["view"]) {
-        if (!Option["pager"]) {
-            initPager()
-            Option["pager"] = Pager
-        }
-
-        if (!Option["pager"]) {
-            w("[WARNING] No available terminal pager.")
-            Option["view"] = 0
-        }
-    }
-
-    # Initialize browser
-    if (!Option["browser"]) {
-        "xdg-mime query default text/html" SUPERR |& getline Option["browser"]
-        match(Option["browser"], "(.*).desktop$", group)
-        Option["browser"] = group[1]
-    }

     # Initialize audio player or speech synthesizer
     if (Option["play"]) {
@@ -134,14 +111,34 @@
             Option["play"] = 0
         }
     }
+
+    # Initialize pager
+    if (Option["view"]) {
+        if (!Option["pager"]) {
+            initPager()
+            Option["pager"] = Pager
+        }
+
+        if (!Option["pager"]) {
+            w("[WARNING] No available terminal pager.")
+            Option["view"] = 0
+        }
+    }
+
+    # Initialize browser
+    if (!Option["browser"]) {
+        "xdg-mime query default text/html" SUPERR |& getline Option["browser"]
+        match(Option["browser"], "(.*).desktop$", group)
+        Option["browser"] = group[1]
+    }
 }

 # Main entry point.
 BEGIN {
     init()
-    initScript()
-
-    # Option parsing
+    initScript() # initialization script overrides default setting
+
+    # Command-line options override initialization script
     pos = 0
     while (ARGV[++pos]) {
         # -, -no-op
@@ -483,7 +480,7 @@
         break # no more option from here
     }

-    initTheme()
+    setTheme() # theme overrides command-line options

     if (Option["interactive"] && !Option["no-rlwrap"])
         rlwrapMe() # interactive mode
@@ -491,10 +488,12 @@
         if (emacsMe()) # emacs front-end
             Option["interactive"] = 1 # fallback to interactive mode

+    # Get started
+
+    initMisc()
+
     if (Option["interactive"])
         welcome()
-
-    initMisc()

     if (pos < ARGC) {
         # More parameters


Remove a redundant escape character.

Remove a redundant escape character.

Some awks warn about it having no effect.

git-svn-id: 8dbf393e6e9ab8d4979d29f9a341a98016792aa6@16492 0101bb08-14d6-0310-b084-bc0e0c8e3800

--- lib/defexp.awk
+++ lib/defexp.awk
@@ -8,7 +8,7 @@
 /^\w*;.*/ {next}

 # remember and propagate the library name
-/LIBRARY/ {name = $2; print "\# export list for", name; next}
+/LIBRARY/ {name = $2; print "# export list for", name; next}

 # skip various other lines
 /^\w*NAME/ ||


fix option: -reference

fix option: -reference

--- include/Main.awk
+++ include/Main.awk
@@ -85,7 +85,7 @@
         }

         # -r, -reference
-        match(ARGV[pos], /^--?(ref(e(r(e(n(ce?)?)?)?)?)?|r)$/)
+        match(ARGV[pos], /^--?r(e(f(e(r(e(n(ce?)?)?)?)?)?)?)?$/)
         if (RSTART) {
             print getReference("endonym")
             exit


Fixed total

Fixed total

--- csvToLatex.awk
+++ csvToLatex.awk
@@ -19,13 +19,13 @@
 }

 END {
-	roundedTotal=sprintf("%.2f", totalTargetCurrency);
-	roundedTax=sprintf("%.2f", totalWithholdingTax);
 	if (length(adRevenueTargetCurrency) != 0) {
 		printf "Ad Revenue & & & %.2f USD & %.2f EUR & %.2f EUR \\\\ \\hline \n", adRevenueUsd, adRevenueTargetCurrency, adRevenueWithholdingTaxTargetCurrency;
 		totalTargetCurrency += adRevenueTargetCurrency;
 		totalWithholdingTax += adRevenueWithholdingTaxTargetCurrency;
 	}
+	roundedTotal=sprintf("%.2f", totalTargetCurrency);
+	roundedTax=sprintf("%.2f", totalWithholdingTax);
 	printf "\\hline & & & Gesamt & %.2f EUR & %.2f EUR \\\\ \\hline \n", totalTargetCurrency, totalWithholdingTax;
 	print "\\end{longtable}";
 	print "\n\n";


Fixes for bonus episode mismatches

Fixes for bonus episode mismatches

--- getAcornFrom-seriesPages.awk
+++ getAcornFrom-seriesPages.awk
@@ -226,9 +226,13 @@
         showType = "S"
     # Default episodeType to "E"
     episodeType = "E"
-    # Default christmasspecial episodeType to "X", don't increment seasonNumber
+    # Default bonus episodeType to "X"
+    if (episodeURL ~ /bonus\//) {
+        episodeType = "X"
+    }
+    # Default christmasspecial episodeType to "K", don't increment seasonNumber
     if (episodeURL ~ /christmasspecial\//) {
-        episodeType = "X"
+        episodeType = "K"
         seasonNumber -= 1
     }
     #
@@ -241,11 +245,14 @@
     if (totalEpisodes == 1)
         next
     # The season number should match that in the URL
-    # Birds of a Feather, Doc Martin, Murdoch, Poirot, Rebus, and Vera have known problems
+    # Birds of a Feather, Doc Martin, Murdoch, Poirot, Rebus, Vera, and others have problems
     if (episodeURL ~ \
-           /\/series[0-9]{1,2}\/|\/murdoch\/season[0-9]{1,2}/) {
+           /\/series[0-9]{1,2}\/|[0-9]{1,2}bonus\/|\/murdoch\/season[0-9]{1,2}/) {
         split (episodeURL, part, "/")
         URLseasonNumber = part[5]
+        sub (/bonus/,"",URLseasonNumber)
+        # Foyle's War has sets: foyleswar/series9set8bonus/
+        sub (/set[0-9]/,"",URLseasonNumber)
         sub (/christmasspecial/,"",URLseasonNumber)
         sub (/[[:alpha:]]*/,"",URLseasonNumber)
         if (URLseasonNumber != seasonNumber) {


fix single to double quotes

fix single to double quotes

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -137,7 +137,7 @@
 	# kegg
 	prefix["http://www.genome.jp/kegg/pathway/map/map"]="KEGG-img"
 	# in EOM
-	prefix['https://elementsofmorphology.nih.gov/images/terms/']="EOM_IMG"
+	prefix["https://elementsofmorphology.nih.gov/images/terms/"]="EOM_IMG"

 	# playing with the idea of a LOCAL identifier
     # not the same as a bnode in that tools won't rewrite identifier


Make sure newline at end of file

Make sure newline at end of file

--- fixExtraLinesFrom-webscraper.awk
+++ fixExtraLinesFrom-webscraper.awk
@@ -9,3 +9,8 @@
     else
         printf
 }
+
+END {
+    printf ("\n")
+}
+


Increment loops in-line with the call to `fsmgvedge()`.

--- share/bin/plain2mp.awk
+++ share/bin/plain2mp.awk
@@ -222,11 +222,9 @@
 #		printf "draw llxy -- lxy withpen pencircle scaled 1bp withcolor red;\n"
 	}

-	printf "fsmgvedge(%s, %s.diam, %s, %s.diam, e, pp, \"%s\", %s.loops);", tail, tail, head, head, label, head;
-
-	if (head == tail) {
-		print "	%s.loops := %s.loops + 1;", head, head
-	}
+	printf "fsmgvedge(%s, %s.diam, %s, %s.diam, e, pp, \"%s\", %s);",
+		tail, tail, head, head, label,
+		head != tail ? 0 : sprintf("incr %s.loops", head);
 }

 /^stop$/ {


\u needs extra \

\u needs extra \


drop leading space

drop leading space

--- scripts/label_dot_edge.awk
+++ scripts/label_dot_edge.awk
@@ -34,7 +34,8 @@
 		for(i=2;i<=length(term);i++)
 			row[4] = row[4] "\"" term[i]
 	}
-	for(i=1;i<=length(row);i++)
+    line = row[1]
+	for(i=2;i<=length(row);i++)
 		line = line " " row[i]
 	print  line
 }


Cannonicalize MHz headers

Cannonicalize MHz headers

--- getMHzFrom-seriesPages.awk
+++ getMHzFrom-seriesPages.awk
@@ -66,6 +66,7 @@
         sub (/WITH ENGLISH SUBTITLES /,"")
         sub (/SCANDINAVIAN CRIME FICTION/,"Sweden")
         sub (/NONFICTION - DOCUMENTARY/,"Documentary")
+        sub (/NON-FICTION - DOCUMENTARY/,"Documentary")
         gsub (/ \| {1,2}/,"|")
         sub (/\r/,"")
         # Split out header fields
@@ -80,6 +81,8 @@
         }
         # print the finalized header
         if (numFields > 3 ) {
+            sub ("Drama-crime","Drama - crime",fld[1])
+            gsub (" ","",fld[4])
             print fld[1] "\t" fld[2] "\t" fld[(numFields-1)] "\t" fld[(numFields)] >> HEADER_FILE
             headerPrinted = "yes"
         }


Add doNotProcess to statuses.

Add doNotProcess to statuses.

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

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -59,7 +59,8 @@
   s[8] = "down"
   s[9] = "superseded"
   s[10] = "zapped"
-  sn = 11
+  s[11] = "doNotProcess"
+  sn = 12

   sc[0] = "expe"
   sc[1] = "exis"
@@ -72,7 +73,8 @@
   sc[8] = "down"
   sc[9] = "supe"
   sc[10] = "zapp"
-  scn = 11
+  sc[11] = "doNP"
+  scn = 12

   #print out header
   printf "Publisher\tPlugin\tContr\tBack\tYear\tT\tTotal"


Better scalac coloring

Better scalac coloring

--- color_scalac.awk
+++ color_scalac.awk
@@ -4,7 +4,10 @@

 {
   if($2=="error") {
-    print "\033[91m"$0
+    # see http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
+    printf "\033[94m"$1
+    for(i=2; i<=NF; i++) printf ": \033[91m"$i
+    printf "\n"
   } else {
     print "\033[0m"$0
   }


Mark the generated output as 'DO NOT EDIT'

--- CollectTests.awk
+++ CollectTests.awk
@@ -31,6 +31,11 @@
     CLASS=""
     TESTCASES=""
     TESTCASE_separator=""
+    printf("//\n")
+    printf("// GENERATED FILE\n")
+    printf("// DO NOT EDIT\n")
+    printf("//\n")
+    printf("\n")
     printf("import XCTest\n")
     printf("@testable import SwiftProtobufTests\n")
     printf("\n")


revise a bit

revise a bit

--- tool.hgas/split_particle.awk
+++ tool.hgas/split_particle.awk
@@ -1,4 +1,3 @@
-# argv: n (Original number)
 BEGIN{
     pi  = 3.141;
     idc = 0;


Fix an issue with fzn2py.awk where no output variables are specified in the mzn model.

--- fzn/fzn2py.awk
+++ fzn/fzn2py.awk
@@ -256,12 +256,12 @@
 			output_vars = output_vars e;
 		}
 	}
-	print "    output_vars = (" output_vars ",)";
+	print "    output_vars = (" output_vars ")";
 	print "    return model, output_vars";

 	print "";
 	print "model, output_vars = get_model()";
-	print output_vars " = output_vars";
+	if(output_vars) print output_vars " = output_vars";
 	print "solvers = ['Mistral', 'SCIP', 'MiniSat', 'Toulbar2', 'Gurobi']";
 	print "default = dict([('solver', 'Mistral'), ('verbose', 0), ('tcutoff', 900), ('var', 'DomainOverWDegree'), ('val', 'Lex'), ('rand', 2), ('threads', 1), ('restart', GEOMETRIC), ('base', 256), ('factor', 1.3)])";
 	print "param = input(default)";


Tidy code

Tidy code

--- PBS/scripts/split_rmdups.awk
+++ PBS/scripts/split_rmdups.awk
@@ -10,10 +10,10 @@
 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 # copies of the Software, and to permit persons to whom the Software is
 # furnished to do so, subject to the following conditions:
-#
+#
 # The above copyright notice and this permission notice shall be included in
 # all copies or substantial portions of the Software.
-#
+#
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -23,7 +23,7 @@
 # THE SOFTWARE.
 ##########

-# Dedup script that submits deduping jobs after splitting at known
+# Dedup script that submits deduping jobs after splitting at known
 # non-duplicates
 # Juicer version 1.5

@@ -34,25 +34,26 @@
 {
 	if (tot >= 1000000) {
 		if (p1 != $1 || p2 != $2 || p4 != $4 || p5 != $5 || p8 != $8) {
-	        print "this is the beginging part of split rmdups awk";
-            cmd=sprintf("qstat | grep osplit%s |cut -c 1-7", groupname);
-            cmd |& getline jID_osplit;
-    		sname=sprintf("%s_msplit%04d_", groupname, name);
-			sysstring1=sprintf("qsub -l %s -o %s_%s.log -j oe -q %s -N DDuP%s%s -l mem=4gb -l nodes=1:ppn=1:AMD -W depend=afterok:%s <<-EOF\nawk -f  %s/scripts/dups.awk -v name=%s/%s %s/split%04d;\nEOF\n", walltime, outfile, sname, queue, name, groupname, jID_osplit ,juicedir, dir, sname, dir, name, dir, name);
+			print "this is the beginging part of split rmdups awk";
+			cmd=sprintf("qstat | grep osplit%s |cut -c 1-8", groupname);
+			cmd |& getline jID_osplit;
+			sname=sprintf("%s_msplit%04d_", groupname, name);
+			sysstring1=sprintf("qsub -l %s -o %s_%s.log -j oe -W group_list=cu_10027 -A cu_10027 -q %s -N DDuP%s%s -l mem=4gb -l nodes=1:ppn=1:thinnode -W depend=afterok:%s <<-EOF\nawk -f  %s/scripts/dups.awk -v name=%s/%s %s/split%04d;\nEOF\n", walltime, outfile, sname, queue, name, groupname, jID_osplit ,juicedir, dir, sname, dir, name, dir, name);
 			system(sysstring1);
-            cmd1=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1",name,groupname);
-            cmd1 |& getline jID;
-            close(cmd1);
-            if (name==0){
-            waitstring=sprintf("%s",jID );
-            waitstring2=sprintf("%s",jID)
-            }
-		    else {
-            waitstring=sprintf("%s:%s",waitstring,jID);
-            waitstring2=sprintf("%s %s",waitstring2,jID)
-            }
-
-            name++;
+			cmd1=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",name,groupname);
+			cmd1 |& getline jID;
+
+			close(cmd1);
+			if (name==0){
+				waitstring=sprintf("%s",jID );
+				waitstring2=sprintf("%s",jID)
+			}
+		  else {
+				waitstring=sprintf("%s:%s",waitstring,jID);
+				waitstring2=sprintf("%s %s",waitstring2,jID)
+		  }
+
+		  name++;
 			tot=0;
 		}
 	}
@@ -66,40 +67,41 @@
     print "This is the begining of END step, submitting _dedup job in END step";
 	sysstring2=sprintf("qsub -l %s -o %s_%s_dedup%s.log -j oe -q %s -N DDuP%s%s -W depend=afterok:%s <<-EOF\nawk -f %s/scripts/dups.awk -v name=%s/%s %s/split%04d;\nEOF\n", walltime, outfile, sname, name, queue, name, groupname, jID_osplit ,juicedir, dir, sname, dir, name, dir, name);
     system(sysstring2);
+	sname=sprintf("%s_msplit%04d_", groupname, name);
+	system(sysstring2);

-    cmd2=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1",name,groupname);
-    cmd2 |& getline jID;
-    close(cmd2);
-    if ( name==0 ){
-    waitstring=sprintf("%s",jID );
-    waitstring2=sprintf("%s",jID);
-    }
-    else {
-    waitstring=sprintf("%s:%s",waitstring,jID);
-    waitstring2=sprintf("%s %s",waitstring2,jID);
-    }
-    cmd3=sprintf("qstat %s",waitstring2);
-    cmd3 |& getline waitedjobstatus;
-    close(cmd3)
-    print "below is the waitingstring1 and waitingstring2";
+	cmd2=sprintf("qstat | grep DDuP%s%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",name,groupname);
+	cmd2 |& getline jID;
+	close(cmd2);
+	if ( name==0 ){
+		waitstring=sprintf("%s",jID );
+		waitstring2=sprintf("%s",jID);
+	}
+	else {
+		waitstring=sprintf("%s:%s",waitstring,jID);
+		waitstring2=sprintf("%s %s",waitstring2,jID);
+	}
+	cmd3=sprintf("qstat %s",waitstring2);
+	cmd3 |& getline waitedjobstatus;
+	close(cmd3)
+	print "below is the waitingstring1 and waitingstring2";
 	print waitstring;
-    print waitstring2;
-    print "below is te waited job status before qsub"
-    print $waitedjobstatus;
-    print "submitting _catsplit jobs";
 	sysstring = sprintf("qsub -l %s -o %s_catsplit.log -j oe -q %s -N CtSplt%s -W depend=afterok:%s <<-EOF\ncat %s/%s_msplit*_optdups.txt > %s/opt_dups.txt;  cat %s/%s_msplit*_dups.txt > %s/dups.txt; cat %s/%s_msplit*_merged_nodups.txt > %s/merged_nodups.txt; \nEOF\n", walltime, outfile, queue, groupname, waitstring, dir, groupname, dir, dir, groupname, dir, dir, groupname, dir, dir);
-    system(sysstring);
-    cmd4=sprintf("qstat | grep CtSplt%s | cut -d ' ' -f 1",groupname);
-    cmd4 |& getline jID_catsplit;
-    close(cmd4);
-    print "below is the _catsplit id";
+	print waitstring2;
+	print "below is the waited job status before qsub"
+	print waitedjobstatus;
+	print "submitting _catsplit jobs";
+	system(sysstring);
+	cmd4=sprintf("qstat | grep CtSplt%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",groupname);
+	cmd4 |& getline jID_catsplit;
+	close(cmd4);
+	print "below is the _catsplit id";
 	print jID_catsplit;
-    print "submitting _rmsplit jobs";
 	sysstring=sprintf("qsub -l %s -o %s_rmsplit.log -j oe -q %s -N RmSplt%s -W depend=afterok:%s <<-EOF\n rm %s/*_msplit*_optdups.txt; rm %s/*_msplit*_dups.txt; rm %s/*_msplit*_merged_nodups.txt; rm %s/split*;\nEOF", walltime, outfile, queue, groupname,jID_catsplit, dir, dir, dir, dir);
-  system(sysstring);
-    cmd=sprintf("qstat | grep RmSplt%s | cut -d ' ' -f 1",groupname);
-    cmd |& getline jID_rmsplit;
-    print "below is the jID_rmsplit:";
-    print jID_rmsplit;
+	print "submitting _rmsplit jobs";
+	system(sysstring);
+	cmd=sprintf("qstat | grep RmSplt%s | cut -d ' ' -f 1 | cut -d '.' -f 1-2",groupname);
+	cmd |& getline jID_rmsplit;
+	print "below is the jID_rmsplit:";
+	print jID_rmsplit;
 }
-


Added awk to parse config file

Added awk to parse config file

--- lib/config.awk
+++ lib/config.awk
@@ -0,0 +1,47 @@
+# awk library to parse config file
+
+
+# if we are in find_sec look for things that match brackets
+match($0, /\[([[:alnum:]_]).*\]/) {
+  section = substr($0, (RSTART + 1), (RLENGTH - 2))
+
+  # if we have encountered a new rule
+  if (section != "RENDERERS") {
+	  if (section in section_names) {
+		  print "Error Parsing config @ line", FNR ": encountered section", section, "multiple times"
+		exit -1
+	  } else {
+		  section_names[section] = 1
+	  }
+  }
+  next
+}
+
+# if we detect a setting of a key value
+/.*=.*/ {
+	n = split($0, kval, "=")
+	if (n != 2) {
+		print "Error Parsing config @ line", FNR ": Bad key val", $0
+		exit -1
+	}
+
+	key = kval[1]
+	val = kval[2]
+
+	# special exception for renderer: we use this to store converters
+	if (section == "RENDERERS") {
+		renderers[key] = val
+	} else { 		# we are parsing a rule
+		rules[section,key] = val
+	}
+}
+
+# helper function to print all of the rules identified during the configuration
+function dump_rules() {
+	print "RULES"
+	for (r in rules) {
+		split(r,sep,SUBSEP)
+		print "PATH",sep[1] ",", sep[2], "->", rules[r]
+
+	}
+}


Help: show web browser in getVersion

Help: show web browser in getVersion

--- include/Help.awk
+++ include/Help.awk
@@ -26,6 +26,8 @@
                 "[NOT INSTALLED]")                                      \
         sprintf("%-22s%s\n", "terminal pager", Pager ? Pager :
                 "[NOT INSTALLED]")                                      \
+        sprintf("%-22s%s\n", "web browser", Option["browser"] != NONE ?
+                Option["browser"] :"[NONE]")                            \
         sprintf("%-22s%s (%s)\n", "user locale", UserLocale, getName(UserLang)) \
         sprintf("%-22s%s\n", "home language", Option["hl"])             \
         sprintf("%-22s%s\n", "source language", join(Option["sls"], "+")) \


Fix seasons in c3

Fix seasons in c3

--- getBBoxEpisodesFrom-webscraper.awk
+++ getBBoxEpisodesFrom-webscraper.awk
@@ -85,7 +85,12 @@
     } else if (URL ~ /Episode_[[:digit:]]*_[[:digit:]]*$/) {
         # /us/episode/Episode_5_26089
         revisedSeasons3 += 1
-        seasonNumber = "98"
+        seasonNumber = Years
+        if (episodeSeason != "" && seasonNumber+0 != episodeSeason+0) {
+            printf ("==> Fixed c3 season: %02d-%02d\t%s\t%s\n", \
+                    seasonNumber, episodeSeason, shortURL, episodeTitle) >> ERROR_FILE
+            seasonNumber = episodeSeason
+        }
         episodeNumber = substr(fld[nflds-1], 1)
         sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
         c3Num += 1


ahrf.awk: allow backticks at the beginning of the word


vector extraction script fixed

vector extraction script fixed

--- scripts/get_vectors.awk
+++ scripts/get_vectors.awk
@@ -2,8 +2,8 @@

 ##################################################################
 BEGIN {
-    if (ARGC != 2) {
-	printf("Incorrect number of arguments.") > "/sys/stderr"
+    if (ARGC != 3) {
+	printf("Incorrect number of arguments.") > "/dev/stderr"
 	exit 1
     }


pass on less three or less

pass on less three or less

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

     n = asorti(warn, wsort, "@val_num_desc")
     for(i=1;i<=n;i++){
-        if(warn[wsort[i]] >= toofew)
+        if(warn[wsort[i]] > toofew)
             printf("%s\t%s\t%i\n", FILENAME, wsort[i], warn[wsort[i]]) > "/dev/stderr"
         else
             i = n + 1


Do not check nisas

Do not check nisas

--- misc/rdf-nt.awk
+++ misc/rdf-nt.awk
@@ -25,7 +25,7 @@
     nsenses = split($3, senses, ", ");
     nisas   = split($5, isas,   ", ");

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

     print "<" URN "c" $1 ">", TYPE,  CONCEPT,            ".";
     print "<" URN "c" $1 ">", LABEL, "\"synset" $1 "\"", ".";


Removed renamed file

Removed renamed file

--- rewrite-to-bash-case.awk
+++ rewrite-to-bash-case.awk
@@ -1,15 +0,0 @@
-#! /bin/bash -
-
-#########################
-#
-# Name: rewrite-to-bash-case.bash
-#
-# Purpose: Rewrite CMIP5-tables to bash case selection
-#
-# Usage: ./rewrite-to-bash-case.bash
-#
-# Revision history: 2016-02-25  --  Script created, Martin Evaldsson, Rossby Centre
-#
-# Contact persons:  martin.evaldsson@smhi.se
-#
-########################


bash: more generic name for count

bash: more generic name for count

--- bin/numstats.awk
+++ bin/numstats.awk
@@ -4,7 +4,7 @@
 $1 > max  {max = $1}
           {sum+=$1; sumsq+=$1*$1}
 END {
-  print "lines: ", NR;
+  print "count: ", NR;
   print "min:   ", min;
   print "max:   ", max;
   print "sum:   ", sum;


win32/version.awk: fixed whitespace

win32/version.awk: fixed whitespace

darcs-hash:20081127232850-db55f-a65203bc70bccd003a74acf8fe55d78d4f639b41.gz

--- win32/version.awk
+++ win32/version.awk
@@ -1,7 +1,7 @@
 #! /bin/gawk
 #
 # This script extracts the version information from configure.ac
-# and re-generates win32/config.h and
+# and re-generates win32/config.h and
 # libsofia-sip-ua/features/sofia_sip_features.h
 #
 # --------------------------------------------------------------------
@@ -38,7 +38,7 @@

 IN && /^AC_INIT/ { version=$2; gsub(/[\]\[)]/, "", version); }

-OUT && /@[A-Z_]+@/ {
+OUT && /@[A-Z_]+@/ {
   gsub(/@PACKAGE_VERSION@/, version);
   gsub(/@PACKAGE_BUGREPORT@/, "sofia-sip-devel@lists.sourceforge.net");
   gsub(/@PACKAGE_NAME@/, "sofia-sip");


Rearranged columns in outfile reports

Rearranged columns in outfile reports

--- getBBoxEpisodesFrom-webscraper.awk
+++ getBBoxEpisodesFrom-webscraper.awk
@@ -68,7 +68,7 @@
         sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
         c1Num += 1
         outfile = "BBox-scrapes/c1-" longdate ".csv"
-        printf ("c1\t%d\t%s\t%s\t%s\t%s\t%s\n",c1Num,sortkey,URL,showTitle,episodeTitle,Years) >> outfile
+        printf ("c1\t%d\t%s\t%s\t%s\t%s\t%s\n",c1Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
     } else if (URL ~ /_E[[:digit:]]*_[[:digit:]]*$/) {
         # /us/episode/35_Hours_E1_26129
         revisedSeasons2 += 1
@@ -82,7 +82,7 @@
         sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
         c2Num += 1
         outfile = "BBox-scrapes/c2-" longdate ".csv"
-        printf ("c2\t%d\t%s\t%s\t%s\t%s\t%s\n",c2Num,sortkey,URL,showTitle,episodeTitle,Years) >> outfile
+        printf ("c2\t%d\t%s\t%s\t%s\t%s\t%s\n",c2Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
     } else if (URL ~ /Episode_[[:digit:]]*_[[:digit:]]*$/) {
         # /us/episode/Episode_5_26089
         revisedSeasons3 += 1
@@ -96,7 +96,7 @@
         sortkey = sprintf ("%s%02dE%03d", showtype, seasonNumber, episodeNumber)
         c3Num += 1
         outfile = "BBox-scrapes/c3-" longdate ".csv"
-        printf ("c3\t%d\t%s\t%s\t%s\t%s\t%s\n",c3Num,sortkey,URL,showTitle,episodeTitle,Years) >> outfile
+        printf ("c3\t%d\t%s\t%s\t%s\t%s\t%s\n",c3Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
     } else {
         revisedSeasons4 += 1
         URL ~ /^\/us\/movie\// ? showtype = "M" : showtype = "E"
@@ -105,13 +105,13 @@
         sortkey = sprintf ("%s%05d", showtype, fld[nflds])
         if (episodeSeason != "") {
             showtype = "S"
-            sortkey = sprintf ("%s%02dE%05d", showtype, episodeSeason, fld[nflds])
+            sortkey = sprintf ("%s%02dE%05d", showtype, episodeSeason, 99999 - fld[nflds])
             printf ("==> Fixed c4 season: null-%02d\t%s\t%s\t%s\n", \
                     episodeSeason, showTitle, shortURL, episodeTitle) >> ERROR_FILE
         }
         c4Num += 1
         outfile = "BBox-scrapes/c4-" longdate ".csv"
-        printf ("c4\t%d\t%s\t%s\t%s\t%s\t%s\n",c4Num,sortkey,URL,showTitle,episodeTitle,Years) >> outfile
+        printf ("c4\t%d\t%s\t%s\t%s\t%s\t%s\n",c4Num,sortkey,showTitle,shortURL,episodeTitle,Years) >> outfile
     }

     # Convert duration from minutes to HMS


Main: update

Main: update

--- include/Main.awk
+++ include/Main.awk
@@ -2,8 +2,8 @@
 # Main.awk                                                         #
 ####################################################################

-# Initialization #0. (prior to option parsing)
-function init0() {
+# Initialization.
+function init() {
     initGawk()

     initBiDi()
@@ -88,8 +88,8 @@
     }
 }

-# Initialization #2. (prior to interactive mode handling)
-function init2() {
+# Theme initialization.
+function initTheme() {
     # Set theme
     setTheme()

@@ -98,9 +98,8 @@
         delete AnsiCode
 }

-# Initialization #3.
-function init3(    group) {
-    # Translate.awk
+# Miscellany initialization.
+function initMisc(    group) {
     initHttpService()

     # Initialize pager
@@ -141,8 +140,8 @@

 # Main entry point.
 BEGIN {
-    init0() # initialization #0
-    initScript() # initialization script
+    init()
+    initScript()

     # Option parsing
     pos = 0
@@ -486,7 +485,7 @@
         break # no more option from here
     }

-    init2() # initialization #2
+    initTheme()

     if (Option["interactive"] && !Option["no-rlwrap"])
         rlwrapMe() # interactive mode
@@ -497,7 +496,7 @@
     if (Option["interactive"])
         welcome()

-    init3() # initialization #3
+    initMisc()

     if (pos < ARGC) {
         # More parameters


[as] Add some debug information in generated files

--- as/target/gen.awk
+++ as/target/gen.awk
@@ -50,6 +50,7 @@

 		print "struct op optab[] = {"
 		for (i = 0; i < nvar; i++) {
+			printf "\t/* %d */\n", i
 			printf "\t{\n" \
 			       "\t\t.size = %d,\n"\
 			       "\t\t.format = %s,\n",


genplotscript.awk has moved to scripts at top level

--- Win32/binary/genplotscript.awk
+++ Win32/binary/genplotscript.awk
@@ -1,29 +0,0 @@
-#!/usr/bin/awk -f
-/\#t/
-{
-  printf("set data style linespoints\n");
-  printf("plot");
-  n = 0;
-  for (i = 2; i != ARGC; i++)
-  {
-    for (j = 2; j != NF+1; j++)
-    {
-      if (ARGV[i] == $(j))
-      {
-        printf(" '");
-	printf(ARGV[1]);
-	printf("'");
-	printf(" using 1:");
-	printf(j);
-	printf(" title '");
-	printf($(j));
-	printf("'");
-
-	if (i != ARGC - 1)
-	   printf(",");
-	n++;
-      }
-    }
-  }
-  exit 0;
-}


Clarify UTF-8 messages

Clarify UTF-8 messages

--- getMHzFromSitemap.awk
+++ getMHzFromSitemap.awk
@@ -305,8 +305,11 @@
         #
         # Look for directors
         director_name = episodeDescription
-        if (gsub (/\xc2\xa0/," ",director_name))
-            printf ("==> UTF8 non-breaking-space in %s\n", shortEpisodeURL) >> ERRORS
+        if (gsub (/\xc2\xa0/," ",director_name)) {
+            printf ("==> UTF-8 non-breaking-space in %s, S%02d%s%02d, %s\n", showTitle, seasonNumber,
+                    episodeType, episodeNumber, episodeTitle) >> ERRORS
+            print "    " episodeDescription >> ERRORS
+        }
         if (director_name ~ /[Dd]irected by /) {
             sub (/.*[Dd]irected by /,"",director_name)
             sub (/,.*$/,"",director_name)