From: handa Date: Wed, 18 Feb 2009 01:43:55 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c10c271b7fc3d016a5935b5df0a81fafcb2a8a4c;p=m17n%2Fm17n-docs.git *** empty log message *** --- diff --git a/Makefile.am b/Makefile.am index 064f506..1ab60a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -264,11 +264,9 @@ doxyfile-man%.usr: doxyfile-man% data/exprog.txt: ${EXAMPLE_PROGS} utils/exprog.sh utils/exprog.sh ${EXAMPLE_PROGS} > $@ -data/dbdata.txt: ${DBDATA} ${DBIMAGE} @M17NDB@/mdb.xml utils/expand-mdb.awk \ - utils/expand-mdb.sed +data/dbdata.txt: ${DBDATA} ${DBIMAGE} @M17NDB@/mdb.xml utils/expand-mdb.awk [ -d data ] || mkdir data - SEDFILE=utils/expand-mdb.sed; \ - @AWK@ -v SEDFILE=$$SEDFILE -v M17NDB=@M17NDB@ -f utils/expand-mdb.awk @M17NDB@/mdb.xml > data/expanded-mdb.xml + @AWK@ -v M17NDB=@M17NDB@ -f utils/expand-mdb.awk @M17NDB@/mdb.xml > data/expanded-mdb.xml data/dbformat.txt: ${DBFORMAT} utils/dbformat.sh utils/dbformat.sh ${DBFORMAT} > $@ diff --git a/utils/expand-mdb.awk b/utils/expand-mdb.awk index 4067750..b2a2f33 100644 --- a/utils/expand-mdb.awk +++ b/utils/expand-mdb.awk @@ -4,16 +4,14 @@ BEGIN { SUBDIR["language-name-*"] = "LANGDATA/"; SUBDIR["standard-language-iso639"] = "LANGDATA/"; KEY=""; + XINCLUDEFMT="\n"; } /^ 0) { - KEY = sprintf("%s-%s", KEY, substr($0, RSTART + 6, RLENGTH - 6)); - if (match($0, "key2=\"[^\"]*") > 0) - KEY = sprintf("%s-%s", KEY, substr($0, RSTART + 6, RLENGTH - 6)); - } + KEY = substr($0, RSTART + 6, RLENGTH - 6); + for (i = 1; i < 4 && match($0, sprintf("key%d=\"[^\"]*", i)) > 0; i++) + KEY=KEY"-"substr($0, RSTART + 6, RLENGTH - 6); print; next; } @@ -21,10 +19,17 @@ BEGIN { /[^<]*<\/filename>/ { from = match($0, "[^<]*"); to = from + RLENGTH; - printf "%s\n", substr($0, 1, to - 1); + printf "%s", substr($0, 1, from - 1); TAIL = substr($0, to); - FILE = sprintf("%s%s", SUBDIR[KEY], substr($0, from + 10, to - from - 21)); - system(sprintf("ls %s/%s | sed -f %s", M17NDB, FILE, SEDFILE)); + FILE = substr($0, from + 10, to - from - 21); + COMMAND = "cd "M17NDB"/"SUBDIR[KEY]"; ls "FILE; + COMMAND | getline LINE; + print ""LINE""; + printf XINCLUDEFMT, M17NDB"/"SUBDIR[KEY]LINE; + while (COMMAND | getline LINE) { + print ""LINE""; + printf XINCLUDEFMT, M17NDB"/"SUBDIR[KEY]LINE; + } if (length(TAIL) > 0 && ! match(TAIL, "^[ \t]*$")) print TAIL; next; diff --git a/utils/expand-mdb.sed b/utils/expand-mdb.sed deleted file mode 100644 index 4e80791..0000000 --- a/utils/expand-mdb.sed +++ /dev/null @@ -1 +0,0 @@ -s,\(.*\),,