texlive[57559] Build/source/texk/dtl: dtl: Add TL version number and

commits+takuji at tug.org commits+takuji at tug.org
Sat Jan 30 07:34:56 CET 2021


Revision: 57559
          http://tug.org/svn/texlive?view=revision&revision=57559
Author:   takuji
Date:     2021-01-30 07:34:55 +0100 (Sat, 30 Jan 2021)
Log Message:
-----------
dtl: Add TL version number and bug report address in usage

Modified Paths:
--------------
    trunk/Build/source/texk/dtl/ChangeLog
    trunk/Build/source/texk/dtl/Makefile.am
    trunk/Build/source/texk/dtl/Makefile.in
    trunk/Build/source/texk/dtl/config.h.in
    trunk/Build/source/texk/dtl/configure
    trunk/Build/source/texk/dtl/configure.ac
    trunk/Build/source/texk/dtl/dt2dv.c
    trunk/Build/source/texk/dtl/dtl.h
    trunk/Build/source/texk/dtl/dtl.test
    trunk/Build/source/texk/dtl/dv2dt.c

Modified: trunk/Build/source/texk/dtl/ChangeLog
===================================================================
--- trunk/Build/source/texk/dtl/ChangeLog	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/ChangeLog	2021-01-30 06:34:55 UTC (rev 57559)
@@ -1,3 +1,11 @@
+2021-01-30  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* dv2dt.c, dt2dv.c, dtl.h, configure.ac:
+	Show usage when dv2dt is executed without arguments.
+	Show TeX Live version number and bug report address in usage.
+	* Makefile.am, dtl.test:
+	Add new tests.
+
 2019-02-18  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* dt2dv.c: Expand buffer size.

Modified: trunk/Build/source/texk/dtl/Makefile.am
===================================================================
--- trunk/Build/source/texk/dtl/Makefile.am	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/Makefile.am	2021-01-30 06:34:55 UTC (rev 57559)
@@ -28,7 +28,7 @@
 
 EXTRA_DIST = edited.txt
 
-CLEANFILES = testfile.*
+CLEANFILES = testfile*.*
 
 ## Not used
 ##

Modified: trunk/Build/source/texk/dtl/Makefile.in
===================================================================
--- trunk/Build/source/texk/dtl/Makefile.in	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/Makefile.in	2021-01-30 06:34:55 UTC (rev 57559)
@@ -99,7 +99,7 @@
 	$(top_srcdir)/../../m4/ltsugar.m4 \
 	$(top_srcdir)/../../m4/ltversion.m4 \
 	$(top_srcdir)/../../m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
+	$(top_srcdir)/../../version.ac $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -560,7 +560,7 @@
 TESTS = dtl.test
 EXTRA_DIST = edited.txt dtl.doc dvi.doc example.tex hello.tex man2ps \
 	tripvdu.tex
-CLEANFILES = testfile.*
+CLEANFILES = testfile*.*
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 

Modified: trunk/Build/source/texk/dtl/config.h.in
===================================================================
--- trunk/Build/source/texk/dtl/config.h.in	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/config.h.in	2021-01-30 06:34:55 UTC (rev 57559)
@@ -130,6 +130,9 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Define to the current TeX Live version string. */
+#undef TL_VERSION
+
 /* Version number of package */
 #undef VERSION
 

Modified: trunk/Build/source/texk/dtl/configure
===================================================================
--- trunk/Build/source/texk/dtl/configure	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/configure	2021-01-30 06:34:55 UTC (rev 57559)
@@ -13711,6 +13711,11 @@
 ac_config_headers="$ac_config_headers config.h"
 
 
+
+
+$as_echo "#define TL_VERSION \"TeX Live 2021/dev\"" >>confdefs.h
+
+
 kpse_save_CPPFLAGS=$CPPFLAGS
 kpse_save_LIBS=$LIBS
 

Modified: trunk/Build/source/texk/dtl/configure.ac
===================================================================
--- trunk/Build/source/texk/dtl/configure.ac	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/configure.ac	2021-01-30 06:34:55 UTC (rev 57559)
@@ -20,6 +20,10 @@
 
 AC_CONFIG_HEADERS([config.h])
 
+m4_include([../../version.ac])[] dnl define tex_live_version
+AC_DEFINE([TL_VERSION], ["TeX Live tex_live_version()"],
+          [Define to the current TeX Live version string.])
+
 KPSE_KPATHSEA_FLAGS
 
 AC_CONFIG_FILES([Makefile])

Modified: trunk/Build/source/texk/dtl/dt2dv.c
===================================================================
--- trunk/Build/source/texk/dtl/dt2dv.c	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/dt2dv.c	2021-01-30 06:34:55 UTC (rev 57559)
@@ -377,8 +377,8 @@
 
   fprintf (stderr, "\n");
   fprintf (stderr,
-    "Program \"%s\" version %s compiled in %sstandard C.\n",
-    progname, VERSION, C_LEVEL);
+    "Program \"%s\" version %s (%s) compiled in %sstandard C.\n",
+    progname, VERSION, TL_VERSION, C_LEVEL);
 
   /* interpret command line arguments */
 
@@ -447,6 +447,7 @@
     fprintf (stderr, "\n");
   }
   fprintf (stderr, "Messages, like this one, go to stderr.\n");
+  fprintf (stderr, "\nEmail bug reports to %s.\n", BUG_ADDRESS);
 }
 /* give_help */
 

Modified: trunk/Build/source/texk/dtl/dtl.h
===================================================================
--- trunk/Build/source/texk/dtl/dtl.h	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/dtl.h	2021-01-30 06:34:55 UTC (rev 57559)
@@ -21,6 +21,8 @@
 /* version of DTL programs */
 #define VERSION "0.6.0"
 
+#define BUG_ADDRESS "tex-k at tug.org"
+
 /* Test for ANSI/ISO Standard C */
 #if (defined(__cplusplus) || defined(__STDC__) || defined(c_plusplus))
 #define STDC 1

Modified: trunk/Build/source/texk/dtl/dtl.test
===================================================================
--- trunk/Build/source/texk/dtl/dtl.test	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/dtl.test	2021-01-30 06:34:55 UTC (rev 57559)
@@ -6,11 +6,27 @@
 
 ./dt2dv $srcdir/edited.txt testfile.dvi || exit 1
 
-./dv2dt testfile.dvi testfile.dtl || exit 1
+./dv2dt testfile.dvi testfile.dtl || exit 2
 
-./dt2dv testfile.dtl testfile.dvx || exit 1
+./dt2dv testfile.dtl testfile.dvx || exit 3
 
-./dv2dt testfile.dvx testfile.dtx || exit 1
+./dv2dt testfile.dvx testfile.dtx || exit 4
 
-diff testfile.dtl testfile.dtx || exit 1
+cmp testfile.dvi testfile.dvx || exit 5
 
+diff testfile.dtl testfile.dtx || exit 6
+
+./dt2dv -so testfile.dtl > testfile1.dvi || exit 7
+./dt2dv -si testfile2.dvi < testfile.dtl || exit 8
+./dt2dv -so -si < testfile.dtl > testfile3.dvi || exit 9
+
+cmp testfile.dvi testfile1.dvi || exit 10
+cmp testfile.dvi testfile2.dvi || exit 11
+cmp testfile.dvi testfile3.dvi || exit 12
+
+./dv2dt < testfile.dvi > testfile1.dtl || exit 13
+cat testfile.dvi | ./dv2dt > testfile2.dtl || exit 14
+
+diff testfile.dtl testfile1.dtl || exit 15
+diff testfile.dtl testfile2.dtl || exit 16
+

Modified: trunk/Build/source/texk/dtl/dv2dt.c
===================================================================
--- trunk/Build/source/texk/dtl/dv2dt.c	2021-01-30 01:42:07 UTC (rev 57558)
+++ trunk/Build/source/texk/dtl/dv2dt.c	2021-01-30 06:34:55 UTC (rev 57559)
@@ -146,10 +146,14 @@
 COUNT preamble  ARGS((FILE * dvi,  FILE * dtl));
 COUNT postamble ARGS((FILE * dvi,  FILE * dtl));
 COUNT postpost  ARGS((FILE * dvi,  FILE * dtl));
+Void give_help (VOID);
 
 
 const char * program;  /* name of dv2dt program */
 
+#define PRINT_PROGNAME  fprintf (stderr, "%s ", program)
+
+
 int
 main
 #ifdef STDC
@@ -172,8 +176,15 @@
 
   if (argc > 1)
     open_dvi (argv[1], &dvi);
-  else if (!isatty(fileno(dvi)))
+  else
+  {
+    if (isatty(fileno(dvi)))
+    {
+      give_help();
+      return 0;
+    }
     SET_BINARY(fileno(dvi));
+  }
 
   if (argc > 2)
     open_dtl (argv[2], &dtl);
@@ -943,4 +954,17 @@
 }
 /* end postpost */
 
+Void
+give_help (VOID)
+{
+  fprintf (stderr,
+    "Program \"%s\" version %s (%s).\n",
+    program, VERSION, TL_VERSION);
+  fprintf (stderr, "usage:   ");
+  PRINT_PROGNAME;
+  fprintf (stderr, " dvi_file  dtl_file");
+  fprintf (stderr, "\n");
+  fprintf (stderr, "\nEmail bug reports to %s.\n", BUG_ADDRESS);
+}
+
 /* end of "dv2dt.c" */



More information about the tex-live-commits mailing list.