--- texk/tetex/updmap.orig 2005-02-05 06:34:26.000000000 +0900 +++ texk/tetex/updmap 2009-12-20 00:15:40.000000000 +0900 @@ -266,6 +266,7 @@ ############################################################################### catMaps() { + type=$1; shift rm -f $catMapsFailed egrep "$1" "$cnfFile" \ | sed 's@#.*@@' \ @@ -275,14 +276,18 @@ | grep . > $tmp4 while read map; do - file=`locateMap "$map"` || { touch $catMapsFailed; break; } - + file=`locateMap ${type}_catmap "$map"` || \ + { echo "NG" >> $catMapsFailed; break; } + set -- ${file} + posttype=$1 + file=$2 + # output the file; also output a newline, because the final newline # might be missing in the map file; Empty lines are filtered out later, # so it does not really hurt do do this here. - test -n "$file" && { cat "$file"; echo; } + test -n "$file" && { cat "$file" | $posttype; echo; } done < $tmp4 - if test -f $catMapsFailed; then + if test -s $catMapsFailed; then false; return 1 else true; return 0 @@ -579,11 +584,15 @@ ############################################################################### locateMap() { + case $# in + 2) type=$1; shift ;; + *) type=map; ;; + esac # Always use the "migration checking version". This might become # consigurable, but for now, we always want to check. if :; then - locateMapMigrate "$@" + locateMapMigrate $type "$@" return $? fi @@ -607,10 +616,47 @@ ############################################################################### locateMapMigrate() { + type=$1; shift + for map do - # look up using the new search path - file=`kpsewhich --format=map "$map"` + posttype=cat + case $type in + dvipdfm) + prog=dvipdfm + file=`kpsewhich --progname=tmpdvipdfm --format="other text files" "$map"` + if ! [ -f "${file}" ]; then + posttype=dvips2dvipdfm + file=`kpsewhich --progname=tmpdvips --format="other text files" "$map"` + fi + if ! [ -f "${file}" ]; then + posttype=dvips2dvipdfm + file=`kpsewhich --format=map "$map"` + fi + ;; + dvipdfm_catmap) + prog=dvipdfm + file=`kpsewhich --progname=tmpdvipdfm --format="other text files" "$map"` + if ! [ -f "${file}" ]; then + posttype=dvips2dvipdfm + file=`kpsewhich --progname=tmpdvips --format="other text files" "$map"` + fi + if ! [ -f "${file}" ]; then + posttype=dvips2dvipdfm + file=`kpsewhich --format=map "$map"` + fi + ;; + dvips*) + prog=dvips + file=`kpsewhich --progname=tmpdvips --format="other text files" "$map"` + if ! [ -f "${file}" ]; then + file=`kpsewhich --format=map "$map"` + fi + ;; + *) + prog=map + file=`kpsewhich --format=map "$map"` ;; + esac # look up using the old search path file2=`kpsewhich --format='dvips config' "$map"` @@ -621,8 +667,11 @@ if test -f "$file"; then - verboseMsg "$progname: using map file \`$file'" - echo "$file" + verboseMsg "$progname: using map file \`$file' (for $prog)" + case ${type} in + *_catmap) echo "$posttype $file" ;; + *) echo "$file" ;; + esac # we have found the file where we should. If we have additional # ones: complain! @@ -679,7 +728,7 @@ $3 Please, consider removing this file. " - touch $mapWarnCalled + echo "NG" >> $mapWarnCalled ;; manualResolve) warn " @@ -694,7 +743,7 @@ content of the used map file. Additionally, consider removing the obsolete file. " - touch $mapWarnCalled + echo "NG" >> $mapWarnCalled ;; badLocation) map=$2 @@ -761,7 +810,6 @@ trap 'cleanup' 1 2 3 7 13 15 needsCleanup=true - mkdir "$tmpdir" || abort "could not create directory \`$tmpdir'" } ############################################################################### @@ -1064,6 +1112,7 @@ ############################################################################### dvips2dvipdfm() { + normalizeLines | \ sed -e 's@$@ %@' \ -e 's@^\(\([^ ]*\).*\)@\1\2@' \ -e 's@\(.*<\[* *\([^ ]*\)\.enc\(.*\)\)@\1 \2@' \ @@ -1150,13 +1199,14 @@ dvipdfm35=`locateMap dvipdfm35.map` || cleanup ps2pk35=`locateMap ps2pk35.map` || cleanup + # for dvips maps verboseMsg verboseMsg "$progname: Scanning for MixedMap entries:" - catMaps '^MixedMap' > $tmp1 || cleanup + catMaps dvips '^MixedMap' > $tmp1 || cleanup verboseMsg verboseMsg "$progname: Scanning for Map entries:" - catMaps '^Map' > $tmp2 || cleanup + catMaps dvips '^Map' > $tmp2 || cleanup verboseMsg # files should be world-readable @@ -1205,9 +1255,26 @@ <$tmp3 normalizeLines >> "$pdftexoutputdir/pdftex_ndl14.map" <$tmp7 normalizeLines >> "$pdftexoutputdir/pdftex_dl14.map" + # for dvipdfm maps + verboseMsg + verboseMsg "$progname: Scanning for dvipdfm MixedMap entries:" + catMaps dvipdfm '^MixedMap' > $tmp1 || cleanup + + verboseMsg + verboseMsg "$progname: Scanning for dvipdfm Map entries:" + catMaps dvipdfm '^Map' > $tmp2 || cleanup + verboseMsg + + { transLW35 "$dvipdfm35" | normalizeLines | \ + dvips2dvipdfm; cat $tmp1 $tmp2; } \ + | grep -v PaintType | grep . > $tmp6 + { transLW35 "$ps2pk35" | normalizeLines | \ + dvips2dvipdfm; cat $tmp1 $tmp2; } \ + | grep -v PaintType | grep . > $tmp7 + verboseMsg "$progname: Generating output for dvipdfm..." - <$tmp7 normalizeLines | dvips2dvipdfm | normalizeLines >> "$dvipdfmoutputdir/dvipdfm_dl14.map" - <$tmp6 normalizeLines | dvips2dvipdfm | normalizeLines >> "$dvipdfmoutputdir/dvipdfm_ndl14.map" + <$tmp7 normalizeLines >> "$dvipdfmoutputdir/dvipdfm_dl14.map" + <$tmp6 normalizeLines >> "$dvipdfmoutputdir/dvipdfm_ndl14.map" verboseMsg "$progname: All output generated!" verboseMsg @@ -1228,7 +1295,7 @@ | awk '{print $(NF-2), $(NF-1), $NF}' | verboseCat verboseMsg - if test -f $mapWarnCalled; then + if test -s $mapWarnCalled; then m=" !!! NOTICE: @@ -1281,18 +1348,22 @@ cnfFile= dvipsoutputdir=; pdftexoutputdir=; dvipdfmoutputdir= : ${TEXMFMAIN=`kpsewhich -var-value=TEXMFMAIN`} + TMPDVIPDFMINPUTS=`kpsewhich -var-value TEXFONTMAPS`"//dvipdfm//" + TMPDVIPSINPUTS=`kpsewhich -var-value TEXFONTMAPS`"//dvips//" + export TMPDVIPDFMINPUTS + export TMPDVIPSINPUTS - tmpdir=${TMP-/tmp}/$progname.$$ - tmp1=$tmpdir/a - tmp2=$tmpdir/b - tmp3=$tmpdir/c - tmp4=$tmpdir/d - tmp5=$tmpdir/e - tmp6=$tmpdir/f - tmp7=$tmpdir/g - tmp8=$tmpdir/h - mapWarnCalled=$tmpdir/mapWarnCalled - catMapsFailed=$tmpdir/catMapsFailed + tmpdir=`mktemp -d ${TMP-/tmp}/$progname.XXXXXXX` + tmp1=`mktemp $tmpdir/a.XXXXXX` + tmp2=`mktemp $tmpdir/b.XXXXXX` + tmp3=`mktemp $tmpdir/c.XXXXXX` + tmp4=`mktemp $tmpdir/d.XXXXXX` + tmp5=`mktemp $tmpdir/e.XXXXXX` + tmp6=`mktemp $tmpdir/f.XXXXXX` + tmp7=`mktemp $tmpdir/g.XXXXXX` + tmp8=`mktemp $tmpdir/h.XXXXXX` + mapWarnCalled=`mktemp $tmpdir/mapWarnCalled.XXXXXX` + catMapsFailed=`mktemp $tmpdir/catMapsFailed.XXXXXX` processOptions ${1+"$@"} @@ -1360,7 +1431,9 @@ esac fi - $mkmapEnabled || return + if ! $mkmapEnabled; then + return + fi setupDestDir mkMaps }