X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=xfonts-traditional.git;a=blobdiff_plain;f=mkrules;h=5baa1d6dd97f27c32e959e02b4ef8ab463c32a9d;hp=b55b3976f65bf4b2ce88839c8edcda284cee920e;hb=72d604693d37945971ea221c84524a2750f9467b;hpb=fe6a7d791ffe20cb0cf74a22e2c024dc6319574e diff --git a/mkrules b/mkrules index b55b397..5baa1d6 100755 --- a/mkrules +++ b/mkrules @@ -25,6 +25,7 @@ chars () { } seenrules=/ +seenfoundries=/ while read keyword rest; do case "$keyword" in @@ -47,14 +48,26 @@ while read keyword rest; do m/^\d+\,(\d+)\b/ or die; print "key=$_; height=$1\n" or die $!; exit; - ' <$good` + ' <$bad` oldfoundry=`perl -ne ' next unless s/^FOUNDRY\s+\"?//; s/\"?\s+$//; print or die $!; exit; ' <$good` - printf "%s %s" "$oldfoundry" "$newfoundry" >>rules/foundries.new + case "$seenfoundries" in + */"$oldfoundry,$newfoundry"/*) + ;; + */"$oldfoundry,"*) + echo >&2 "inconsistent foundry mapping" + exit 1 + ;; + *) + seenfoundries=$seenfoundries$oldfoundry,$newfoundry/ + printf >>rules/foundries.new \ + "%s %s\n" "$oldfoundry" "$newfoundry" + ;; + esac case "$seenrules" in */"$newfoundry,$key"/*) exec 3>>rules/$newfoundry,$key.rules