From 8b5dea01ab72973a3e09ee9926efede385f68319 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Fri, 16 Jan 2015 11:08:24 +0000 Subject: ODVIcopy: Bug fix: do not ignore -page-start and -max-pages. Additional test cases git-svn-id: svn://tug.org/texlive/trunk@36072 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/Makefile.in | 27 ++++++------- Build/source/texk/web2c/omegaware/ChangeLog | 7 ++++ Build/source/texk/web2c/omegaware/am/omegaware.am | 2 +- Build/source/texk/web2c/omegaware/odvicopy.ch | 46 ++++++++++++----------- Build/source/texk/web2c/omegaware/odvicopy.test | 27 ++++++++++++- Build/source/texk/web2c/omegaware/odvicopy.web | 6 +-- 6 files changed, 73 insertions(+), 42 deletions(-) diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index ca7c5d98eba..496e4a603b7 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -2396,19 +2396,20 @@ DISTCLEANFILES = $(EXTRA_LIBRARIES) CXXLD.sh tangle.c tangle.h \ ovf2ovp.web ovp2ovf.web omegaware/bad*.* \ omegaware/tests/charwdr.* omegaware/tests/charwdv.* \ omegaware/tests/xcheck* omegaware/tests/xlevel1.* \ - omegaware/tests/xlig*.* ofont*vf omegaware/tests/xofont* \ - omegaware/tests/Cherokee.tfm omegaware/tests/OCherokee.ofm \ - omegaware/tests/OCherokee.opl omegaware/tests/OCherokee.ovf \ - omegaware/tests/xCherokee.* omegaware/tests/xOCherokee.* \ - ocftest.* omegaware/tests/xinbmp* omegaware/tests/xoverbmp* \ - omegaware/tests/xrealnum.* omegaware/tests/xrepeated.* \ - omegaware/tests/sample*.ofm omegaware/tests/sample*.ovf \ - omegaware/tests/sample1-h.opl omegaware/tests/xsample*.out \ - omegaware/tests/shortend.* omegaware/tests/specialhex.ofm \ - omegaware/tests/specialhex.opl omegaware/tests/specialhex.ovf \ - omegaware/tests/xspecialhex.* omegaware/tests/yrepeat* \ - omegaware/tests/*yarabic* $(nodist_aleph_SOURCES) aleph.web \ - aleph.ch aleph-web2c aleph.p aleph.pool aleph-tangle + omegaware/tests/xlig*.* ofont*vf omegaware/tests/xpagenum.* \ + omegaware/tests/xofont* omegaware/tests/Cherokee.tfm \ + omegaware/tests/OCherokee.ofm omegaware/tests/OCherokee.opl \ + omegaware/tests/OCherokee.ovf omegaware/tests/xCherokee.* \ + omegaware/tests/xOCherokee.* ocftest.* omegaware/tests/xinbmp* \ + omegaware/tests/xoverbmp* omegaware/tests/xrealnum.* \ + omegaware/tests/xrepeated.* omegaware/tests/sample*.ofm \ + omegaware/tests/sample*.ovf omegaware/tests/sample1-h.opl \ + omegaware/tests/xsample*.out omegaware/tests/shortend.* \ + omegaware/tests/specialhex.ofm omegaware/tests/specialhex.opl \ + omegaware/tests/specialhex.ovf omegaware/tests/xspecialhex.* \ + omegaware/tests/yrepeat* omegaware/tests/*yarabic* \ + $(nodist_aleph_SOURCES) aleph.web aleph.ch aleph-web2c aleph.p \ + aleph.pool aleph-tangle CLEANFILES = TRIPTRAP_CLEAN = $(am__append_9) $(am__append_17) $(am__append_26) \ $(am__append_43) $(am__append_49) $(am__append_55) \ diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog index b530712fbf2..ff7cbf103ad 100644 --- a/Build/source/texk/web2c/omegaware/ChangeLog +++ b/Build/source/texk/web2c/omegaware/ChangeLog @@ -1,3 +1,10 @@ +2015-01-16 Peter Breitenlohner + + * odvicopy.web: Avoid useless differences with ../dvicopy.web. + * odvicopy.ch: Bug fix: Respect -page-start and -max-pages. + * odvicopy.test: Additional test cases. + * am/omegaware.am (DISTCLEANFILES): Additional output files. + 2015-01-15 Peter Breitenlohner * odvitype.web: Avoid useless differences with ../dvitype.web. diff --git a/Build/source/texk/web2c/omegaware/am/omegaware.am b/Build/source/texk/web2c/omegaware/am/omegaware.am index ab72856fe4f..d98695a0bae 100644 --- a/Build/source/texk/web2c/omegaware/am/omegaware.am +++ b/Build/source/texk/web2c/omegaware/am/omegaware.am @@ -144,7 +144,7 @@ EXTRA_DIST += \ omegaware/tests/ofontr1.vf omegaware/tests/ofontr2.ovf \ omegaware/tests/ofontr3.ovf omegaware/tests/ofontv4.vf \ omegaware/tests/ofontv5.ovf omegaware/tests/ofontv6.ovf -DISTCLEANFILES += ofont*vf +DISTCLEANFILES += ofont*vf omegaware/tests/xpagenum.* ## omegaware/odvitype.test (and odvicopy.test, ofonts.test) EXTRA_DIST += omegaware/tests/ofontd0.dtl omegaware/tests/ofontd0.dvi \ omegaware/tests/ofontd0.typ omegaware/tests/ofontr0.tfm \ diff --git a/Build/source/texk/web2c/omegaware/odvicopy.ch b/Build/source/texk/web2c/omegaware/odvicopy.ch index 0d26ad3191c..c7d6c432425 100644 --- a/Build/source/texk/web2c/omegaware/odvicopy.ch +++ b/Build/source/texk/web2c/omegaware/odvicopy.ch @@ -79,7 +79,7 @@ procedure initialize; {this procedure gets things started properly} line of input from the terminal} @z -% int_8 conflicts with on AIX. +% [7] int_8 conflicts with on AIX. % It just gets turned into schar anyway, so use that. @x @d int_32 == integer {signed 32~bit integers} @@ -94,7 +94,7 @@ procedure initialize; {this procedure gets things started properly} @!int_8_odvicopy = -@"80..@"7F; {signed 8~bit integer} @z -% [14] Redirect output, so it can go to either stdout or stderr, +% [11] Redirect output, so it can go to either stdout or stderr, % depending on where the output dvi file is going. @x @d print(#)==write(output,#) @@ -260,7 +260,7 @@ while l_cur_name= TFM_default_area:=TFM_default_area_name; OFM_default_area:=OFM_default_area_name; @@ -307,7 +307,7 @@ procedure bad_font; noreturn procedure bad_font; @z -@x [96] Open TFM file +@x [95] Open TFM file @= make_font_name(TFM_default_area_name_length)(TFM_default_area)(tfm_ext); reset(tfm_file,cur_name); @@ -340,13 +340,13 @@ else begin else abort('---not loaded, TFM or OFM file can''t be opened!') @z -@x +@x [99] close_in(tfm_file); @y xfclose(tfm_file, cur_name); @z -@x [103] Fix casting problem in C. +@x [101] Fix casting problem in C. @d tfm_b01(#)== {|tfm_b0..tfm_b1| as non-negative integer} if tfm_b0>127 then bad_font else #:=tfm_b0*256+tfm_b1 @@ -374,14 +374,14 @@ else #:=(((tfm_b0-intcast(256))*intcast(256)+tfm_b1) (((tfm_b0*intcast(256)+tfm_b1)*intcast(256)+tfm_b2)*intcast(256)+tfm_b3) @z -@x [103] Avoid compiler warnings +@x [101] Avoid compiler warnings read_tfm_word; tfm_b01(first_two); @y nco:=0; extra_words:=0; read_tfm_word; tfm_b01(first_two); @z -@x [109] Declare full_name. +@x [108] Declare full_name. @!dvi_loc:int_32; {where we are about to look, in |dvi_file|} @y @!dvi_loc:int_32; {where we are about to look, in |dvi_file|} @@ -394,7 +394,7 @@ procedure bad_dvi; noreturn procedure bad_dvi; @z -@x [111] Fix up opening the binary files +@x [110] Fix up opening the binary files @ To prepare |dvi_file| for input, we |reset| it. @= @@ -407,7 +407,7 @@ dvi_loc:=0; dvi_loc:=0; @z -@x [113] Make dvi_length() and dvi_move() work. +@x [112] Make dvi_length() and dvi_move() work. @p function dvi_length:int_32; begin set_pos(dvi_file,-1); dvi_length:=cur_pos(dvi_file); end; @@ -428,7 +428,7 @@ dvi_loc:=n; end; @z -@x +@x [135] id3(".")("V")("F")(vf_ext); {file name extension for \.{VF} files} id4(".")("O")("V")("F")(ovf_ext); {file name extension for \.{OVF} files} @y @@ -501,7 +501,7 @@ else begin end; @z -@x +@x [151] close_in(vf_file); @y xfclose(vf_file,cur_name); @@ -531,13 +531,13 @@ vf_move_assign; vf_move_assign; @z -@x [175] break is fflush. +@x [176] break is fflush. @d update_terminal == break(output) {empty the terminal output buffer} @y @d update_terminal == fflush(stdout) {empty the terminal output buffer} @z -@x [175] +@x [176] procedure input_ln; {inputs a line from the terminal} var k:0..terminal_line_length; begin if n_opt=0 then @@ -565,7 +565,7 @@ while (k= rewrite(out_file); {prepares to write packed bytes to |out_file|} @y @= @z -@x [238] Use external routine to output bytes. +@x [247] Use external routine to output bytes. @d out_byte(#) == write(out_file,#) {write next \.{DVI} byte} @y @d out_byte(#) == put_byte(#,out_file) {write next \.{DVI} byte} @z -@x [250] String declaration. +@x [260] String declaration. @!comment:packed array[1..comm_length] of char; {preamble comment prefix} @y @!comment:const_c_string; {preamble comment prefix} @z -@x [251] Output the string from 0 to len-1, not 1 to len. +@x [261] Output the string from 0 to len-1, not 1 to len. for k:=1 to comm_length do append_byte(xord[comment[k]]); @y for k:=0 to comm_length - 1 do append_byte(xord[ucharcast(comment[k])]); @z -@x [] System-dependent changes. +@x [293] System-dependent changes. This section should be replaced, if necessary, by changes to the program that are necessary to make \.{DVIcopy} work at a particular installation. It is usually best to design your change file so that all changes to @@ -650,6 +650,7 @@ begin end else if argument_is ('max-pages') then begin max_pages := atou (optarg); + incr (cur_select); end else if argument_is ('page-start') then begin @; @@ -764,6 +765,7 @@ while optarg[m] do begin end; end; start_vals := k; +selected := false; @ An element with all zeros always ends the list. diff --git a/Build/source/texk/web2c/omegaware/odvicopy.test b/Build/source/texk/web2c/omegaware/odvicopy.test index 9b836657c25..bf0f159532c 100755 --- a/Build/source/texk/web2c/omegaware/odvicopy.test +++ b/Build/source/texk/web2c/omegaware/odvicopy.test @@ -1,21 +1,40 @@ #! /bin/sh -# Copyright (C) 2009 Peter Breitenlohner +# Copyright (C) 2009-2015 Peter Breitenlohner # You may freely use, modify and/or distribute this file. tests=omegaware/tests test -d $tests || mkdir -p $tests +echo && echo "*** odvicopy -help" +./odvicopy -help || exit 1 + +echo && echo "*** odvicopy -version" +./odvicopy -version || exit 1 + +# Test page selection +# +echo && echo "*** odvicopy --p=*.*.2 --max=1 pagenum.dvi xpagenum.dvi >xpagenum.log" +TEXMFCNF=$srcdir/../kpathsea \ + TFMFONTS=$srcdir/tests \ + ./odvicopy --p=\*.\*.2 --max=1 $srcdir/tests/pagenum.dvi $tests/xpagenum.dvi \ + >$tests/xpagenum.log || exit 1 + +echo && echo "*** grep '1 page written\.$' xpagenum.log" +grep '1 page written\.$' $tests/xpagenum.log || exit 1 + # First a straight copy # rm -f ofont*vf +echo && echo "*** odvicopy ofontd0 xofontd1 (without VF/OVF files)" TEXMFCNF=$srcdir/../kpathsea \ OFMFONTS=$srcdir/$tests \ OVFFONTS=. \ ./odvicopy $srcdir/$tests/ofontd0 $tests/xofontd1 || exit 1 +echo && echo "*** odvitype xofontd1 >xofontd1.typ" TEXMFCNF=$srcdir/../kpathsea \ OFMFONTS=$srcdir/$tests \ ./odvitype $tests/xofontd1 | sed '1s/ (.*)$//' >$tests/xofontd1.typ || exit 1 @@ -26,26 +45,30 @@ diff $srcdir/$tests/ofontd1.typ $tests/xofontd1.typ || exit 1 # cp $srcdir/$tests/ofontv*vf . +echo && echo "*** odvicopy ofontd1 xofontd2 (with VF/OVF files for ofontv[4-6])" TEXMFCNF=$srcdir/../kpathsea \ OFMFONTS=$srcdir/$tests \ OVFFONTS=. \ ./odvicopy $tests/xofontd1 $tests/xofontd2 || exit 1 +echo && echo "*** odvitype xofontd2 >xofontd2.typ" TEXMFCNF=$srcdir/../kpathsea \ OFMFONTS=$srcdir/$tests \ ./odvitype $tests/xofontd2 | sed '1s/ (.*)$//' >$tests/xofontd2.typ || exit 1 diff $srcdir/$tests/ofontd2.typ $tests/xofontd2.typ || exit 1 -# Finally with OVF files for ofontr[1-3] and ofontv[4-6] +# Finally with VF/OVF files for ofontr[1-3] and ofontv[4-6] # cp $srcdir/$tests/ofontr*vf . +echo && echo "*** odvicopy ofontd0 xofontd3 (with VF/OVF files for ofontr[1-3] and ofontv[4-6])" TEXMFCNF=$srcdir/../kpathsea \ OFMFONTS=$srcdir/$tests \ OVFFONTS=. \ ./odvicopy $srcdir/$tests/ofontd0 $tests/xofontd3 || exit 1 +echo && echo "*** odvitype xofontd3 >xofontd3.typ" TEXMFCNF=$srcdir/../kpathsea \ OFMFONTS=$srcdir/$tests \ ./odvitype $tests/xofontd3 | sed '1s/ (.*)$//' >$tests/xofontd3.typ || exit 1 diff --git a/Build/source/texk/web2c/omegaware/odvicopy.web b/Build/source/texk/web2c/omegaware/odvicopy.web index 7c31f0266ab..6f4e240c146 100644 --- a/Build/source/texk/web2c/omegaware/odvicopy.web +++ b/Build/source/texk/web2c/omegaware/odvicopy.web @@ -2883,8 +2883,7 @@ while cur_parm<>vf_e_fnts[f] do incr(f) @p procedure vf_do_font; var f:font_number; {where the font is sought} @!k:int_31; {general purpose variable} -begin -print('VF: font ',cur_parm:1);@/ +begin print('VF: font ',cur_parm:1);@/ @; if f<>vf_nf then bad_font; font_check(nf):=vf_squad; @@ -3059,7 +3058,7 @@ begin if cur_cmd