summaryrefslogtreecommitdiff
path: root/Build/source/texk/dtl
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2021-01-30 06:34:55 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2021-01-30 06:34:55 +0000
commit3ab06347798570316884448181a7a2e26db88b2b (patch)
tree15589a017dee14000323cb36c2ac4f707ef435a7 /Build/source/texk/dtl
parent0bf3e49d4d147727e1daf1007362a871972b214f (diff)
dtl: Add TL version number and bug report address in usage
git-svn-id: svn://tug.org/texlive/trunk@57559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dtl')
-rw-r--r--Build/source/texk/dtl/ChangeLog8
-rw-r--r--Build/source/texk/dtl/Makefile.am2
-rw-r--r--Build/source/texk/dtl/Makefile.in4
-rw-r--r--Build/source/texk/dtl/config.h.in3
-rwxr-xr-xBuild/source/texk/dtl/configure5
-rw-r--r--Build/source/texk/dtl/configure.ac4
-rw-r--r--Build/source/texk/dtl/dt2dv.c5
-rw-r--r--Build/source/texk/dtl/dtl.h2
-rwxr-xr-xBuild/source/texk/dtl/dtl.test24
-rw-r--r--Build/source/texk/dtl/dv2dt.c26
10 files changed, 73 insertions, 10 deletions
diff --git a/Build/source/texk/dtl/ChangeLog b/Build/source/texk/dtl/ChangeLog
index 4949abdafeb..a94e955348a 100644
--- a/Build/source/texk/dtl/ChangeLog
+++ b/Build/source/texk/dtl/ChangeLog
@@ -1,3 +1,11 @@
+2021-01-30 TANAKA Takuji <ttk@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@t-lab.opal.ne.jp>
* dt2dv.c: Expand buffer size.
diff --git a/Build/source/texk/dtl/Makefile.am b/Build/source/texk/dtl/Makefile.am
index f9bda3ee3a4..83ad9c371a8 100644
--- a/Build/source/texk/dtl/Makefile.am
+++ b/Build/source/texk/dtl/Makefile.am
@@ -28,7 +28,7 @@ dtl.log: dt2dv$(EXEEXT) dv2dt$(EXEEXT)
EXTRA_DIST = edited.txt
-CLEANFILES = testfile.*
+CLEANFILES = testfile*.*
## Not used
##
diff --git a/Build/source/texk/dtl/Makefile.in b/Build/source/texk/dtl/Makefile.in
index 97d1aa3cf26..7bcaba98e52 100644
--- a/Build/source/texk/dtl/Makefile.in
+++ b/Build/source/texk/dtl/Makefile.in
@@ -99,7 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
$(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 @@ dist_check_SCRIPTS = dtl.test
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
diff --git a/Build/source/texk/dtl/config.h.in b/Build/source/texk/dtl/config.h.in
index 87526cbadc4..e6200ff10f4 100644
--- a/Build/source/texk/dtl/config.h.in
+++ b/Build/source/texk/dtl/config.h.in
@@ -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
diff --git a/Build/source/texk/dtl/configure b/Build/source/texk/dtl/configure
index f702fad1adb..40bb5018c07 100755
--- a/Build/source/texk/dtl/configure
+++ b/Build/source/texk/dtl/configure
@@ -13711,6 +13711,11 @@ _ACEOF
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
diff --git a/Build/source/texk/dtl/configure.ac b/Build/source/texk/dtl/configure.ac
index 3a33550205e..d3c85bfa935 100644
--- a/Build/source/texk/dtl/configure.ac
+++ b/Build/source/texk/dtl/configure.ac
@@ -20,6 +20,10 @@ AC_CHECK_SIZEOF(long)
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])
diff --git a/Build/source/texk/dtl/dt2dv.c b/Build/source/texk/dtl/dt2dv.c
index bcfcdc28d37..602a716f8c0 100644
--- a/Build/source/texk/dtl/dt2dv.c
+++ b/Build/source/texk/dtl/dt2dv.c
@@ -377,8 +377,8 @@ main
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 @@ give_help (VOID)
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 */
diff --git a/Build/source/texk/dtl/dtl.h b/Build/source/texk/dtl/dtl.h
index f65518ce940..626016be1c9 100644
--- a/Build/source/texk/dtl/dtl.h
+++ b/Build/source/texk/dtl/dtl.h
@@ -21,6 +21,8 @@
/* version of DTL programs */
#define VERSION "0.6.0"
+#define BUG_ADDRESS "tex-k@tug.org"
+
/* Test for ANSI/ISO Standard C */
#if (defined(__cplusplus) || defined(__STDC__) || defined(c_plusplus))
#define STDC 1
diff --git a/Build/source/texk/dtl/dtl.test b/Build/source/texk/dtl/dtl.test
index 4d08d6b5958..7db5b89fc52 100755
--- a/Build/source/texk/dtl/dtl.test
+++ b/Build/source/texk/dtl/dtl.test
@@ -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
diff --git a/Build/source/texk/dtl/dv2dt.c b/Build/source/texk/dtl/dv2dt.c
index 8b79d5d5b0d..e59ee7d3426 100644
--- a/Build/source/texk/dtl/dv2dt.c
+++ b/Build/source/texk/dtl/dv2dt.c
@@ -146,10 +146,14 @@ COUNT fontdef ARGS((FILE * dvi, FILE * dtl, int n));
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 @@ main
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 @@ postpost
}
/* 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" */