diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-01-16 11:45:40 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-01-16 11:45:40 +0000 |
commit | d0982ab7a20bec41935e679cda7f27ff4e01df15 (patch) | |
tree | 0b57d73bacf1a3e50a19ebbbd666bc0bcb8325db /Build | |
parent | 0e7e4d3fcb2c0a18212824f21ffb8d8e11415c45 (diff) |
psutils 1.23
git-svn-id: svn://tug.org/texlive/trunk@32688 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/README | 12 | ||||
-rw-r--r-- | Build/source/texk/psutils/ChangeLog | 14 | ||||
-rw-r--r-- | Build/source/texk/psutils/Makefile.am | 16 | ||||
-rw-r--r-- | Build/source/texk/psutils/Makefile.in | 89 | ||||
-rw-r--r-- | Build/source/texk/psutils/README | 7 | ||||
-rw-r--r-- | Build/source/texk/psutils/binary-io.h | 1 | ||||
-rw-r--r-- | Build/source/texk/psutils/config.h.in | 20 | ||||
-rwxr-xr-x | Build/source/texk/psutils/configure | 39 | ||||
-rw-r--r-- | Build/source/texk/psutils/configure.ac | 19 | ||||
-rw-r--r-- | Build/source/texk/psutils/data/paper.cfg | 1 | ||||
-rw-r--r-- | Build/source/texk/psutils/paper-size.c | 68 | ||||
-rw-r--r-- | Build/source/texk/psutils/progname.c | 28 | ||||
-rw-r--r-- | Build/source/texk/psutils/progname.h | 25 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.21-PATCHES/TL-Changes | 6 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.21-PATCHES/patch-01-backport | 12 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.21-PATCHES/patch-10-binary-mode | 164 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.21-PATCHES/patch-11-WIN32 | 22 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.21-PATCHES/patch-20-psnup-man | 185 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23-PATCHES/ChangeLog (renamed from Build/source/texk/psutils/psutils-1.21-PATCHES/ChangeLog) | 13 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23-PATCHES/TL-Changes | 6 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23-PATCHES/patch-01-bug-fix | 26 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23-PATCHES/patch-20-texlive | 19 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/ChangeLog | 1 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/LICENSE (renamed from Build/source/texk/psutils/psutils-1.21/LICENSE) | 0 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/Makefile.am (renamed from Build/source/texk/psutils/psutils-1.21/Makefile.am) | 6 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/README (renamed from Build/source/texk/psutils/psutils-1.21/README) | 11 | ||||
-rwxr-xr-x | Build/source/texk/psutils/psutils-1.23/bootstrap (renamed from Build/source/texk/psutils/psutils-1.21/bootstrap) | 0 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/bootstrap.conf (renamed from Build/source/texk/psutils/psutils-1.21/bootstrap.conf) | 42 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/configure.ac (renamed from Build/source/texk/psutils/psutils-1.21/configure.ac) | 28 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/dummy.c (renamed from Build/source/texk/psutils/psutils-1.21/dummy.c) | 0 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/epsffit.1 (renamed from Build/source/texk/psutils/psutils-1.21/epsffit.1) | 42 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/epsffit.c (renamed from Build/source/texk/psutils/psutils-1.21/epsffit.c) | 23 | ||||
-rwxr-xr-x | Build/source/texk/psutils/psutils-1.23/extractres (renamed from Build/source/texk/psutils/psutils-1.21/extractres) | 0 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/extractres.1 (renamed from Build/source/texk/psutils/psutils-1.21/extractres.1) | 23 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/includeres.1 (renamed from Build/source/texk/psutils/psutils-1.21/includeres.1) | 20 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psbook.1 (renamed from Build/source/texk/psutils/psutils-1.21/psbook.1) | 26 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psbook.c (renamed from Build/source/texk/psutils/psutils-1.21/psbook.c) | 23 | ||||
-rwxr-xr-x | Build/source/texk/psutils/psutils-1.23/psjoin (renamed from Build/source/texk/psutils/psutils-1.21/psjoin) | 0 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psjoin.1 (renamed from Build/source/texk/psutils/psutils-1.21/psjoin.1) | 6 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psnup.1 (renamed from Build/source/texk/psutils/psutils-1.21/psnup.1) | 6 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psnup.c (renamed from Build/source/texk/psutils/psutils-1.21/psnup.c) | 55 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psresize.1 (renamed from Build/source/texk/psutils/psutils-1.21/psresize.1) | 54 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psresize.c (renamed from Build/source/texk/psutils/psutils-1.21/psresize.c) | 46 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psselect.1 (renamed from Build/source/texk/psutils/psutils-1.21/psselect.1) | 59 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psselect.c (renamed from Build/source/texk/psutils/psutils-1.21/psselect.c) | 27 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psspec.c (renamed from Build/source/texk/psutils/psutils-1.21/psspec.c) | 8 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psspec.h (renamed from Build/source/texk/psutils/psutils-1.21/psspec.h) | 2 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/pstops.1 (renamed from Build/source/texk/psutils/psutils-1.21/pstops.1) | 71 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/pstops.c (renamed from Build/source/texk/psutils/psutils-1.21/pstops.c) | 37 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psutil.c (renamed from Build/source/texk/psutils/psutils-1.21/psutil.c) | 113 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psutil.h (renamed from Build/source/texk/psutils/psutils-1.21/psutil.h) | 41 | ||||
-rw-r--r-- | Build/source/texk/psutils/psutils-1.23/psutils.1 (renamed from Build/source/texk/psutils/psutils-1.21/psutils.1) | 10 | ||||
-rwxr-xr-x | Build/source/texk/psutils/psutils.test | 6 | ||||
-rw-r--r-- | Build/source/texk/psutils/verror.c | 29 | ||||
-rw-r--r-- | Build/source/texk/psutils/verror.h | 25 | ||||
-rw-r--r-- | Build/source/texk/psutils/version.ac | 4 | ||||
-rw-r--r-- | Build/source/texk/psutils/xvasprintf.h | 1 |
57 files changed, 775 insertions, 862 deletions
diff --git a/Build/source/texk/README b/Build/source/texk/README index 6d7874a19e3..fd160d9fc2d 100644 --- a/Build/source/texk/README +++ b/Build/source/texk/README @@ -49,7 +49,9 @@ dvidvi - ? dviljk - maintained here, by Joachim Schrod -dvipdfmx - maintained here, by Khaled Hosny, Jonathan Kew +dvipdfm-x - maintained here, by Khaled Hosny, Jonathan Kew, contains + dvipdfmx + xdvipdfmx dvipng 1.14 - checked 10may12 http://mirror.ctan.org/dviware/dvipng/ (but maybe stale) @@ -80,10 +82,10 @@ mendexk - maintained here, by us (akira et al.) ps2pkm - ? -psutils 1.21 - checked 25oct13 - https://github.com/rrthomas/psutils/archive/v1.21.tar.gz +psutils 1.23 - checked 16jan14 + https://github.com/rrthomas/psutils/archive/v1.23.tar.gz -ptexenc - ? +ptexenc - maintained here, by us (akira et al.) seetexk - ? @@ -106,5 +108,3 @@ xdv2pdf - maintained here, by Khaled Hosny, Jonathan Kew xdvik 22.86 - checked 7apr13 http://sourceforge.net/projects/xdvi/files/xdvik/ - -xdvipdfmx - maintained here, by Khaled Hosny, Jonathan Kew diff --git a/Build/source/texk/psutils/ChangeLog b/Build/source/texk/psutils/ChangeLog index b740adc8e0b..f3657931d28 100644 --- a/Build/source/texk/psutils/ChangeLog +++ b/Build/source/texk/psutils/ChangeLog @@ -1,3 +1,17 @@ +2014-01-16 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import psutils-1.23. + * version.ac: Adapted. + + * README (new): PostScript Utilities for TeX Live. + * paper-size.c (new): Implement paper_size(). + * progname.[ch], verror.[ch]: New files simulating gnulib. + * binary-io.h, xvasprintf.h (new): Empty. + * configure.ac: Additional code for config.h. + * Makefile.am: Adapted. + + * psutils.test: The test now needs environment variables. + 2014-01-13 Peter Breitenlohner <peb@mppmu.mpg.de> * Makefile.am, /ac/withenable.ac, configure.ac: diff --git a/Build/source/texk/psutils/Makefile.am b/Build/source/texk/psutils/Makefile.am index b190eadcea0..e6629e026f3 100644 --- a/Build/source/texk/psutils/Makefile.am +++ b/Build/source/texk/psutils/Makefile.am @@ -12,12 +12,19 @@ EXTRA_DIST += $(PSUTILS_TREE)-PATCHES dist-hook: rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'` -AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(LIBPAPER_INCLUDES) -D_Noreturn= -D_GL_ATTRIBUTE_CONST= +AM_CPPFLAGS = -I$(srcdir)/$(PSUTILS_TREE) $(KPATHSEA_INCLUDES) $(LIBPAPER_INCLUDES) AM_CFLAGS = $(WARNING_CFLAGS) noinst_LIBRARIES = libpsutils.a libpsutils_a_SOURCES = \ + binary-io.h \ + paper-size.c \ + progname.c \ + progname.h \ + verror.h \ + verror.c \ + xvasprintf.h \ @PSUTILS_TREE@/psspec.c \ @PSUTILS_TREE@/psspec.h \ @PSUTILS_TREE@/psutil.c \ @@ -58,6 +65,8 @@ install-data-hook: install-perl-links uninstall-hook: uninstall-links +## Manpages +## man1_MANS = \ @PSUTILS_TREE@/epsffit.1 \ @PSUTILS_TREE@/extractres.1 \ @@ -70,6 +79,11 @@ man1_MANS = \ @PSUTILS_TREE@/pstops.1 \ @PSUTILS_TREE@/psutils.1 +## Data +## +configdatadir = $(datarootdir)/texmf-dist/psutils +dist_configdata_DATA = data/paper.cfg + ## Rebuild libkpathsea @KPATHSEA_RULE@ ## Rebuild libpaper diff --git a/Build/source/texk/psutils/Makefile.in b/Build/source/texk/psutils/Makefile.in index 5f75d25249a..50e0b4d1873 100644 --- a/Build/source/texk/psutils/Makefile.in +++ b/Build/source/texk/psutils/Makefile.in @@ -16,6 +16,7 @@ + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -85,10 +86,10 @@ bin_PROGRAMS = epsffit$(EXEEXT) psbook$(EXEEXT) psnup$(EXEEXT) \ DIST_COMMON = $(srcdir)/../../am/script_links.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(srcdir)/config.h.in \ - $(top_srcdir)/psutils-1.21/extractres \ - $(top_srcdir)/psutils-1.21/psjoin \ - $(top_srcdir)/../../build-aux/depcomp \ - $(top_srcdir)/../../build-aux/test-driver ChangeLog \ + $(top_srcdir)/psutils-1.23/extractres \ + $(top_srcdir)/psutils-1.23/psjoin \ + $(top_srcdir)/../../build-aux/depcomp $(dist_configdata_DATA) \ + $(top_srcdir)/../../build-aux/test-driver ChangeLog README \ ../../build-aux/compile ../../build-aux/config.guess \ ../../build-aux/config.sub ../../build-aux/depcomp \ ../../build-aux/install-sh ../../build-aux/missing \ @@ -131,11 +132,13 @@ am__v_AR_1 = libpsutils_a_AR = $(AR) $(ARFLAGS) libpsutils_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp -am_libpsutils_a_OBJECTS = @PSUTILS_TREE@/psspec.$(OBJEXT) \ +am_libpsutils_a_OBJECTS = paper-size.$(OBJEXT) progname.$(OBJEXT) \ + verror.$(OBJEXT) @PSUTILS_TREE@/psspec.$(OBJEXT) \ @PSUTILS_TREE@/psutil.$(OBJEXT) libpsutils_a_OBJECTS = $(am_libpsutils_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)" + "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(configdatadir)" PROGRAMS = $(bin_PROGRAMS) am_epsffit_OBJECTS = @PSUTILS_TREE@/epsffit.$(OBJEXT) epsffit_OBJECTS = $(am_epsffit_OBJECTS) @@ -248,6 +251,7 @@ am__can_run_installinfo = \ man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man1_MANS) +DATA = $(dist_configdata_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -591,10 +595,17 @@ EXTRA_DIST = $(PSUTILS_TREE) $(PSUTILS_TREE)-PATCHES \ tests/playps.2 tests/playres.ps tests/playsel.2 \ tests/playsel1.2 tests/plot.eps tests/ploth.eps \ tests/plotm.eps tests/plotv.eps -AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(LIBPAPER_INCLUDES) -D_Noreturn= -D_GL_ATTRIBUTE_CONST= +AM_CPPFLAGS = -I$(srcdir)/$(PSUTILS_TREE) $(KPATHSEA_INCLUDES) $(LIBPAPER_INCLUDES) AM_CFLAGS = $(WARNING_CFLAGS) noinst_LIBRARIES = libpsutils.a libpsutils_a_SOURCES = \ + binary-io.h \ + paper-size.c \ + progname.c \ + progname.h \ + verror.h \ + verror.c \ + xvasprintf.h \ @PSUTILS_TREE@/psspec.c \ @PSUTILS_TREE@/psspec.h \ @PSUTILS_TREE@/psutil.c \ @@ -631,6 +642,8 @@ man1_MANS = \ @PSUTILS_TREE@/pstops.1 \ @PSUTILS_TREE@/psutils.1 +configdatadir = $(datarootdir)/texmf-dist/psutils +dist_configdata_DATA = data/paper.cfg TESTS = psutils.test DISTCLEANFILES = play*.2 play*.ps plot*.eps all: config.h @@ -869,6 +882,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paper-size.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/epsffit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/psbook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/psnup.Po@am__quote@ @@ -951,6 +967,27 @@ uninstall-man1: } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-dist_configdataDATA: $(dist_configdata_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_configdata_DATA)'; test -n "$(configdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(configdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(configdatadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdatadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(configdatadir)" || exit $$?; \ + done + +uninstall-dist_configdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_configdata_DATA)'; test -n "$(configdatadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(configdatadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -1336,9 +1373,10 @@ distcleancheck: distclean check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h +all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ + config.h installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(configdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1384,7 +1422,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool \ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf @PSUTILS_TREE@/$(DEPDIR) + -rm -rf ./$(DEPDIR) @PSUTILS_TREE@/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags @@ -1401,7 +1439,8 @@ info: info-am info-am: -install-data-am: install-man install-texmfSCRIPTS +install-data-am: install-dist_configdataDATA install-man \ + install-texmfSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am @@ -1433,7 +1472,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf @PSUTILS_TREE@/$(DEPDIR) + -rm -rf ./$(DEPDIR) @PSUTILS_TREE@/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1450,8 +1489,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-man \ - uninstall-nodist_binSCRIPTS uninstall-texmfSCRIPTS +uninstall-am: uninstall-binPROGRAMS uninstall-dist_configdataDATA \ + uninstall-man uninstall-nodist_binSCRIPTS \ + uninstall-texmfSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 @@ -1468,16 +1508,17 @@ uninstall-man: uninstall-man1 distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ - install-data-am install-data-hook install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-man1 \ - install-nodist_binSCRIPTS install-pdf install-pdf-am \ - install-ps install-ps-am install-strip install-texmfSCRIPTS \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-hook uninstall-man \ + install-data-am install-data-hook install-dist_configdataDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-man1 install-nodist_binSCRIPTS install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-texmfSCRIPTS installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am recheck tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS \ + uninstall-dist_configdataDATA uninstall-hook uninstall-man \ uninstall-man1 uninstall-nodist_binSCRIPTS \ uninstall-texmfSCRIPTS diff --git a/Build/source/texk/psutils/README b/Build/source/texk/psutils/README new file mode 100644 index 00000000000..6b37866b3a6 --- /dev/null +++ b/Build/source/texk/psutils/README @@ -0,0 +1,7 @@ +PostScript Utilities for TeX Live + +For TeX Live we can not use paper_size() from psutil.c because the default +papersize is given in the file paper.cfg to be found somewhere in the TDS +hierarchy. Therefore we supply our onw paper_size() in paper-size.c, using +the kpathsea library to locate that file and use that library to handle all +portability issues. diff --git a/Build/source/texk/psutils/binary-io.h b/Build/source/texk/psutils/binary-io.h new file mode 100644 index 00000000000..146d1b1fdbc --- /dev/null +++ b/Build/source/texk/psutils/binary-io.h @@ -0,0 +1 @@ +/* binary-io.h: empty */ diff --git a/Build/source/texk/psutils/config.h.in b/Build/source/texk/psutils/config.h.in index 9812d1a804e..df55454a3f0 100644 --- a/Build/source/texk/psutils/config.h.in +++ b/Build/source/texk/psutils/config.h.in @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +#ifndef _PSUTILS_CONFIG_H +#define _PSUTILS_CONFIG_H 1 + /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID @@ -175,4 +178,19 @@ such a type exists and the standard includes do not define it. */ #undef uint64_t -#include <kpathsea/getopt.h> +#include <kpathsea/kpathsea.h> + +#define _Noreturn +#define _GL_ATTRIBUTE_CONST + +#ifdef WIN32 +# define set_binary_mode(file, mode) _setmode(file, mode) +# ifndef __MINGW32__ +# define ftello _ftelli64 +# define fseeko _fseeki64 +# endif +#else +# define set_binary_mode(file, mode) 0 +#endif + +#endif /* _PSUTILS_CONFIG_H */ diff --git a/Build/source/texk/psutils/configure b/Build/source/texk/psutils/configure index a0d89371a7c..261b1e63b08 100755 --- a/Build/source/texk/psutils/configure +++ b/Build/source/texk/psutils/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for psutils (TeX Live) 1.21. +# Generated by GNU Autoconf 2.69 for psutils (TeX Live) 1.23. # # Report bugs to <tex-k@tug.org>. # @@ -590,12 +590,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='psutils (TeX Live)' PACKAGE_TARNAME='psutils--tex-live-' -PACKAGE_VERSION='1.21' -PACKAGE_STRING='psutils (TeX Live) 1.21' +PACKAGE_VERSION='1.23' +PACKAGE_STRING='psutils (TeX Live) 1.23' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="psutils-1.21/psutil.c" +ac_unique_file="psutils-1.23/psutil.c" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> @@ -1337,7 +1337,7 @@ if test "$ac_init_help" = "long"; then # 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 psutils (TeX Live) 1.21 to adapt to many kinds of systems. +\`configure' configures psutils (TeX Live) 1.23 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1408,7 +1408,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of psutils (TeX Live) 1.21:";; + short | recursive ) echo "Configuration of psutils (TeX Live) 1.23:";; esac cat <<\_ACEOF @@ -1530,7 +1530,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -psutils (TeX Live) configure 1.21 +psutils (TeX Live) configure 1.23 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2140,7 +2140,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by psutils (TeX Live) $as_me 1.21, which was +It was created by psutils (TeX Live) $as_me 1.23, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -7630,7 +7630,7 @@ fi # Define the identity of the package. PACKAGE='psutils--tex-live-' - VERSION='1.21' + VERSION='1.23' cat >>confdefs.h <<_ACEOF @@ -12935,6 +12935,7 @@ ac_config_headers="$ac_config_headers config.h" + kpse_save_CPPFLAGS=$CPPFLAGS kpse_save_LIBS=$LIBS @@ -13349,7 +13350,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -psutils (TeX Live) config.lt 1.21 +psutils (TeX Live) config.lt 1.23 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -14495,17 +14496,17 @@ fi -PSUTILS_TREE=psutils-1.21 +PSUTILS_TREE=psutils-1.23 ac_config_files="$ac_config_files Makefile" -ac_config_links="$ac_config_links extractres.pl:psutils-1.21/extractres" +ac_config_links="$ac_config_links extractres.pl:psutils-1.23/extractres" -ac_config_links="$ac_config_links includeres.pl:psutils-1.21/extractres" +ac_config_links="$ac_config_links includeres.pl:psutils-1.23/extractres" -ac_config_links="$ac_config_links psjoin.pl:psutils-1.21/psjoin" +ac_config_links="$ac_config_links psjoin.pl:psutils-1.23/psjoin" cat >confcache <<\_ACEOF @@ -15050,7 +15051,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by psutils (TeX Live) $as_me 1.21, which was +This file was extended by psutils (TeX Live) $as_me 1.23, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15120,7 +15121,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -psutils (TeX Live) config.status 1.21 +psutils (TeX Live) config.status 1.23 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -15533,9 +15534,9 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "extractres.pl") CONFIG_LINKS="$CONFIG_LINKS extractres.pl:psutils-1.21/extractres" ;; - "includeres.pl") CONFIG_LINKS="$CONFIG_LINKS includeres.pl:psutils-1.21/extractres" ;; - "psjoin.pl") CONFIG_LINKS="$CONFIG_LINKS psjoin.pl:psutils-1.21/psjoin" ;; + "extractres.pl") CONFIG_LINKS="$CONFIG_LINKS extractres.pl:psutils-1.23/extractres" ;; + "includeres.pl") CONFIG_LINKS="$CONFIG_LINKS includeres.pl:psutils-1.23/extractres" ;; + "psjoin.pl") CONFIG_LINKS="$CONFIG_LINKS psjoin.pl:psutils-1.23/psjoin" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/Build/source/texk/psutils/configure.ac b/Build/source/texk/psutils/configure.ac index 0e493ca683d..aa6249d229a 100644 --- a/Build/source/texk/psutils/configure.ac +++ b/Build/source/texk/psutils/configure.ac @@ -17,7 +17,24 @@ KPSE_COMMON([psutils]) AC_CONFIG_HEADERS([config.h]) -AH_BOTTOM([#include <kpathsea/getopt.h>]) +AH_TOP([#ifndef _PSUTILS_CONFIG_H +#define _PSUTILS_CONFIG_H 1]) +AH_BOTTOM([#include <kpathsea/kpathsea.h> + +#define _Noreturn +#define _GL_ATTRIBUTE_CONST + +#ifdef WIN32 +# define set_binary_mode(file, mode) _setmode(file, mode) +# ifndef __MINGW32__ +# define ftello _ftelli64 +# define fseeko _fseeki64 +# endif +#else +# define set_binary_mode(file, mode) 0 +#endif + +#endif /* _PSUTILS_CONFIG_H */]) KPSE_KPATHSEA_FLAGS KPSE_LIBPAPER_FLAGS diff --git a/Build/source/texk/psutils/data/paper.cfg b/Build/source/texk/psutils/data/paper.cfg new file mode 100644 index 00000000000..35455ecc2d8 --- /dev/null +++ b/Build/source/texk/psutils/data/paper.cfg @@ -0,0 +1 @@ +a4 # default papersize diff --git a/Build/source/texk/psutils/paper-size.c b/Build/source/texk/psutils/paper-size.c new file mode 100644 index 00000000000..2a0ed5b3749 --- /dev/null +++ b/Build/source/texk/psutils/paper-size.c @@ -0,0 +1,68 @@ +/* paper-size.c: TeX Live specific definition of paper_size() + + Copyright 2014 Peter Breitenlohner. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include <psutil.h> +#include <paper.h> + +#define CONFIG_NAME "paper.cfg" +#define MAX_PAPER 16 +static char default_paper[MAX_PAPER]; + +static void +do_init (void) +{ + static int inited = 0; + int ch, i = 0; + char *fqpn; + FILE *fp = NULL; + + if (inited) + return; + + paperinit (); + + fqpn = kpse_find_file (CONFIG_NAME, kpse_program_text_format, false); + if (fqpn) + fp = fopen (fqpn, "r"); + if (!fp) + die ("can't open config file %s", CONFIG_NAME); + + while (i < MAX_PAPER - 1 && + (ch = fgetc (fp)) > 0 && ch != ' ' && ch != '\n' && ch != '\r') + default_paper[i++] = ch; + default_paper[i] = 0; + if (i == 0) + die ("can't read default papersize from file %s", CONFIG_NAME); + + inited = 1; +} + +int +paper_size (const char *paper_name, double *width, double *height) +{ + const struct paper *pi; + + do_init (); + + if (!(pi = paperinfo (paper_name ? paper_name : default_paper))) + return 0; + + *width = paperpswidth (pi); + *height = paperpsheight (pi); + return 1; +} diff --git a/Build/source/texk/psutils/progname.c b/Build/source/texk/psutils/progname.c new file mode 100644 index 00000000000..9d5d5f4f3a5 --- /dev/null +++ b/Build/source/texk/psutils/progname.c @@ -0,0 +1,28 @@ +/* progname.c: TeX Live specific definitions + + Copyright 2014 Peter Breitenlohner. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include <progname.h> + +const char *program_name; + +void +set_program_name (const char *argv0) +{ + kpse_set_program_name(argv0, "psutils"); + program_name = kpse_def->program_name; +} diff --git a/Build/source/texk/psutils/progname.h b/Build/source/texk/psutils/progname.h new file mode 100644 index 00000000000..e9f1a983462 --- /dev/null +++ b/Build/source/texk/psutils/progname.h @@ -0,0 +1,25 @@ +/* progname.h: TeX Live specific declarations + + Copyright 2014 Peter Breitenlohner. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _PROGNAME_H +#define _PROGNAME_H 1 + +extern const char *program_name; + +extern void set_program_name (const char *argv0); + +#endif /* _PROGNAME_H */ diff --git a/Build/source/texk/psutils/psutils-1.21-PATCHES/TL-Changes b/Build/source/texk/psutils/psutils-1.21-PATCHES/TL-Changes deleted file mode 100644 index 96528b891a5..00000000000 --- a/Build/source/texk/psutils/psutils-1.21-PATCHES/TL-Changes +++ /dev/null @@ -1,6 +0,0 @@ -Changes applied to the psutils-1.21 tree as obtained from: - https://github.com/rrthomas/psutils/archive/v1.21.tar.gz - -Remove: - .gitignore - diff --git a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-01-backport b/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-01-backport deleted file mode 100644 index 1eca478234d..00000000000 --- a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-01-backport +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur psutils-1.21/psspec.c ../../psutils-git/psspec.c ---- psutils-1.21/psspec.c 2013-10-21 23:28:08.000000000 +0200 -+++ ../../psutils-git/psspec.c 2013-10-24 09:54:36.000000000 +0200 -@@ -6,6 +6,8 @@ - * See file LICENSE for details. - */ - -+#include "config.h" -+ - #include "psutil.h" - #include "psspec.h" - diff --git a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-10-binary-mode b/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-10-binary-mode deleted file mode 100644 index ddb38186dc2..00000000000 --- a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-10-binary-mode +++ /dev/null @@ -1,164 +0,0 @@ -diff -ur psutils-1.21.orig/epsffit.c psutils-1.21/epsffit.c ---- psutils-1.21.orig/epsffit.c 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/epsffit.c 2013-10-25 13:06:05.000000000 +0200 -@@ -17,7 +17,9 @@ - #include <stdlib.h> - #include <string.h> - #include <ctype.h> -+#ifdef HAVE_UNISTD_H - #include <unistd.h> -+#endif - - #include "psutil.h" - -@@ -37,6 +39,9 @@ - FILE *output = stdout; - int opt; - -+ SET_BINARY(stdin); -+ SET_BINARY(stdout); -+ - program = *argv; - - while((opt = getopt(argc, argv, "csramv")) != EOF) { -diff -ur psutils-1.21.orig/psbook.c psutils-1.21/psbook.c ---- psutils-1.21.orig/psbook.c 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/psbook.c 2013-10-25 13:06:05.000000000 +0200 -@@ -7,9 +7,9 @@ - */ - - #include "config.h" -- -+#ifdef HAVE_UNISTD_H - #include <unistd.h> -- -+#endif - #include "psutil.h" - - const char *syntax = "[-q] [-sSIGNATURE] [INFILE [OUTFILE]]\n SIGNATURE must be positive and divisible by 4\n"; -@@ -23,6 +23,9 @@ - int currentpg, maxpage; - int opt; - -+ SET_BINARY(stdin); -+ SET_BINARY(stdout); -+ - verbose = 1; - program = *argv; - -diff -ur psutils-1.21.orig/psnup.c psutils-1.21/psnup.c ---- psutils-1.21.orig/psnup.c 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/psnup.c 2013-10-25 13:06:05.000000000 +0200 -@@ -7,8 +7,9 @@ - */ - - #include "config.h" -- -+#ifdef HAVE_UNISTD_H - #include <unistd.h> -+#endif - #include <string.h> - #include <paper.h> - -@@ -49,6 +50,9 @@ - int opt; - const struct paper *paper = NULL; - -+ SET_BINARY(stdin); -+ SET_BINARY(stdout); -+ - set_paper_size(NULL); - - margin = border = vshift = hshift = column = flip = 0; -diff -ur psutils-1.21.orig/psresize.c psutils-1.21/psresize.c ---- psutils-1.21.orig/psresize.c 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/psresize.c 2013-10-25 13:06:05.000000000 +0200 -@@ -7,8 +7,9 @@ - */ - - #include "config.h" -- -+#ifdef HAVE_UNISTD_H - #include <unistd.h> -+#endif - #include <paper.h> - - #include "psutil.h" -@@ -32,6 +33,9 @@ - int opt; - const struct paper *paper = NULL; - -+ SET_BINARY(stdin); -+ SET_BINARY(stdout); -+ - set_paper_size(NULL); - - vshift = hshift = 0; -diff -ur psutils-1.21.orig/psselect.c psutils-1.21/psselect.c ---- psutils-1.21.orig/psselect.c 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/psselect.c 2013-10-25 13:06:05.000000000 +0200 -@@ -7,9 +7,9 @@ - */ - - #include "config.h" -- -+#ifdef HAVE_UNISTD_H - #include <unistd.h> -- -+#endif - #include "psutil.h" - - const char *syntax = "[-q] [-e] [-o] [-r] [-pPAGES] [INFILE [OUTFILE]]\n"; -@@ -88,6 +88,9 @@ - int pass, all; - PageRange *pagerange = NULL; - -+ SET_BINARY(stdin); -+ SET_BINARY(stdout); -+ - verbose = 1; - program = *argv; - -diff -ur psutils-1.21.orig/pstops.c psutils-1.21/pstops.c ---- psutils-1.21.orig/pstops.c 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/pstops.c 2013-10-25 13:06:05.000000000 +0200 -@@ -7,8 +7,9 @@ - */ - - #include "config.h" -- -+#ifdef HAVE_UNISTD_H - #include <unistd.h> -+#endif - #include <string.h> - #include <paper.h> - -@@ -107,6 +108,9 @@ - const struct paper *paper = NULL; - int opt; - -+ SET_BINARY(stdin); -+ SET_BINARY(stdout); -+ - set_paper_size(NULL); - - verbose = 1; -diff -ur psutils-1.21.orig/psutil.h psutils-1.21/psutil.h ---- psutils-1.21.orig/psutil.h 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/psutil.h 2013-10-25 13:06:05.000000000 +0200 -@@ -21,6 +21,15 @@ - #define WARN (MESSAGE_NL|MESSAGE_PROGRAM) - #define LOG 0 - -+/* change mode of a file pointer on Windows */ -+#if defined(WIN32) -+#include <io.h> -+#include <fcntl.h> -+#define SET_BINARY(fp) (void)_setmode(fileno(fp), _O_BINARY) -+#else /* !WIN32 */ -+#define SET_BINARY(fp) (void)0 -+#endif -+ - /* Definitions for functions found in psutil.c */ - extern void usage(void); - extern void message(int flags, const char *format, ...); diff --git a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-11-WIN32 b/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-11-WIN32 deleted file mode 100644 index 2490a1b0642..00000000000 --- a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-11-WIN32 +++ /dev/null @@ -1,22 +0,0 @@ -diff -ur psutils-1.21.orig/psutil.h psutils-1.21/psutil.h ---- psutils-1.21.orig/psutil.h 2013-10-25 13:06:05.000000000 +0200 -+++ psutils-1.21/psutil.h 2013-10-28 10:39:53.000000000 +0100 -@@ -26,6 +26,18 @@ - #include <io.h> - #include <fcntl.h> - #define SET_BINARY(fp) (void)_setmode(fileno(fp), _O_BINARY) -+#undef off_t -+#undef ftello -+#undef fseeko -+#if defined(__MINGW32__) -+#define off_t off64_t -+#define ftello ftello64 -+#define fseeko fseeko64 -+#else -+#define off_t __int64 -+#define ftello _ftelli64 -+#define fseeko _fseeki64 -+#endif - #else /* !WIN32 */ - #define SET_BINARY(fp) (void)0 - #endif diff --git a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-20-psnup-man b/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-20-psnup-man deleted file mode 100644 index bbfc848c878..00000000000 --- a/Build/source/texk/psutils/psutils-1.21-PATCHES/patch-20-psnup-man +++ /dev/null @@ -1,185 +0,0 @@ -diff -ur psutils-1.21.orig/psnup.1 psutils-1.21/psnup.1 ---- psutils-1.21.orig/psnup.1 2013-10-21 23:28:08.000000000 +0200 -+++ psutils-1.21/psnup.1 2013-12-04 11:12:43.000000000 +0100 -@@ -3,53 +3,32 @@ - psnup \- multiple pages per sheet - .SH SYNOPSIS - .B psnup --[ --.B \-w\fIwidth\fR --] [ --.B \-h\fIheight\fR --] [ --.B \-p\fIpaper\fR --] [ --.B \-W\fIwidth\fR --] [ --.B \-H\fIheight\fR --] [ --.B \-P\fIpaper\fR --] [ --.B \-l --] [ --.B \-r --] [ --.B \-f --] [ --.B \-c --] [ --.B \-m\fImargin\fR --] [ --.B \-b\fIborder\fR --] [ --.B \-d\fIlwidth\fR --] [ --.B \-s\fIscale\fR --] [ --.B \-n\fIup\fR --] [ --.B \-q --] [ --.I infile --[ --.I outfile --] ] -+.RB [ \-w\fIwidth\fR ] -+.RB [ \-h\fIheight\fR ] -+.RB [ \-p\fIpaper\fR ] -+.RB [ \-W\fIwidth\fR ] -+.RB [ \-H\fIheight\fR ] -+.RB [ \-P\fIpaper\fR ] -+.RB [ \-l | \-r | \-f ] -+.RB [ \-c ] -+.RB [ \-m\fImargin\fR ] -+.RB [ \-b\fIborder\fR ] -+.RB [ \-d [ \fIlwidth\fR ]] -+.RB [ \-s\fIscale\fR ] -+.RB [ \-\fInup\fR ] -+.RB [ \-q ] -+.RI [ infile -+.RI [ outfile ]] - .SH DESCRIPTION --.I Psnup -+.B Psnup - puts multiple logical pages onto each physical sheet of paper. - The input PostScript file should follow the Adobe Document Structuring - Conventions. - .PP - The --.I \-w -+.B \-w - option gives the paper width, and the --.I \-h -+.B \-h - option gives the paper height, specified in - .BR pt , - .BR mm , -@@ -57,79 +36,80 @@ - or - .BR in . - The --.I \-p -+.B \-p - option can be used instead, to set the paper size; otherwise a default value is used. - See - .BR papersize (5). - The --.I \-W, \-H, -+.BR \-W , -+.BR \-H , - and --.I \-P -+.B \-P - options set the input paper size, if it is different from the output - size. This makes it easy to impose pages of one size on a different size of - paper. - .PP - The --.I \-l -+.B \-l - option should be used for pages which are in landscape orientation (rotated 90 - degrees anticlockwise). The --.I \-r -+.B \-r - option should be used for pages which are in seascape orientation (rotated 90 - degrees clockwise), and the --.I \-f -+.B \-f - option should be used for pages which have the width and height interchanged, - but are not rotated. - .PP --.I Psnup -+.B Psnup - normally uses `row-major' layout, where adjacent pages are placed in rows - across the paper. - The --.I \-c -+.B \-c - option changes the order to `column-major', where successive pages are placed - in columns down the paper. - .PP - A margin to leave around the whole page can be specified with the --.I \-m -+.B \-m - option. This is useful for sheets of `thumbnail' pages, because the normal - page margins are reduced by putting multiple pages on a single sheet. - .PP - The --.I \-b -+.B \-b - option is used to specify an additional margin around each page on a sheet. - .PP - The --.I \-d -+.B \-d - option draws a line around the border of each page, of the specified width. - If the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is - assumed. The linewidth is relative to the original page dimensions, --\fIi.e.\fR it is scaled down with the rest of the page. -+i.e., it is scaled down with the rest of the page. - .PP - The scale chosen by --.I psnup -+.B psnup - can be overridden with the --.I \-s -+.B \-s - option. This is useful to merge pages which are already reduced. - .PP - The --.I \-\fInup\fR -+.BI \- nup - option selects the number of logical pages to put on each sheet of paper. This - can be any whole number; --.I psnup -+.B psnup - tries to optimise the layout so that the minimum amount of space is wasted. If --.I psnup -+.B psnup - cannot find a layout within its tolerance limit, it will abort with an error - message. The alternative form --.I \i \fInup\fR -+.BI \-n nup - can also be used, for compatibility with other n-up programs. - .PP --.I Psnup -+.B Psnup - normally prints the page numbers of the pages re-arranged; the --.I \-q -+.B \-q - option suppresses this. - .SH EXAMPLES - The potential use of this utility is varied but one particular - use is in conjunction with --.I psbook(1). -+.BR psbook (1). - For example, using groff to create a PostScript document and lpr as - the - .SM UNIX -@@ -151,5 +131,5 @@ - .B PostScript - is a trademark of Adobe Systems Incorporated. - .SH BUGS --.I Psnup -+.B Psnup - does not accept all DSC comments. diff --git a/Build/source/texk/psutils/psutils-1.21-PATCHES/ChangeLog b/Build/source/texk/psutils/psutils-1.23-PATCHES/ChangeLog index 3d3b2d38a7e..923c64493ff 100644 --- a/Build/source/texk/psutils/psutils-1.21-PATCHES/ChangeLog +++ b/Build/source/texk/psutils/psutils-1.23-PATCHES/ChangeLog @@ -1,3 +1,16 @@ +2014-01-16 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import psutils-1.23. + + * patch-01-backport, patch-10-binary-mode, patch-11-WIN32, + patch-20-psnup-man (all removed): Obsolete. + + * patch-01-bug-fix (new): Rename program => program_name. + + * patch-20-texlive (new): For TeX Live we can not use + paper_size() from psutil.c because the default papersize is + given in a file to be found somewhere in the TDS hierarchy. + 2013-11-21 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-12-getopt (removed): Now using getopt() from kpathsea. diff --git a/Build/source/texk/psutils/psutils-1.23-PATCHES/TL-Changes b/Build/source/texk/psutils/psutils-1.23-PATCHES/TL-Changes new file mode 100644 index 00000000000..4543a57a63c --- /dev/null +++ b/Build/source/texk/psutils/psutils-1.23-PATCHES/TL-Changes @@ -0,0 +1,6 @@ +Changes applied to the psutils-1.23 tree as obtained from: + https://github.com/rrthomas/psutils/archive/v1.23.tar.gz + +Remove: + .gitignore + diff --git a/Build/source/texk/psutils/psutils-1.23-PATCHES/patch-01-bug-fix b/Build/source/texk/psutils/psutils-1.23-PATCHES/patch-01-bug-fix new file mode 100644 index 00000000000..4786ca5fb8f --- /dev/null +++ b/Build/source/texk/psutils/psutils-1.23-PATCHES/patch-01-bug-fix @@ -0,0 +1,26 @@ +diff -ur psutils-1.23.orig/psutil.c psutils-1.23/psutil.c +--- psutils-1.23.orig/psutil.c 2014-01-15 20:08:26.000000000 +0100 ++++ psutils-1.23/psutil.c 2014-01-16 08:56:23.000000000 +0100 +@@ -18,12 +18,12 @@ + #include <sys/stat.h> + #include <stdio.h> + ++#include "progname.h" + #include "xvasprintf.h" + #include "verror.h" + + #define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0) + +-char *program; + int pages; + int verbose; + FILE *infile; +@@ -44,7 +44,7 @@ + + _Noreturn void usage(void) + { +- fprintf(stderr, "%s %s\n%sUsage: %s %s", program, PACKAGE_VERSION, COPYRIGHT_STRING, program, syntax); ++ fprintf(stderr, "%s %s\n%sUsage: %s %s", program_name, PACKAGE_VERSION, COPYRIGHT_STRING, program_name, syntax); + exit(1); + } + diff --git a/Build/source/texk/psutils/psutils-1.23-PATCHES/patch-20-texlive b/Build/source/texk/psutils/psutils-1.23-PATCHES/patch-20-texlive new file mode 100644 index 00000000000..86a624003be --- /dev/null +++ b/Build/source/texk/psutils/psutils-1.23-PATCHES/patch-20-texlive @@ -0,0 +1,19 @@ +diff -ur psutils-1.23.orig/psutil.c psutils-1.23/psutil.c +--- psutils-1.23.orig/psutil.c 2014-01-16 08:56:23.000000000 +0100 ++++ psutils-1.23/psutil.c 2014-01-16 08:57:40.000000000 +0100 +@@ -66,6 +66,7 @@ + verror(1, 0, format, args); /* Does not return */ + } + ++#if 0 /* not used for TeX Live */ + /* Read a line from a pipe and return it without any trailing newline. */ + static char *pgetline(const char *cmd) + { +@@ -94,6 +95,7 @@ + free(cmd); + return res == 2; + } ++#endif /* not used for TeX Live */ + + /* Make a file seekable, using temporary files if necessary */ + FILE *seekable(FILE *fp) diff --git a/Build/source/texk/psutils/psutils-1.23/ChangeLog b/Build/source/texk/psutils/psutils-1.23/ChangeLog new file mode 100644 index 00000000000..2f9d0d39a7a --- /dev/null +++ b/Build/source/texk/psutils/psutils-1.23/ChangeLog @@ -0,0 +1 @@ +See git log.
\ No newline at end of file diff --git a/Build/source/texk/psutils/psutils-1.21/LICENSE b/Build/source/texk/psutils/psutils-1.23/LICENSE index cf532202464..cf532202464 100644 --- a/Build/source/texk/psutils/psutils-1.21/LICENSE +++ b/Build/source/texk/psutils/psutils-1.23/LICENSE diff --git a/Build/source/texk/psutils/psutils-1.21/Makefile.am b/Build/source/texk/psutils/psutils-1.23/Makefile.am index a3d6f727979..f0bde09a33e 100644 --- a/Build/source/texk/psutils/psutils-1.21/Makefile.am +++ b/Build/source/texk/psutils/psutils-1.23/Makefile.am @@ -8,11 +8,12 @@ SUBDIRS = lib ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) +AM_CPPFLAGS = $(ISYSTEM)$(top_builddir)/lib $(ISYSTEM)$(top_srcdir)/lib -DPAPER='"$(PAPER)"' +LDADD = libpsutils.a $(top_builddir)/lib/libgnu.a noinst_LIBRARIES = libpsutils.a libpsutils_a_SOURCES = psutil.c psspec.c libpsutils_a_LIBADD = $(LIBPAPER) -LDADD = libpsutils.a bin_PROGRAMS = psbook psselect pstops epsffit psnup psresize @@ -23,6 +24,7 @@ man_MANS = psutils.1 \ psjoin.1 extractres.1 includeres.1 EXTRA_DIST = m4/gnulib-cache.m4 \ + LICENSE \ psutil.h psspec.h \ $(bin_SCRIPTS) \ $(man_MANS) @@ -30,7 +32,7 @@ EXTRA_DIST = m4/gnulib-cache.m4 \ all: includeres includeres: extractres - $(RM) $@ && $(LN_S) extractres $@ + $(RM) $@ && $(LN_S) $(srcdir)/extractres $@ install-exec-hook: cd $(DESTDIR)$(bindir); $(RM) includeres; $(LN_S) extractres includeres diff --git a/Build/source/texk/psutils/psutils-1.21/README b/Build/source/texk/psutils/psutils-1.23/README index 81b72f8b859..44bd8f192de 100644 --- a/Build/source/texk/psutils/psutils-1.21/README +++ b/Build/source/texk/psutils/psutils-1.23/README @@ -35,9 +35,16 @@ Angus Duggan's dvibook; pstops is modeled on Tom Rokicki's dvidvi. INSTALLATION -./configure && make && make install +To build, you need the following programs installed, as well as a +standard POSIX environment and C compiler: -Run ./configure --help for options. + automake, autoconf, git, perl + +Then run: + +./bootstrap && ./configure && make && [sudo] make install + +For installation options, see ./configure --help BUGS diff --git a/Build/source/texk/psutils/psutils-1.21/bootstrap b/Build/source/texk/psutils/psutils-1.23/bootstrap index 92f6bc212ea..92f6bc212ea 100755 --- a/Build/source/texk/psutils/psutils-1.21/bootstrap +++ b/Build/source/texk/psutils/psutils-1.23/bootstrap diff --git a/Build/source/texk/psutils/psutils-1.21/bootstrap.conf b/Build/source/texk/psutils/psutils-1.23/bootstrap.conf index 2925724bad0..f00efadf76d 100644 --- a/Build/source/texk/psutils/psutils-1.21/bootstrap.conf +++ b/Build/source/texk/psutils/psutils-1.23/bootstrap.conf @@ -12,14 +12,23 @@ # Additional gnulib-tool options to use. gnulib_tool_options=' - --no-changelog ' # gnulib modules used by this package. +# FIXME: progname should not be needed gnulib_modules=' - warnings - manywarnings + warnings + manywarnings + binary-io + fseeko fstat + ftello + getopt-gnu + getline + progname + unistd + verror + xvasprintf ' # Extra gnulib files that are not in modules, which override files of @@ -71,33 +80,6 @@ EOF func_add_hook func_prep psutils_ignore_gnulib_ignore -# psutils_force_changelog -# ----------------------- -# Automake requires that ChangeLog exist. -psutils_force_changelog () -{ - $debug_cmd - - touch ChangeLog || exit 1 -} -func_add_hook func_gnulib_tool psutils_force_changelog - - -# psutils_finish -# ---------------------- -# Configure script does not require ChangeLog. -# Copy dummy.c with correct license. -psutils_finish () -{ - $debug_cmd - - cp -fp ./dummy.c $source_base/ - rm ChangeLog || exit 1 -} -func_add_hook func_fini psutils_finish - - - # Local variables: # mode: shell-script # sh-indentation: 2 diff --git a/Build/source/texk/psutils/psutils-1.21/configure.ac b/Build/source/texk/psutils/psutils-1.23/configure.ac index 40f2ab20683..0b63a76a582 100644 --- a/Build/source/texk/psutils/psutils-1.21/configure.ac +++ b/Build/source/texk/psutils/psutils-1.23/configure.ac @@ -1,12 +1,9 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT(psutils, 1.21, rrt@sc3d.org) +AC_INIT(psutils, 1.23, rrt@sc3d.org) AC_CONFIG_AUX_DIR([build-aux]) - AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - dnl Check for programs AC_PROG_CC gl_EARLY @@ -35,7 +32,6 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wstrict-overflow" # Use a lower level (see below). nw="$nw -Wconversion" # These warnings usually don’t point to mistakes. nw="$nw -Wsign-conversion" # Likewise. - nw="$nw -Waggregate-return" # We do this on purpose. nw="$nw -Wtraditional-conversion" # Don't care. nw="$nw -Wpadded" # Don't care. nw="$nw -Wc++-compat" # Don't care. @@ -43,7 +39,8 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wmissing-format-attribute" # Don't care. nw="$nw -Wshadow" # Don't care. nw="$nw -Wunreachable-code" # Seems buggy. - nw="$nw -Wsystem-headers" # glibc headers fail as of glibc 2.15, gcc 4.7 + nw="$nw -Wsystem-headers" # glibc headers fail as of glibc 2.17, gcc 4.8 + nw="$nw -Wsuggest-attribute=format" # glibc headers fail as of glibc 2.17, gcc 4.8 nw="$nw -Wall" nw="$nw -Wunused-macros" # those macros might come in handy later @@ -60,18 +57,27 @@ if test "$gl_gcc_warnings" = yes; then # Add some more safety measures gl_WARN_ADD([-D_FORTIFY_SOURCE=2]) gl_WARN_ADD([-fmudflap]) + + # When compiling with GCC, prefer -isystem to -I when including system + # include files, to avoid generating useless diagnostics for the files. + ISYSTEM='-isystem ' +else + ISYSTEM='-I' fi +AC_SUBST([ISYSTEM]) gl_INIT dnl Check for header files AC_HEADER_STDC -AC_CHECK_HEADER([paper.h], [], [AC_MSG_FAILURE([cannot find libpaper header])]) -dnl Check for libraries -AC_PROG_RANLIB -AC_CHECK_LIB([paper], [paperinfo], [], - [AC_MSG_FAILURE([cannot find libpaper library])]) +dnl Check for programs +dnl Don't use AX_WITH_PROG, as we want by default to be relocatable, +dnl hence not use a full path +AC_ARG_VAR([PAPER], [Absolute path to paper executable]) +if test -z "$PAPER"; then + PAPER=paper +fi dnl Generate output files AC_CONFIG_MACRO_DIR(m4) diff --git a/Build/source/texk/psutils/psutils-1.21/dummy.c b/Build/source/texk/psutils/psutils-1.23/dummy.c index 061a78c34b2..061a78c34b2 100644 --- a/Build/source/texk/psutils/psutils-1.21/dummy.c +++ b/Build/source/texk/psutils/psutils-1.23/dummy.c diff --git a/Build/source/texk/psutils/psutils-1.21/epsffit.1 b/Build/source/texk/psutils/psutils-1.23/epsffit.1 index 3519cd3576d..3f15b3784a9 100644 --- a/Build/source/texk/psutils/psutils-1.21/epsffit.1 +++ b/Build/source/texk/psutils/psutils-1.23/epsffit.1 @@ -3,32 +3,26 @@ epsffit \- fit encapsulated PostScript file (EPSF) into constrained size .SH SYNOPSIS .B epsffit -[ -.B \-c -] [ -.B \-r -] [ -.B \-a -] [ -.B \-m -] [ -.B \-s -] -.I "llx lly urx ury" -[ -.B infile -[ -.B outfile -] ] +.RB [ \-c ] +.RB [ \-r ] +.RB [ \-a ] +.RB [ \-m ] +.RB [ \-s ] +.I llx lly urx ury +.RI [ infile +.RI [ outfile ]] .SH DESCRIPTION -.I Epsffit +.B Epsffit fits an EPSF file (encapsulated PostScript) to a given bounding box. -The coordinates of the box are given by \fB(llx,lly)\fR for the lower -left, and \fB(urx,ury)\fR for the upper right, in PostScript units (points). +The coordinates of the box are given by +.RI ( llx , lly ) +for the lower left, and +.RI ( urx , ury ) +for the upper right, in PostScript units (points). .PP If no input or output files are specified, -.I epsffit -read from the standard input and writes to the standard output. +.B epsffit +reads from the standard input and writes to the standard output. .SH OPTIONS .IP \fB\-c\fP 1i Center the image in the given bounding box. @@ -41,11 +35,11 @@ the aspect ratio. Rotates the image to maximise the size if it would fit the specified bounding box better. .IP \fB\-s\fP 1i -Add a \fIshowpage\fP at the end of the file to force the image to print. +Add a \fBshowpage\fP at the end of the file to force the image to print. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.BR psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/texk/psutils/psutils-1.21/epsffit.c b/Build/source/texk/psutils/psutils-1.23/epsffit.c index 8ff3f7ec3ee..df7e81eb2ae 100644 --- a/Build/source/texk/psutils/psutils-1.21/epsffit.c +++ b/Build/source/texk/psutils/psutils-1.23/epsffit.c @@ -1,7 +1,7 @@ /* epsffit.c * Fit EPSF file into constrained size * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. * @@ -17,9 +17,9 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif +#include "progname.h" +#include "binary-io.h" #include "psutil.h" @@ -39,10 +39,7 @@ main(int argc, char **argv) FILE *output = stdout; int opt; - SET_BINARY(stdin); - SET_BINARY(stdout); - - program = *argv; + set_program_name(argv[0]); while((opt = getopt(argc, argv, "csramv")) != EOF) { switch(opt) { @@ -70,15 +67,17 @@ main(int argc, char **argv) if ((argc - optind) > 0) { if(!(input = fopen(argv[optind], "rb"))) - message(FATAL, "can't open input file %s\n", argv[optind]); + die("can't open input file %s", argv[optind]); optind++; - } + } else if (set_binary_mode(fileno(stdin), O_BINARY) < 0) + die("can't reset stdin to binary mode"); if ((argc - optind) > 0) { if(!(output = fopen(argv[optind], "wb"))) - message(FATAL, "can't open output file %s\n", argv[optind]); + die("can't open output file %s", argv[optind]); optind++; - } + } else if (set_binary_mode(fileno(stdout), O_BINARY) < 0) + die("can't reset stdout to binary mode"); while (fgets(buf, BUFSIZ, input)) { if (buf[0] == '%' && (buf[1] == '%' || buf[1] == '!')) { @@ -168,7 +167,7 @@ main(int argc, char **argv) if (showpage) fputs("restore showpage\n", output); /* just in case */ } else - message(FATAL, "no %%%%BoundingBox:\n"); + die("no %%%%BoundingBox:"); return 0; } diff --git a/Build/source/texk/psutils/psutils-1.21/extractres b/Build/source/texk/psutils/psutils-1.23/extractres index 87f8377b34d..87f8377b34d 100755 --- a/Build/source/texk/psutils/psutils-1.21/extractres +++ b/Build/source/texk/psutils/psutils-1.23/extractres diff --git a/Build/source/texk/psutils/psutils-1.21/extractres.1 b/Build/source/texk/psutils/psutils-1.23/extractres.1 index 33d96f7cb0e..0e7db1a1ab2 100644 --- a/Build/source/texk/psutils/psutils-1.21/extractres.1 +++ b/Build/source/texk/psutils/psutils-1.23/extractres.1 @@ -3,17 +3,14 @@ extractres \- filter to extract resources from a PostScript document .SH SYNOPSIS .B extractres -[ -.B \-m -] < -.I document.ps -> -.I output.ps +.RB [ \-m ] +.RI < document.ps +.RI > output.ps .SH DESCRIPTION -.I Extractres +.B Extractres extracts resources (fonts, procsets, patterns, files, etc) appearing in a PostScript document, and puts appropriate -.I %%IncludeResource +.B %%IncludeResource comments in the document prologue. The extracted resources are written to files with the same name as the resource, and an appropriate extension. The pipeline @@ -24,9 +21,9 @@ extractres file.ps | includeres >out.ps will move all resources appearing in a document to the document prologue, removing redundant copies. The output file can then be put through page re-arrangement filters such as -.I psnup +.B psnup or -.I pstops +.B pstops safely. .PP The @@ -36,12 +33,12 @@ used for some programs which download fonts a bit at a time. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.BR psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. .SH BUGS -.I extractres +.B extractres does not alter the -.I %%DocumentSuppliedResources +.B %%DocumentSuppliedResources comments. diff --git a/Build/source/texk/psutils/psutils-1.21/includeres.1 b/Build/source/texk/psutils/psutils-1.23/includeres.1 index 281dc187146..4e56ad842f2 100644 --- a/Build/source/texk/psutils/psutils-1.21/includeres.1 +++ b/Build/source/texk/psutils/psutils-1.23/includeres.1 @@ -3,14 +3,12 @@ includeres \- filter to include resources in a PostScript document .SH SYNOPSIS .B includeres -< -.I document.ps -> -.I output.ps +.RI < document.ps +.RI > output.ps .SH DESCRIPTION -.I Includeres +.B Includeres includes resources (fonts, procsets, patterns, files, etc.) in place of -.I %%IncludeResource +.B %%IncludeResource comments in a PostScript document. The resources are searched for under the resource name, and with an appropriate extension. The pipeline @@ -21,19 +19,19 @@ extractres file.ps | includeres >out.ps will move all resources appearing in a document to the document prologue, removing redundant copies. The output file can then be put through page re-arrangement filters such as -.I psnup +.B psnup or -.I pstops +.B pstops safely. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.BR psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. .SH BUGS -.I includeres +.B includeres does not alter the -.I %%DocumentNeededResources +.B %%DocumentNeededResources comments. diff --git a/Build/source/texk/psutils/psutils-1.21/psbook.1 b/Build/source/texk/psutils/psutils-1.23/psbook.1 index 53fd770a5e4..3b2bff9b84c 100644 --- a/Build/source/texk/psutils/psutils-1.21/psbook.1 +++ b/Build/source/texk/psutils/psutils-1.23/psbook.1 @@ -3,40 +3,36 @@ psbook \- rearrange pages in PostScript file into signatures .SH SYNOPSIS .B psbook -[ -.B \-q -] [ -.B \-s\fIsignature\fR -] [ -.I infile -[ -.I outfile -] ] +.RB [ \-q ] +.RB [ \-s\fIsignature\fR ] +.RI [ infile +.RI [ outfile ]] .SH DESCRIPTION -.I Psbook +.B Psbook rearranges pages from a PostScript document into ``signatures'' for printing books or booklets, creating a new PostScript file. The input PostScript file should follow the Adobe Document Structuring Conventions. .PP The -.I \-s +.B \-s option selects the size of signature which will be used. The signature size is the number of sides which will be folded and bound together; the number given should be a multiple of four. The default is to use one signature for the whole file. Extra blank sides will be added if the file does not contain a multiple of four pages. .PP -Psbook normally prints the page numbers of the pages rearranged; the -.I \-q +.B Psbook +normally prints the page numbers of the pages rearranged; the +.B \-q option suppresses this. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.BR psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. .SH BUGS -.I Psbook +.B Psbook does not accept all DSC comments. diff --git a/Build/source/texk/psutils/psutils-1.21/psbook.c b/Build/source/texk/psutils/psutils-1.23/psbook.c index b77c223d229..8bb0b6b6ace 100644 --- a/Build/source/texk/psutils/psutils-1.21/psbook.c +++ b/Build/source/texk/psutils/psutils-1.23/psbook.c @@ -1,5 +1,5 @@ /* psbook.c - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. * @@ -7,9 +7,11 @@ */ #include "config.h" -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif +#include "progname.h" +#include "binary-io.h" + #include "psutil.h" const char *syntax = "[-q] [-sSIGNATURE] [INFILE [OUTFILE]]\n SIGNATURE must be positive and divisible by 4\n"; @@ -23,11 +25,9 @@ main(int argc, char *argv[]) int currentpg, maxpage; int opt; - SET_BINARY(stdin); - SET_BINARY(stdout); + set_program_name (argv[0]); verbose = 1; - program = *argv; while((opt = getopt(argc, argv, "vqs:")) != EOF) { switch(opt) { @@ -54,21 +54,26 @@ main(int argc, char *argv[]) if (optind != argc) { /* User specified an input file */ if ((infile = fopen(argv[optind], "rb")) == NULL) - message(FATAL, "can't open input file %s\n", argv[optind]); + die("can't open input file %s", argv[optind]); optind++; } if (optind != argc) { /* User specified an output file */ if ((outfile = fopen(argv[optind], "wb")) == NULL) - message(FATAL, "can't open output file %s\n", argv[optind]); + die("can't open output file %s", argv[optind]); optind++; } if(optind != argc) usage(); + if (infile == stdin && set_binary_mode(fileno(stdin), O_BINARY) < 0) + die("can't reset stdin to binary mode"); + if (outfile == stdout && set_binary_mode(fileno(stdout), O_BINARY) < 0) + die("can't reset stdout to binary mode"); + if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); + die("can't seek input"); scanpages(NULL); diff --git a/Build/source/texk/psutils/psutils-1.21/psjoin b/Build/source/texk/psutils/psutils-1.23/psjoin index 21dfaffeef3..21dfaffeef3 100755 --- a/Build/source/texk/psutils/psutils-1.21/psjoin +++ b/Build/source/texk/psutils/psutils-1.23/psjoin diff --git a/Build/source/texk/psutils/psutils-1.21/psjoin.1 b/Build/source/texk/psutils/psutils-1.23/psjoin.1 index c048d4708e8..db4bdeb9170 100644 --- a/Build/source/texk/psutils/psutils-1.21/psjoin.1 +++ b/Build/source/texk/psutils/psutils-1.23/psjoin.1 @@ -3,9 +3,11 @@ psjoin \- psjoin .SH SYNOPSIS .B psjoin -[ \fIoptions\fR... ] \fIfilenames\fR... +.RI [ option ...] +.IR filename ... .SH DESCRIPTION -psjoin \- concatenate PostScript files (version 0.3) +.B psjoin +\- concatenate PostScript files (version 0.3) by Tom Sato <VEF00200@nifty.ne.jp>, http://member.nifty.ne.jp/tsato/ .SS "Option:" .HP diff --git a/Build/source/texk/psutils/psutils-1.21/psnup.1 b/Build/source/texk/psutils/psutils-1.23/psnup.1 index 83cd988ec27..8b6e8a0e4d8 100644 --- a/Build/source/texk/psutils/psutils-1.21/psnup.1 +++ b/Build/source/texk/psutils/psutils-1.23/psnup.1 @@ -39,7 +39,7 @@ The .B \-p option can be used instead, to set the paper size; otherwise a default value is used. See -.BR papersize (5). +.BR paper (1). The .BR \-W , .BR \-H , @@ -117,7 +117,7 @@ print spooler a typical command line might look like this: .sp groff -Tps -ms \fIfile\fP | psbook | psnup -2 | lpr .sp -Where file is a 4 page document this command will result in a +where file is a 4 page document this command will result in a two page document printing two pages of \fIfile\fP per page and rearranges the page order to match the input pages 4 and 1 on the first output page and @@ -126,7 +126,7 @@ on the second output page. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.Br psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/texk/psutils/psutils-1.21/psnup.c b/Build/source/texk/psutils/psutils-1.23/psnup.c index cfbe5f6968a..5efb2c13385 100644 --- a/Build/source/texk/psutils/psutils-1.21/psnup.c +++ b/Build/source/texk/psutils/psutils-1.23/psnup.c @@ -1,17 +1,17 @@ /* psnup.c * Put multiple pages on to one page * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ #include "config.h" -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif #include <string.h> -#include <paper.h> +#include "progname.h" +#include "binary-io.h" #include "psutil.h" #include "psspec.h" @@ -48,20 +48,18 @@ main(int argc, char *argv[]) double tolerance = 100000; /* layout tolerance */ off_t sizeheaders[20]; /* headers to remove */ int opt; - const struct paper *paper = NULL; - SET_BINARY(stdin); - SET_BINARY(stdout); + set_program_name (argv[0]); + + verbose = 1; - set_paper_size(NULL); + if (!paper_size(NULL, &width, &height)) + die("could not get default paper size"); margin = border = vshift = hshift = column = flip = 0; leftright = topbottom = 1; iwidth = iheight = -1 ; - verbose = 1; - program = *argv; - while((opt = getopt(argc, argv, "qd::lrfcw:W:h:H:m:b:t:s:p:P:n:1::2::3::4::5::6::7::8::9::")) @@ -115,22 +113,16 @@ main(int argc, char *argv[]) uscale = atof(optarg); break; case 'p': /* output (and by default input) paper type */ - if ( (paper = paperinfo(optarg)) != NULL ) { - width = paperpswidth(paper); - height = paperpsheight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", optarg); + if (!paper_size(optarg, &width, &height)) + die("paper size '%s' not recognised", optarg); break; case 'P': /* paper type */ - if ( (paper = paperinfo(optarg)) != NULL ) { - iwidth = paperpswidth(paper); - iheight = paperpsheight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", optarg); + if (!paper_size(optarg, &width, &height)) + die("paper size '%s' not recognised", optarg); break; case 'n': /* n-up, for compatibility with other psnups */ if ((nup = atoi(optarg)) < 1) - message(FATAL, "-n %d too small\n", nup); + die("-n %d too small", nup); break; case '1': case '2': @@ -148,7 +140,7 @@ main(int argc, char *argv[]) /* really should check that valuestr is only digits here...*/ if ((nup = atoi(valuestr)) < 1) - message(FATAL, "-n %d too small\n", nup); + die("-n %d too small", nup); free(valuestr); } else { nup = (opt - '0'); @@ -169,31 +161,36 @@ main(int argc, char *argv[]) if (optind != argc) { /* User specified an input file */ if ((infile = fopen(argv[optind], "rb")) == NULL) - message(FATAL, "can't open input file %s\n", argv[optind]); + die("can't open input file %s", argv[optind]); optind++; } if (optind != argc) { /* User specified an output file */ if ((outfile = fopen(argv[optind], "wb")) == NULL) - message(FATAL, "can't open output file %s\n", argv[optind]); + die("can't open output file %s", argv[optind]); optind++; } if (optind != argc) usage(); + if (infile == stdin && set_binary_mode(fileno(stdin), O_BINARY) < 0) + die("can't reset stdin to binary mode"); + if (outfile == stdout && set_binary_mode(fileno(stdout), O_BINARY) < 0) + die("can't reset stdout to binary mode"); + if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); + die("can't seek input"); if (width <= 0 || height <= 0) - message(FATAL, "page width and height must be set\n"); + die("page width and height must be set"); /* subtract paper margins from height & width */ ppwid = width - margin*2; pphgt = height - margin*2; if (ppwid <= 0 || pphgt <= 0) - message(FATAL, "paper margins are too large\n"); + die("paper margins are too large"); scanpages(sizeheaders); @@ -243,7 +240,7 @@ main(int argc, char *argv[]) /* fail if nothing better than worst tolerance was found */ if (best == tolerance) - message(FATAL, "can't find acceptable layout for %d-up\n", nup); + die("can't find acceptable layout for %d-up", nup); } if (flip) { /* swap width & height for clipping */ diff --git a/Build/source/texk/psutils/psutils-1.21/psresize.1 b/Build/source/texk/psutils/psutils-1.23/psresize.1 index 3e5e751b194..819d85f7382 100644 --- a/Build/source/texk/psutils/psutils-1.21/psresize.1 +++ b/Build/source/texk/psutils/psutils-1.23/psresize.1 @@ -3,35 +3,25 @@ psresize \- rescales and centers a document for new output paper size .SH SYNOPSIS .B psresize -[ -.B \-w\fIwidth\fR -] [ -.B \-h\fIheight\fR -] [ -.B \-p\fIpaper\fR -] [ -.B \-W\fIwidth\fR -] [ -.B \-H\fIheight\fR -] [ -.B \-P\fIpaper\fR -] [ -.B \-q -] [ -.I infile -[ -.I outfile -] ] +.RB [ \-w\fIwidth\fR ] +.RB [ \-h\fIheight\fR ] +.RB [ \-p\fIpaper\fR ] +.RB [ \-W\fIwidth\fR ] +.RB [ \-H\fIheight\fR ] +.RB [ \-P\fIpaper\fR ] +.RB [ \-q ] +.RI [ infile +.RI [ outfile ]] .SH DESCRIPTION -.I Psresize +.B Psresize rescales and centres a document on a different size of paper. The input PostScript file should follow the Adobe Document Structuring Conventions. .PP The -.I \-w +.B \-w option gives the output paper width, and the -.I \-h +.B \-h option gives the output paper height, normally specified in .B "cm" or @@ -40,25 +30,25 @@ to convert PostScript's points (1/72 of an inch) to centimeters or inches. The -.I \-p +.B \-p option can be used instead, to set the paper size; otherwise a default value is used. See -.BR papersize (5). +.BR paper (1). .PP The -.I \-W +.B \-W option gives the input paper width, and the -.I \-H +.B \-H option gives the input paper height. The -.I \-P +.B \-P option can be used instead, to set the paper size; otherwise a default value is used. See -.BR papersize (5). +.BR paper (1). .PP -.I Psresize +.B Psresize normally prints the page numbers of the pages output; the -.I \-q +.B \-q option suppresses this. .SH EXAMPLES The following command can be used to convert a document on A4 size paper to @@ -69,10 +59,10 @@ psresize -PA4 -pletter in.ps out.ps .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.Br psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. .SH BUGS -.I Psresize +.B Psresize does not accept all DSC comments. diff --git a/Build/source/texk/psutils/psutils-1.21/psresize.c b/Build/source/texk/psutils/psutils-1.23/psresize.c index bd1f961488b..b52d77e88a8 100644 --- a/Build/source/texk/psutils/psutils-1.21/psresize.c +++ b/Build/source/texk/psutils/psutils-1.23/psresize.c @@ -1,16 +1,16 @@ /* psresize.c * Alter page size of document * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ #include "config.h" -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif -#include <paper.h> +#include "progname.h" +#include "binary-io.h" #include "psutil.h" #include "psspec.h" @@ -31,20 +31,17 @@ main(int argc, char *argv[]) off_t sizeheaders[20]; /* headers to remove */ PageSpec *specs; int opt; - const struct paper *paper = NULL; - SET_BINARY(stdin); - SET_BINARY(stdout); + set_program_name (argv[0]); - set_paper_size(NULL); + if (!paper_size(NULL, &width, &height)) + die("could not get default paper size"); vshift = hshift = 0; rotate = 0; verbose = 1; - program = *argv; - while((opt = getopt(argc, argv, "qw:h:p:W:H:P:")) != EOF) { switch(opt) { @@ -59,11 +56,8 @@ main(int argc, char *argv[]) height = singledimen(optarg); break; case 'p': /* paper type */ - if ( (paper = paperinfo(optarg)) != NULL ) { - width = paperpswidth(paper); - height = paperpsheight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", optarg); + if (!paper_size(optarg, &width, &height)) + die("paper size '%s' not recognised", optarg); break; case 'W': /* input page width */ inwidth = singledimen(optarg); @@ -72,11 +66,8 @@ main(int argc, char *argv[]) inheight = singledimen(optarg); break; case 'P': /* input paper type */ - if ( (paper = paperinfo(optarg)) != NULL ) { - inwidth = paperpswidth(paper); - inheight = paperpsheight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", optarg); + if (!paper_size(optarg, &inwidth, &inheight)) + die("paper size '%s' not recognised", optarg); break; case 'v': /* version */ default: @@ -93,29 +84,34 @@ main(int argc, char *argv[]) if (optind != argc) { /* User specified an input file */ if ((infile = fopen(argv[optind], "rb")) == NULL) - message(FATAL, "can't open input file %s\n", argv[optind]); + die("can't open input file %s", argv[optind]); optind++; } if (optind != argc) { /* User specified an output file */ if ((outfile = fopen(argv[optind], "wb")) == NULL) - message(FATAL, "can't open output file %s\n", argv[optind]); + die("can't open output file %s", argv[optind]); optind++; } if (optind != argc) usage(); + if (infile == stdin && set_binary_mode(fileno(stdin), O_BINARY) < 0) + die("can't reset stdin to binary mode"); + if (outfile == stdout && set_binary_mode(fileno(stdout), O_BINARY) < 0) + die("can't reset stdout to binary mode"); + if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); + die("can't seek input"); if (width <= 0 || height <= 0) - message(FATAL, "output page width and height must be set\n"); + die("output page width and height must be set"); scanpages(sizeheaders); if (inwidth <= 0 || inheight <= 0) - message(FATAL, "input page width and height must be set\n"); + die("input page width and height must be set"); /* try normal orientation first */ scale = MIN(width/inwidth, height/inheight); diff --git a/Build/source/texk/psutils/psutils-1.21/psselect.1 b/Build/source/texk/psutils/psutils-1.23/psselect.1 index be1260a7a51..65708e85bd2 100644 --- a/Build/source/texk/psutils/psutils-1.21/psselect.1 +++ b/Build/source/texk/psutils/psutils-1.23/psselect.1 @@ -3,68 +3,63 @@ psselect \- select pages from a PostScript file .SH SYNOPSIS .B psselect -[ -.B \-q -] [ -.B \-e -] [ -.B \-o -] [ -.B \-r -] [ -.B \-p\fIpages\fR -] [ -.I pages -] [ -.I infile -[ -.I outfile -] ] +.RB [ \-q ] +.RB [ \-e | \-o ] +.RB [ \-r ] +.RB [[ \-p ] \fIpages\fR ] +.RI [ infile +.RI [ outfile ]] .SH DESCRIPTION -.I Psselect +.B Psselect selects pages from a PostScript document, creating a new PostScript file. The input PostScript file should follow the Adobe Document Structuring Conventions. .PP The -.I \-e +.B \-e option selects all of the even pages; it may be used in conjunction with the other page selection options to select the even pages from a range of pages. .PP The -.I \-o +.B \-o option selects all of the odd pages; it may be used in conjunction with the other page selection options. .PP The -.I \-p\fIpages\fR +.BI \-p pages option specifies the pages which are to be selected. .I Pages is a comma separated list of page ranges, each of which may be a page number, -or a page range of the form \fIfirst\fR-\fIlast\fR. If \fIfirst\fR is omitted, -the -first page is assumed, and if \fIlast\fR is omitted, the last page is assumed. +or a page range of the form +.IB first \- last . +If +.I first +is omitted, the first page is assumed, and if +.I last +is omitted, the last page is assumed. The prefix character `_' indicates that the page number is relative to the end of the document, counting backwards. If just this character with no page number is used, a blank page will be inserted. .PP The -.I \-r +.B \-r option causes -.I psselect +.B psselect to output the selected pages in reverse order. .PP -Psselect normally prints the page numbers of the pages rearranged; the -.I \-q +.B Psselect +normally prints the page numbers of the pages rearranged; the +.B \-q option suppresses this. .PP If any of the -.I \-r, \-e, +.BR \-r , +.BR \-e , or -.I \-o +.B \-o options are specified, the page range must be given with the -.I \-p +.B \-p option. This is for backwards compatibility with previous versions. .SH NOTES @@ -75,7 +70,7 @@ at one. The actual page number in the document may be different. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.BR psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/texk/psutils/psutils-1.21/psselect.c b/Build/source/texk/psutils/psutils-1.23/psselect.c index 8166f5942f9..9440f0bb95b 100644 --- a/Build/source/texk/psutils/psutils-1.21/psselect.c +++ b/Build/source/texk/psutils/psutils-1.23/psselect.c @@ -1,15 +1,17 @@ /* psselect.c * Rearrange pages in conforming PS file for printing in signatures * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ #include "config.h" -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif +#include "progname.h" +#include "binary-io.h" + #include "psutil.h" const char *syntax = "[-q] [-e] [-o] [-r] [-pPAGES] [INFILE [OUTFILE]]\n"; @@ -25,7 +27,7 @@ static PageRange *makerange(int beg, int end, PageRange *next) { PageRange *new; if ((new = (PageRange *)malloc(sizeof(PageRange))) == NULL) - message(FATAL, "out of memory\n"); + die("out of memory"); new->first = beg; new->last = end; new->next = next; @@ -74,7 +76,7 @@ static PageRange *addrange(char *str, PageRange *rp) default: /* Avoid a compiler warning */ break; } - message(FATAL, "invalid page range\n"); + die("invalid page range"); return (PageRange *)0 ; } @@ -88,11 +90,9 @@ main(int argc, char *argv[]) int pass, all; PageRange *pagerange = NULL; - SET_BINARY(stdin); - SET_BINARY(stdout); + set_program_name (argv[0]); verbose = 1; - program = *argv; while((opt = getopt(argc, argv, "eorqvp:")) != EOF) { switch(opt) { @@ -133,21 +133,26 @@ main(int argc, char *argv[]) if (optind != argc) { /* User specified an input file */ if ((infile = fopen(argv[optind], "rb")) == NULL) - message(FATAL, "can't open input file %s\n", argv[optind]); + die("can't open input file %s", argv[optind]); optind++; } if (optind != argc) { /* User specified an output file */ if ((outfile = fopen(argv[optind], "wb")) == NULL) - message(FATAL, "can't open output file %s\n", argv[optind]); + die("can't open output file %s", argv[optind]); optind++; } if(optind != argc) usage(); + if (infile == stdin && set_binary_mode(fileno(stdin), O_BINARY) < 0) + die("can't reset stdin to binary mode"); + if (outfile == stdout && set_binary_mode(fileno(stdout), O_BINARY) < 0) + die("can't reset stdout to binary mode"); + if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); + die("can't seek input"); scanpages(NULL); diff --git a/Build/source/texk/psutils/psutils-1.21/psspec.c b/Build/source/texk/psutils/psutils-1.23/psspec.c index 9ec2e2e3a18..e02e6ffd3f6 100644 --- a/Build/source/texk/psutils/psutils-1.21/psspec.c +++ b/Build/source/texk/psutils/psutils-1.23/psspec.c @@ -1,7 +1,7 @@ /* psspec.c * Page spec routines for page rearrangement * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ @@ -21,7 +21,7 @@ PageSpec *newspec(void) { PageSpec *temp = (PageSpec *)malloc(sizeof(PageSpec)); if (temp == NULL) - message(FATAL, "out of memory\n"); + die("out of memory"); temp->pageno = temp->flags = temp->rotate = 0; temp->scale = 1; temp->xoff = temp->yoff = 0; @@ -72,12 +72,12 @@ double parsedimen(char **sp) s += 2; } else if (*s == 'w') { if (width < 0) - message(FATAL, "width not initialised\n"); + die("width not initialised"); num *= width; s++; } else if (*s == 'h') { if (height < 0) - message(FATAL, "height not initialised\n"); + die("height not initialised"); num *= height; s++; } diff --git a/Build/source/texk/psutils/psutils-1.21/psspec.h b/Build/source/texk/psutils/psutils-1.23/psspec.h index e62d1cfd3f2..5764cf74f2f 100644 --- a/Build/source/texk/psutils/psutils-1.21/psspec.h +++ b/Build/source/texk/psutils/psutils-1.23/psspec.h @@ -22,7 +22,7 @@ typedef struct pagespec { struct pagespec *next; } PageSpec ; -extern double width, height; +extern double width, height; /* Width and height of paper in PostScript pt */ extern PageSpec *newspec(void); extern int parseint(char **sp); diff --git a/Build/source/texk/psutils/psutils-1.21/pstops.1 b/Build/source/texk/psutils/psutils-1.23/pstops.1 index 1a65d1e92ee..d2750877382 100644 --- a/Build/source/texk/psutils/psutils-1.21/pstops.1 +++ b/Build/source/texk/psutils/psutils-1.23/pstops.1 @@ -3,25 +3,15 @@ pstops \- shuffle pages in a PostScript file .SH SYNOPSIS .B pstops -[ -.B \-q -] [ -.B \-b -] [ -.B \-w\fIwidth\fR -] [ -.B \-h\fIheight\fR -] [ -.B \-p\fIpaper\fR -] [ -.B \-d\fIlwidth\fR -] +.RB [ \-q ] +.RB [ \-b ] +.RB [ \-w\fIwidth\fR ] +.RB [ \-h\fIheight\fR ] +.RB [ \-p\fIpaper\fR ] +.RB [ \-d [ \fIlwidth\fR ]] .I pagespecs -[ -.I infile -[ -.I outfile -] ] +.RI [ infile +.RI [ outfile ]] .SH DESCRIPTION .I Pstops rearranges pages from a PostScript document, creating a new PostScript file. @@ -37,13 +27,16 @@ follow the syntax: .RS .TP 12 .I pagespecs -.I = [modulo:]specs += +.RI [ modulo\fB:\fP ] specs .TP .I specs -.I = spec[+specs][,specs] += +.IR spec [ \fB+\fPspecs | \fB,\fPspecs ] .TP .I spec -.I = [-]pageno[L][R][U][H][V][@scale][(xoff,yoff)] += +.RB [ - ] \fIpageno\fP [ L | R | U ][ H | V ][ @\fIscale\fP ][ ( \fIxoff\fP , \fIyoff\fP ) ] .RE .sp .I modulo @@ -74,7 +67,13 @@ to convert to centimetres or inches, or the flag or .B "h" to specify as a multiple of the width or height. -The optional parameters \fIL\fR, \fIR\fR, \fIU\fR, \fIH\fR and \fIV\fR +The optional parameters +.BR L , +.BR R , +.BR R , +.BR R , +and +.B V rotate the page left, right, or upside-down, and flip (mirror) page horizontally or vertically. The optional @@ -83,8 +82,10 @@ parameter scales the page by the fraction specified. If the optional minus sign is specified, the page is relative to the end of the document, instead of the start. -If page \fIspec\fRs are separated by -.B \+ +If page +.IR spec s +are separated by +.B + the pages will be merged into one page; if they are separated by .B , they will be on separate pages. @@ -102,34 +103,36 @@ at the lower left corner, then rotate about the same origin, and finally shift. .PP The -.I \-w +.B \-w option gives the width which is used by the .B "w" dimension specifier, and the -.I \-h +.B \-h option gives the height which is used by the .B "h" dimension specifier. These dimensions are also used (after scaling) to set the clipping path for each page. -The -.I \-p +The +.B \-p +option can be used as an alternative, to set the paper size. See +.BR paper (1). .PP The -.I \-b +.B \-b option prevents any .B bind operators in the PostScript prolog from binding. This may be needed in cases where complex multi-page re-arrangements are being done. .PP The -.I \-d +.D \-d option draws a line around the border of each page, of the specified width. If the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is assumed. The linewidth is relative to the original page dimensions, -\fIi.e.\fR it is scaled up or down with the rest of the page. +i.e., it is scaled up or down with the rest of the page. .PP Pstops normally prints the page numbers of the pages re-arranged; the -.I \-q +.B \-q option suppresses this. .SH EXAMPLES This section contains some sample re-arrangements. To put two pages on one @@ -157,10 +160,10 @@ for the reverse sides (or join them with a comma for duplex printing). .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psutils(1) +.BR psutils (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. .SH BUGS -.I Pstops +.B Pstops does not accept all DSC comments. diff --git a/Build/source/texk/psutils/psutils-1.21/pstops.c b/Build/source/texk/psutils/psutils-1.23/pstops.c index cb1f658c80a..c6b82b960ee 100644 --- a/Build/source/texk/psutils/psutils-1.21/pstops.c +++ b/Build/source/texk/psutils/psutils-1.23/pstops.c @@ -1,17 +1,17 @@ /* pstops.c * Rearrange pages in conforming PS file * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ #include "config.h" -#ifdef HAVE_UNISTD_H + #include <unistd.h> -#endif #include <string.h> -#include <paper.h> +#include "progname.h" +#include "binary-io.h" #include "psutil.h" #include "psspec.h" @@ -105,18 +105,15 @@ main(int argc, char *argv[]) PageSpec *specs = NULL; int nobinding = 0; double draw = 0; - const struct paper *paper = NULL; int opt; - SET_BINARY(stdin); - SET_BINARY(stdout); + set_program_name (argv[0]); - set_paper_size(NULL); + if (!paper_size(NULL, &width, &height)) + die("could not get default paper size"); verbose = 1; - program = *argv; - while((opt = getopt(argc, argv, "qd::bw:h:p:v0123456789")) != EOF) { switch(opt) { case 'q': /* quiet */ @@ -138,11 +135,8 @@ main(int argc, char *argv[]) height = singledimen(optarg); break; case 'p': /* paper type */ - if ( (paper = paperinfo(optarg)) != NULL ) { - width = paperpswidth(paper); - height = paperpsheight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", optarg); + if (!paper_size(optarg, &width, &height)) + die("paper size '%s' not recognised", optarg); break; case 'v': /* version */ usage(); @@ -158,7 +152,7 @@ main(int argc, char *argv[]) case '9': if (specs == NULL) { char *spec_txt = malloc((optarg ? strlen(optarg) : 0) + 3); - if(!spec_txt) message(FATAL, "no memory for spec allocation\n"); + if(!spec_txt) die("no memory for spec allocation"); spec_txt[0] = '-'; spec_txt[1] = opt; spec_txt[2] = 0; @@ -190,21 +184,26 @@ main(int argc, char *argv[]) if (optind != argc) { /* User specified an input file */ if ((infile = fopen(argv[optind], "rb")) == NULL) - message(FATAL, "can't open input file %s\n", argv[optind]); + die("can't open input file %s", argv[optind]); optind++; } if (optind != argc) { /* User specified an output file */ if ((outfile = fopen(argv[optind], "wb")) == NULL) - message(FATAL, "can't open output file %s\n", argv[optind]); + die("can't open output file %s", argv[optind]); optind++; } if (optind != argc || specs == NULL) usage(); + if (infile == stdin && set_binary_mode(fileno(stdin), O_BINARY) < 0) + die("can't reset stdin to binary mode"); + if (outfile == stdout && set_binary_mode(fileno(stdout), O_BINARY) < 0) + die("can't reset stdout to binary mode"); + if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); + die("can't seek input"); pstops(modulo, pagesperspec, nobinding, specs, draw); diff --git a/Build/source/texk/psutils/psutils-1.21/psutil.c b/Build/source/texk/psutils/psutils-1.23/psutil.c index a6ef8456b6f..8533bff4906 100644 --- a/Build/source/texk/psutils/psutils-1.21/psutil.c +++ b/Build/source/texk/psutils/psutils-1.23/psutil.c @@ -1,7 +1,7 @@ /* psutil.c * PSUtils utility functions * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ @@ -17,11 +17,13 @@ #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> -#include <paper.h> + +#include "progname.h" +#include "xvasprintf.h" +#include "verror.h" #define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0) -char *program; int pages; int verbose; FILE *infile; @@ -42,65 +44,58 @@ static off_t *pageptr; _Noreturn void usage(void) { - fprintf(stderr, "%s %s\n", program, PACKAGE_VERSION); - fprintf(stderr, COPYRIGHT_STRING); - fprintf(stderr, "Usage: %s %s", program, syntax); - fflush(stderr); - exit(1); + fprintf(stderr, "%s %s\n%sUsage: %s %s", program_name, PACKAGE_VERSION, COPYRIGHT_STRING, program_name, syntax); + exit(1); } void argerror(void) { - message(FATAL, argerr_message); + die(argerr_message); } /* Message function: for messages, warnings, and errors sent to stderr. - If called with the flag MESSAGE_EXIT set, the routine does not return. */ -void message(int flags, const char *format, ...) + The routine does not return. */ +void die(const char *format, ...) { - va_list args ; - - if ( flags & MESSAGE_PROGRAM ) - fprintf(stderr, "%s: ", program) ; + va_list args; - if ( (flags & MESSAGE_NL) ) - putc('\n', stderr) ; + if (verbose) /* We may be in the middle of a line */ + putc('\n', stderr); - va_start(args, format) ; - vfprintf(stderr, format, args); - va_end(args) ; - - if ( flags & MESSAGE_EXIT ) /* don't return to program */ - exit(1) ; -} - -static void maybe_init_libpaper(void) -{ - static int libpaper_initted = 0; - if (!libpaper_initted) { - paperinit(); - libpaper_initted = 1; - } + va_start(args, format); + verror(1, 0, format, args); /* Does not return */ } -void set_paper_size(const char *paper_name) +#if 0 /* not used for TeX Live */ +/* Read a line from a pipe and return it without any trailing newline. */ +static char *pgetline(const char *cmd) { - const struct paper *paper = get_paper(paper_name); - if (paper) { - width = paperpswidth(paper); - height = paperpsheight(paper); + char *l = NULL; + FILE *fp = popen(cmd, "r"); + if (fp) { + size_t n, len; + len = getline(&l, &n, fp); + if (l && l[len - 1] == '\n') + l[len - 1] = '\0'; + pclose(fp); } + return l; } -const struct paper *get_paper(const char *paper_name) +/* Get the size of the given paper, or the default paper if paper_name == NULL. */ +int paper_size(const char *paper_name, double *width, double *height) { - maybe_init_libpaper(); - if (paper_name == NULL) - paper_name = systempapername(); - if (paper_name) - return paperinfo(paper_name); - return NULL; + char *cmd = NULL, *l = NULL; + int res = 0; + if (paper_name == NULL) /* Use default paper name */ + paper_name = pgetline(PAPER); + if (paper_name && (cmd = xasprintf(PAPER " --unit=pt --size %s", paper_name)) && (l = pgetline(cmd))) + res = sscanf(l, "%lg %lg", width, height); + free(l); + free(cmd); + return res == 2; } +#endif /* not used for TeX Live */ /* Make a file seekable, using temporary files if necessary */ FILE *seekable(FILE *fp) @@ -186,7 +181,7 @@ void scanpages(off_t *sizeheaders) *sizeheaders = 0; if ((pageptr = (off_t *)malloc(sizeof(off_t)*maxpages)) == NULL) - message(FATAL, "out of memory\n"); + die("out of memory"); pages = 0; fseeko(infile, (off_t) 0, SEEK_SET); while (record = ftello(infile), fgets(buffer, BUFSIZ, infile) != NULL) @@ -197,7 +192,7 @@ void scanpages(off_t *sizeheaders) maxpages *= 2; if ((pageptr = (off_t *)realloc((char *)pageptr, sizeof(off_t)*maxpages)) == NULL) - message(FATAL, "out of memory\n"); + die("out of memory"); } pageptr[pages++] = record; } else if (headerpos == 0 && iscomment(comment, "BoundingBox:")) { @@ -269,7 +264,7 @@ void seekpage(int p) for (end = start+1; paren > 0; end++) switch (*end) { case '\0': - message(FATAL, "Bad page label while seeking page %d\n", p); + die("Bad page label while seeking page %d", p); case '(': paren++; break; @@ -285,7 +280,7 @@ void seekpage(int p) pagelabel[end-start] = '\0'; pageno = atoi(end); } else - message(FATAL, "I/O error seeking page %d\n", p); + die("I/O error seeking page %d", p); } /* Output routines. These all update the global variable bytes with the number @@ -300,7 +295,7 @@ void writestring(const char *s) void writepageheader(const char *label, int page) { if (verbose) - message(LOG, "[%d] ", page); + fprintf(stderr, "[%d] ", page); sprintf(buffer, "%%%%Page: %s %d\n", label, ++outputpage); writestring(buffer); } @@ -312,11 +307,11 @@ void writepagesetup(void) if (beginprocset) { for (;;) { if (fgets(buffer, BUFSIZ, infile) == NULL) - message(FATAL, "I/O error reading page setup %d\n", outputpage); + die("I/O error reading page setup %d", outputpage); if (!strncmp(buffer, "PStoPSxform", 11)) break; if (fputs(buffer, outfile) == EOF) - message(FATAL, "I/O error writing page setup %d\n", outputpage); + die("I/O error writing page setup %d", outputpage); bytes += strlen(buffer); } } @@ -326,7 +321,7 @@ void writepagesetup(void) void writepagebody(int p) { if (!fcopy(pageptr[p+1], NULL)) - message(FATAL, "I/O error writing page %d\n", outputpage); + die("I/O error writing page %d", outputpage); } /* write a whole page */ @@ -348,7 +343,7 @@ void writeheadermedia(int p, off_t *ignore, double width, double height) fseeko(infile, (off_t) 0, SEEK_SET); if (pagescmt) { if (!fcopy(pagescmt, ignore) || fgets(buffer, BUFSIZ, infile) == NULL) - message(FATAL, "I/O error in header\n"); + die("I/O error in header"); if (width > -1 && height > -1) { sprintf(buffer, "%%%%DocumentMedia: plain %d %d 0 () ()\n", (int) width, (int) height); writestring(buffer); @@ -359,14 +354,14 @@ void writeheadermedia(int p, off_t *ignore, double width, double height) writestring(buffer); } if (!fcopy(headerpos, ignore)) - message(FATAL, "I/O error in header\n"); + die("I/O error in header"); } /* write prologue to end of setup section excluding PStoPS procset */ int writepartprolog(void) { if (beginprocset && !fcopy(beginprocset, NULL)) - message(FATAL, "I/O error in prologue\n"); + die("I/O error in prologue"); if (endprocset) fseeko(infile, endprocset, SEEK_SET); writeprolog(); @@ -377,14 +372,14 @@ int writepartprolog(void) void writeprolog(void) { if (!fcopy(endsetup, NULL)) - message(FATAL, "I/O error in prologue\n"); + die("I/O error in prologue"); } /* write from end of setup to start of pages */ void writesetup(void) { if (!fcopy(pageptr[0], NULL)) - message(FATAL, "I/O error in prologue\n"); + die("I/O error in prologue"); } /* write trailer */ @@ -395,14 +390,14 @@ void writetrailer(void) writestring(buffer); } if (verbose) - message(LOG, "Wrote %d pages, %ld bytes\n", outputpage, bytes); + fprintf(stderr, "Wrote %d pages, %ld bytes\n", outputpage, bytes); } /* write a page with nothing on it */ void writeemptypage(void) { if (verbose) - message(LOG, "[*] "); + fprintf(stderr, "[*] "); sprintf(buffer, "%%%%Page: * %d\n", ++outputpage); writestring(buffer); if (beginprocset) diff --git a/Build/source/texk/psutils/psutils-1.21/psutil.h b/Build/source/texk/psutils/psutils-1.23/psutil.h index abddc0bb7c1..337692cff0b 100644 --- a/Build/source/texk/psutils/psutils-1.21/psutil.h +++ b/Build/source/texk/psutils/psutils-1.23/psutil.h @@ -1,7 +1,7 @@ /* psutil.h * PSUtils utility functions * - * (c) Reuben Thomas 2012 + * (c) Reuben Thomas 2012-2014 * (c) Angus J. C. Duggan 1991-1997 * See file LICENSE for details. */ @@ -11,43 +11,11 @@ #include <ctype.h> #include <stdarg.h> -/* message flags */ -#define MESSAGE_NL 1 /* Newline before message if necessary */ -#define MESSAGE_PROGRAM 2 /* announce program name */ -#define MESSAGE_EXIT 4 /* do not return */ - -/* message types */ -#define FATAL (MESSAGE_EXIT|MESSAGE_PROGRAM|MESSAGE_NL) -#define WARN (MESSAGE_NL|MESSAGE_PROGRAM) -#define LOG 0 - -/* change mode of a file pointer on Windows */ -#if defined(WIN32) -#include <io.h> -#include <fcntl.h> -#define SET_BINARY(fp) (void)_setmode(fileno(fp), _O_BINARY) -#undef off_t -#undef ftello -#undef fseeko -#if defined(__MINGW32__) -#define off_t off64_t -#define ftello ftello64 -#define fseeko fseeko64 -#else -#define off_t __int64 -#define ftello _ftelli64 -#define fseeko _fseeki64 -#endif -#else /* !WIN32 */ -#define SET_BINARY(fp) (void)0 -#endif - /* Definitions for functions found in psutil.c */ extern void usage(void); -extern void message(int flags, const char *format, ...); +extern void die(const char *format, ...); extern void argerror(void); -extern void set_paper_size(const char *paper_name); -const struct paper *get_paper(const char *paper_name); +extern int paper_size(const char *paper_name, double *width, double *height); extern FILE *seekable(FILE *fp); extern void writepage(int p); extern void seekpage(int p); @@ -65,7 +33,6 @@ extern void scanpages(off_t *sizeheaders); extern void writestring(const char *s); /* These variables are exported to the client program */ -extern char *program ; extern int pages; extern int verbose; extern FILE *infile; @@ -79,4 +46,4 @@ extern const char *argerr_message; /* Useful macros */ #define MIN(x,y) ((x) > (y) ? (y) : (x)) -#define COPYRIGHT_STRING "(c) Reuben Thomas <rrt@sc3d.org> 2012\n(c) Angus J. C. Duggan 1991-1997\nSee file LICENSE for details.\n" +#define COPYRIGHT_STRING "(c) Reuben Thomas <rrt@sc3d.org> 2014\n(c) Angus J. C. Duggan 1991-1997\nSee file LICENSE for details.\n" diff --git a/Build/source/texk/psutils/psutils-1.21/psutils.1 b/Build/source/texk/psutils/psutils-1.23/psutils.1 index 5ddc7b94925..d9f0a9d9fa2 100644 --- a/Build/source/texk/psutils/psutils-1.21/psutils.1 +++ b/Build/source/texk/psutils/psutils-1.23/psutils.1 @@ -7,7 +7,15 @@ documents which follow the Adobe Document Structuring Conventions. .SH AUTHOR Written by Angus J. C. Duggan. .SH "SEE ALSO" -psbook(1), psselect(1), pstops(1), epsffit(1), psnup(1), psresize(1), psjoin(1), extractres(1), includeres(1) +.BR psbook (1), +.BR psselect (1), +.BR pstops (1), +.BR epsffit (1), +.BR psnup (1), +.BR psresize (1), +.BR psjoin (1), +.BR extractres (1), +.BR includeres (1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/texk/psutils/psutils.test b/Build/source/texk/psutils/psutils.test index aeefba8b06d..1f6dcfe05e0 100755 --- a/Build/source/texk/psutils/psutils.test +++ b/Build/source/texk/psutils/psutils.test @@ -1,8 +1,12 @@ #! /bin/sh -# Copyright (C) 2011-2013 Peter Breitenlohner <tex-live@tug.org> +# Copyright (C) 2011-2014 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +TEXMFCNF=$srcdir/../kpathsea +PSUTILSINPUTS=$srcdir/data +export TEXMFCNF PSUTILSINPUTS + failed= rm -rf play* diff --git a/Build/source/texk/psutils/verror.c b/Build/source/texk/psutils/verror.c new file mode 100644 index 00000000000..d5486a14143 --- /dev/null +++ b/Build/source/texk/psutils/verror.c @@ -0,0 +1,29 @@ +/* verror.c: TeX Live specific definition + + Copyright 2014 Peter Breitenlohner. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include <verror.h> + +void +verror (int status, int errnum, const char *format, va_list args) +{ + (void) errnum; + fflush (stdout); + vfprintf (stderr, format, args); + fputc ('\n', stderr); + exit (status); +} diff --git a/Build/source/texk/psutils/verror.h b/Build/source/texk/psutils/verror.h new file mode 100644 index 00000000000..afdd3d6ffb8 --- /dev/null +++ b/Build/source/texk/psutils/verror.h @@ -0,0 +1,25 @@ +/* verror.h: TeX Live specific declaration + + Copyright 2014 Peter Breitenlohner. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _VERROR_H +#define _VERROR_H 1 + +#include <stdarg.h> + +extern void verror (int status, int errnum, const char *format, va_list args); + +#endif /* _VERROR_H */ diff --git a/Build/source/texk/psutils/version.ac b/Build/source/texk/psutils/version.ac index 43e11b6bf7d..1202cb0db2b 100644 --- a/Build/source/texk/psutils/version.ac +++ b/Build/source/texk/psutils/version.ac @@ -1,5 +1,5 @@ dnl -dnl Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org> +dnl Copyright (C) 2013, 2014 Peter Breitenlohner <tex-live@tug.org> dnl dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current psutils version -m4_define([psutils_version], [1.21]) +m4_define([psutils_version], [1.23]) diff --git a/Build/source/texk/psutils/xvasprintf.h b/Build/source/texk/psutils/xvasprintf.h new file mode 100644 index 00000000000..73e84fe4fab --- /dev/null +++ b/Build/source/texk/psutils/xvasprintf.h @@ -0,0 +1 @@ +/* xvasprintf.h: empty */ |