texlive[48902] Build/source/texk/dviout-util: import

commits+hironobu at tug.org commits+hironobu at tug.org
Sat Oct 13 19:43:13 CEST 2018


Revision: 48902
          http://tug.org/svn/texlive?view=revision&revision=48902
Author:   hironobu
Date:     2018-10-13 19:43:13 +0200 (Sat, 13 Oct 2018)
Log Message:
-----------
import aminophen/dviout-util at 6fb3d4a

Modified Paths:
--------------
    trunk/Build/source/texk/dviout-util/ChangeLog
    trunk/Build/source/texk/dviout-util/Makefile.am
    trunk/Build/source/texk/dviout-util/Makefile.in
    trunk/Build/source/texk/dviout-util/configure
    trunk/Build/source/texk/dviout-util/configure.ac
    trunk/Build/source/texk/dviout-util/dvispc.c
    trunk/Build/source/texk/dviout-util/dvispc.test

Added Paths:
-----------
    trunk/Build/source/texk/dviout-util/tests/first.dvi
    trunk/Build/source/texk/dviout-util/tests/first.tex
    trunk/Build/source/texk/dviout-util/tests/firstout.dvi
    trunk/Build/source/texk/dviout-util/tests/firstpn.dvi
    trunk/Build/source/texk/dviout-util/tests/firstpn.tex

Modified: trunk/Build/source/texk/dviout-util/ChangeLog
===================================================================
--- trunk/Build/source/texk/dviout-util/ChangeLog	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/ChangeLog	2018-10-13 17:43:13 UTC (rev 48902)
@@ -1,9 +1,13 @@
 2018-10-14  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
-	* dvispc.c: Fix a bug that modification for tpic_pn was
-	not working (my previous fault). Minimize correction
-	for tpic_pn, report effective tpic_pn properly.
-	* tests/tpicpn.{tex,dvi}, tests/tpicsh.{tex,dvi}: Added.
+	* dvispc.c: Fix a bug that modification of non-stack
+	specials was almost broken (my fault when prior scanning
+	was introduced). Minimize correction for tpic_pn, report
+	effective tpic_pn properly.
+	* tests/tpicpn.{tex,dvi}, tests/tpicsh.{tex,dvi},
+	tests/first.{tex,dvi}, tests/firstpn.{tex,dvi}: New tests.
+	* Makefile.am: Adjusted.
+	* configure.ac: Version 20181014.
 
 2018-10-13  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
@@ -124,7 +128,8 @@
 
 2017-06-03  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
-	* dvispc.c: Support page indendence in reverse order.
+	* dvispc.c: Support page indendence in reverse order by
+	prior scanning.
 
 2017-06-03  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 

Modified: trunk/Build/source/texk/dviout-util/Makefile.am
===================================================================
--- trunk/Build/source/texk/dviout-util/Makefile.am	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/Makefile.am	2018-10-13 17:43:13 UTC (rev 48902)
@@ -35,12 +35,14 @@
 	tests/tpicpn.tex tests/tpicpn.dvi tests/tpicpnout.dvi \
 	tests/tpicsh.tex tests/tpicsh.dvi \
 	tests/reverse.tex tests/reverse.dvi tests/reverseout.dvi \
+	tests/first.tex tests/first.dvi tests/firstout.dvi \
+	tests/firstpn.tex tests/firstpn.dvi \
 	tests/annot.tex tests/annot.dvi \
 	tests/longspec.tex tests/longspec.dvi \
 	tests/flatnest.tex tests/flatnest.dvi
 DISTCLEANFILES = x*oldindep.spc \
 	x*oldindepa.txt x*oldindepax.dvi x*oldindepout.dvi \
-	x*tpicpnout.dvi x*reverseout.dvi \
+	x*tpicpnout.dvi x*reverseout.dvi x*firstout.dvi \
 	x*write.dvi x*writeout.dvi
 
 ## chkdvifont.test

Modified: trunk/Build/source/texk/dviout-util/Makefile.in
===================================================================
--- trunk/Build/source/texk/dviout-util/Makefile.in	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/Makefile.in	2018-10-13 17:43:13 UTC (rev 48902)
@@ -563,15 +563,18 @@
 	tests/oldindep.dvi tests/oldindepout.dvi tests/tpicpn.tex \
 	tests/tpicpn.dvi tests/tpicpnout.dvi tests/tpicsh.tex \
 	tests/tpicsh.dvi tests/reverse.tex tests/reverse.dvi \
-	tests/reverseout.dvi tests/annot.tex tests/annot.dvi \
-	tests/longspec.tex tests/longspec.dvi tests/flatnest.tex \
-	tests/flatnest.dvi tests/oldindep.cfn tests/jis.tfm \
-	tests/jis.cfn tests/eufm10.tfm tests/eufm10.cfn tests/cmr10.pk \
+	tests/reverseout.dvi tests/first.tex tests/first.dvi \
+	tests/firstout.dvi tests/firstpn.tex tests/firstpn.dvi \
+	tests/annot.tex tests/annot.dvi tests/longspec.tex \
+	tests/longspec.dvi tests/flatnest.tex tests/flatnest.dvi \
+	tests/oldindep.cfn tests/jis.tfm tests/jis.cfn \
+	tests/eufm10.tfm tests/eufm10.cfn tests/cmr10.pk \
 	tests/cmr10.cfn tests/upjisr-h.vf tests/upsjir-h.cfn
 DISTCLEANFILES = x*oldindep.spc x*oldindepa.txt x*oldindepax.dvi \
-	x*oldindepout.dvi x*tpicpnout.dvi x*reverseout.dvi x*write.dvi \
-	x*writeout.dvi oldindep.dvi xoldindep.cfn xjis.cfn xeufm10.cfn \
-	xeufm10.ed.cfn xcmr10.cfn xupjisr-h.cfn
+	x*oldindepout.dvi x*tpicpnout.dvi x*reverseout.dvi \
+	x*firstout.dvi x*write.dvi x*writeout.dvi oldindep.dvi \
+	xoldindep.cfn xjis.cfn xeufm10.cfn xeufm10.ed.cfn xcmr10.cfn \
+	xupjisr-h.cfn
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 

Modified: trunk/Build/source/texk/dviout-util/configure
===================================================================
--- trunk/Build/source/texk/dviout-util/configure	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/configure	2018-10-13 17:43:13 UTC (rev 48902)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dviout-util (TeX Live) 20181010.
+# Generated by GNU Autoconf 2.69 for dviout-util (TeX Live) 20181014.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='dviout-util (TeX Live)'
 PACKAGE_TARNAME='dviout-util--tex-live-'
-PACKAGE_VERSION='20181010'
-PACKAGE_STRING='dviout-util (TeX Live) 20181010'
+PACKAGE_VERSION='20181014'
+PACKAGE_STRING='dviout-util (TeX Live) 20181014'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1332,7 +1332,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures dviout-util (TeX Live) 20181010 to adapt to many kinds of systems.
+\`configure' configures dviout-util (TeX Live) 20181014 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1403,7 +1403,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of dviout-util (TeX Live) 20181010:";;
+     short | recursive ) echo "Configuration of dviout-util (TeX Live) 20181014:";;
    esac
   cat <<\_ACEOF
 
@@ -1524,7 +1524,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-dviout-util (TeX Live) configure 20181010
+dviout-util (TeX Live) configure 20181014
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2180,7 +2180,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by dviout-util (TeX Live) $as_me 20181010, which was
+It was created by dviout-util (TeX Live) $as_me 20181014, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -7865,7 +7865,7 @@
 
 # Define the identity of the package.
  PACKAGE='dviout-util--tex-live-'
- VERSION='20181010'
+ VERSION='20181014'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13891,7 +13891,7 @@
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-dviout-util (TeX Live) config.lt 20181010
+dviout-util (TeX Live) config.lt 20181014
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -15496,7 +15496,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by dviout-util (TeX Live) $as_me 20181010, which was
+This file was extended by dviout-util (TeX Live) $as_me 20181014, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15562,7 +15562,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-dviout-util (TeX Live) config.status 20181010
+dviout-util (TeX Live) config.status 20181014
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/texk/dviout-util/configure.ac
===================================================================
--- trunk/Build/source/texk/dviout-util/configure.ac	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/configure.ac	2018-10-13 17:43:13 UTC (rev 48902)
@@ -6,7 +6,7 @@
 dnl   gives unlimited permission to copy and/or distribute it,
 dnl   with or without modifications, as long as this notice is preserved.
 dnl
-AC_INIT([dviout-util (TeX Live)], [20181010], [tex-k at tug.org])
+AC_INIT([dviout-util (TeX Live)], [20181014], [tex-k at tug.org])
 AC_PREREQ([2.65])
 AC_CONFIG_SRCDIR([dvispc.c])
 AC_CONFIG_AUX_DIR([../../build-aux])

Modified: trunk/Build/source/texk/dviout-util/dvispc.c
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.c	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/dvispc.c	2018-10-13 17:43:13 UTC (rev 48902)
@@ -254,8 +254,10 @@
 
 /* non-stack specials */
 char background[MAX_LEN];
+char background_prev[MAX_LEN];
 int  f_background = 0;  /* in each page, 0: not found; 1: found */
 char pdf_bgcolor[MAX_LEN];
+char pdf_bgcolor_prev[MAX_LEN];
 int  f_pdf_bgcolor = 0; /* in each page, 0: not found; 1: found */
 char tpic_pn[MAX_LEN];
 char tpic_pn_prev[MAX_LEN];
@@ -884,10 +886,11 @@
          if((f_mode == EXE2MODIFY) and (f_mode == EXE2CHECK)) */
 
     /* Prior scanning. This ensures page independence in reverse order too,
-       by checking whether non-stack specials appears somewhere in DVI.
+       (e.g. Page 1 & 2 without background (= white) and Page 3 with background)
+       by checking whether non-stack specials (except tpic_pn) appears somewhere in DVI.
        Specials with paired syntax (push/pop, bcolor/ecolor) are already safe
        without pre-scanning, so these are skipped due to f_prescan = 1.
-       Other specials (background, pdf_bgcolor, pn) are handled in this scanning. */
+       Other specials (background, pdf_bgcolor) are handled in this scanning. */
     f_prescan = 1;  /* change behavior of interpret(dvi) */
     for(page = 1; page <= dim->total_page; page++){
         fseek(dvi->file_ptr, dim->page_index[page], SEEK_SET);
@@ -911,18 +914,23 @@
         fseek(dvi->file_ptr, dim->page_index[page], SEEK_SET);
         pos = interpret(dvi->file_ptr); /* scanned the whole page content; now
                                            pos = position of EOP + 1 */
-        if(f_debug){
+        if(f_debug){    /* EXE2CHECK always falls into this */
             fprintf(fp_out, "[%d]", page);
-            /* if(page <= dim->total_page){ */ /* always true inside loop */
             flag = color_depth;
             flag += pdf_color_depth;
             flag += pdf_annot_depth;
             if(background[0] && !f_background){
-                fprintf(fp_out, "\n%s", background);
+                if(!background_prev[0]) /* assume white */
+                    fprintf(fp_out, "\nbackground gray 1");
+                else
+                    fprintf(fp_out, "\n%s", background_prev);
                 flag++;
             }
             if(pdf_bgcolor[0] && !f_pdf_bgcolor){
-                fprintf(fp_out, "\n%s", pdf_bgcolor);
+                if(!pdf_bgcolor_prev[0]) /* assume white */
+                    fprintf(fp_out, "\npdf:bgcolor [1]");
+                else
+                    fprintf(fp_out, "\n%s", pdf_bgcolor_prev);
                 flag++;
             }
             for(count = 0; count < color_depth; count++)
@@ -944,13 +952,17 @@
                 fprintf(fp_out, "\n"); /* at least one special printed */
                 f_needs_corr += flag;
             }
-            /* } */
+        }
+        if(f_mode == EXE2CHECK){
+            if(background[0] && f_background)   /* save current status of background */
+                strncpy(background_prev, background, MAX_LEN);
+            if(pdf_bgcolor[0] && f_pdf_bgcolor) /* save current status of pdf_bgcolor */
+                strncpy(pdf_bgcolor_prev, pdf_bgcolor, MAX_LEN);
             if(tpic_pn[0])  /* save current status of tpic_pn */
                 strncpy(tpic_pn_prev, tpic_pn, MAX_LEN);
-        }
-        if(f_mode == EXE2CHECK)
             continue;  /* skip loop if (f_mode == EXE2CHECK);
                         * remainings in this loop are for (f_mode == EXE2MODIFY) */
+        }
 
         /* [Process 2] At the beginning of each page,
            put non-stack specials if necessary.
@@ -967,11 +979,17 @@
             pdf_color_under--;
         }
         if(background[0] && !f_background){     /* background from the former page is effective */
-            write_sp(fp, background);
+            if(!background_prev[0]) /* assume white */
+                write_sp(fp, "background gray 1");
+            else
+                write_sp(fp, background_prev);
             f_needs_corr++;
         }
         if(pdf_bgcolor[0] && !f_pdf_bgcolor){   /* pdf:bgcolor from the former page is effective */
-            write_sp(fp, pdf_bgcolor);
+            if(!pdf_bgcolor_prev[0]) /* assume white */
+                write_sp(fp, "pdf:bgcolor [1]");
+            else
+                write_sp(fp, pdf_bgcolor_prev);
             f_needs_corr++;
         }
 //        while(pdf_annot_under > 0){ /* recover underflow of pdf:bann ... pdf:eann stack */
@@ -1028,10 +1046,12 @@
             f_needs_corr += color_depth;
             f_needs_corr += pdf_color_depth;
 //            f_needs_corr += pdf_annot_depth;
-            /* Special case for tpic_pn:
-               save current status of tpic_pn now, before it is (probably)
-               overwritten after scanning the whole next page.
-               Note that pn can have different values in the same page! */
+            /* Save current status of now, before it is (probably)
+               overwritten after scanning the whole next page. */
+            if(background[0] && f_background)   /* save current status of background */
+                strncpy(background_prev, background, MAX_LEN);
+            if(pdf_bgcolor[0] && f_pdf_bgcolor) /* save current status of pdf_bgcolor */
+                strncpy(pdf_bgcolor_prev, pdf_bgcolor, MAX_LEN);
             if(tpic_pn[0])  /* save current status of tpic_pn */
                 strncpy(tpic_pn_prev, tpic_pn, MAX_LEN);
         }
@@ -1346,7 +1366,7 @@
                         while(*special && ((uchar)*special) <= ' ')
                             special++;
                         if(!strsubcmp(special, "pn")){          /* pn: tpic pen size */
-                            strncpy(tpic_pn, special, MAX_LEN);
+                            if(!f_prescan) strncpy(tpic_pn, special, MAX_LEN);
                             if(!f_pn)
                                 f_pn = 1;
                         }else if(!f_pn && 

Modified: trunk/Build/source/texk/dviout-util/dvispc.test
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.test	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/dvispc.test	2018-10-13 17:43:13 UTC (rev 48902)
@@ -91,9 +91,18 @@
   if test -f x0tpicshout.dvi; then exit 1; else echo; fi
 
 ## page independence in reverse order which requires prior scanning
-./dvispc -c $testdir/reverse.dvi xreverseout.dvi && \
+./dvispc $testdir/reverse.dvi xreverseout.dvi && \
   cmp $testdir/reverseout.dvi xreverseout.dvi && echo || exit 1
 
+# prior scanning should not mess up
+./dvispc $testdir/first.dvi xfirstout.dvi && \
+  cmp $testdir/firstout.dvi xfirstout.dvi && echo || exit 1
+
+# prior scanning should not mess up (no correction)
+rm -f xfirstpn.dvi
+./dvispc $testdir/firstpn.dvi xfirstpn.dvi && \
+  if test -f xfirstpn.dvi; then exit 1; else echo; fi
+
 # ==== future work start ====
 
 ## page independence of annotation

Added: trunk/Build/source/texk/dviout-util/tests/first.dvi
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/dviout-util/tests/first.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/first.dvi	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/tests/first.dvi	2018-10-13 17:43:13 UTC (rev 48902)

Property changes on: trunk/Build/source/texk/dviout-util/tests/first.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/x-dvi
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/first.tex
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/first.tex	                        (rev 0)
+++ trunk/Build/source/texk/dviout-util/tests/first.tex	2018-10-13 17:43:13 UTC (rev 48902)
@@ -0,0 +1,14 @@
+% page independence in reverse order too
+\documentclass{article}
+\usepackage[dvips]{color}
+\begin{document}
+\Huge
+white
+\newpage
+white
+\newpage
+\pagecolor{red}
+red
+\newpage
+red
+\end{document}


Property changes on: trunk/Build/source/texk/dviout-util/tests/first.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/firstout.dvi
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/dviout-util/tests/firstout.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/firstout.dvi	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/tests/firstout.dvi	2018-10-13 17:43:13 UTC (rev 48902)

Property changes on: trunk/Build/source/texk/dviout-util/tests/firstout.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/x-dvi
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/firstpn.dvi
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/dviout-util/tests/firstpn.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/firstpn.dvi	2018-10-13 15:50:11 UTC (rev 48901)
+++ trunk/Build/source/texk/dviout-util/tests/firstpn.dvi	2018-10-13 17:43:13 UTC (rev 48902)

Property changes on: trunk/Build/source/texk/dviout-util/tests/firstpn.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/x-dvi
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/firstpn.tex
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/firstpn.tex	                        (rev 0)
+++ trunk/Build/source/texk/dviout-util/tests/firstpn.tex	2018-10-13 17:43:13 UTC (rev 48902)
@@ -0,0 +1,28 @@
+% page independence in reverse order should not mess it up
+\documentclass{article}
+\begin{document}
+
+\unitlength 0.001in
+
+No PN (invalid usage for test purpose only)\par
+\begin{picture}(850,550)(-50,-500)
+  \special{ar 400 250 400 250 0 6.28319}%
+  \put(400,-250){\makebox(0,0){document}}%
+\end{picture}
+\newpage
+
+No PN (invalid usage for test purpose only)\par
+\begin{picture}(850,550)(-50,-500)
+  \special{ar 400 250 400 250 0 6.28319}%
+  \put(400,-250){\makebox(0,0){document}}%
+\end{picture}
+\newpage
+
+PN 30 (explicit)\par
+\begin{picture}(850,550)(-50,-500)
+  \special{pn 30}%
+  \special{ar 400 250 400 250 0 6.28319}%
+  \put(400,-250){\makebox(0,0){document}}%
+\end{picture}
+
+\end{document}


Property changes on: trunk/Build/source/texk/dviout-util/tests/firstpn.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the tex-live-commits mailing list