diff options
Diffstat (limited to 'Master/texmf-dist/doc/support/dosepsbin')
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/Makefile.in | 114 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/README | 53 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/clean-case.pl | 20 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html | 199 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx | 100 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf | bin | 0 -> 46090 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt | 119 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/dosepsbin/version.pl | 145 |
8 files changed, 750 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/dosepsbin/Makefile.in b/Master/texmf-dist/doc/support/dosepsbin/Makefile.in new file mode 100644 index 00000000000..842810a171c --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/Makefile.in @@ -0,0 +1,114 @@ +# Makefile.in +# @configure_input@ + +# Copyright 2007, 2008, 2011 by Heiko Oberdiek. +# +# The file is part of project dosepsbin. +# It's free software; you may redistribute it and/or +# modify it under the same terms as Perl itself +# (Perl Artistic License/GNU General Public License, version 2). + +VPATH = @srcdir@ +srcdir = @srcdir@ +SHELL = @SHELL@ + +prefix = @prefix@ +datarootdir = @datarootdir@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +mandir = @mandir@ +manext = 1 +man1dir = $(mandir)/man$(manext) + +INSTALL = @INSTALL@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ + +PRJ = dosepsbin +SRC_FILE = $(PRJ).pl +SRC_FILES = $(SRC_FILE) $(PRJ).ltx clean-case.pl version.pl +DOC_FILES = $(PRJ).txt $(PRJ).man $(PRJ).html $(PRJ).pdf README +ALL_FILES = $(DOC_FILES) configure +AUTOSRC_FILES = configure.ac Makefile.in install-sh +DISTRIB_FILES = $(SRC_FILES) $(ALL_FILES) $(AUTOSRC_FILES) +PDFLATEX = TEXINPUTS=$(srcdir): pdflatex +LUALATEX = TEXINPUTS=$(srcdir): lualatex +TMP_FILE = __temp__.pl +FILE_DATE_VERSION = date-version.txt + +default all: + +include $(wildcard $(srcdir)/$(PRJ).mk) + +configure: configure.ac + autoconf + +Makefile: Makefile.in configure + ./configure + +doc: $(DOC_FILES) + +$(FILE_DATE_VERSION): $(SRC_FILE) + ./version.pl + autoconf + ./configure + +$(PRJ).txt: $(SRC_FILE) + pod2text -l $< $@ + +$(PRJ).man: $(SRC_FILE) $(FILE_DATE_VERSION) + pod2man -d "$(shell cat $(FILE_DATE_VERSION))" $< $@ + +html: $(PRJ).html +$(PRJ).html: $(SRC_FILE) ./clean-case.pl + ./clean-case.pl $< $(TMP_FILE) + pod2html --title=$(PRJ) --infile=$(TMP_FILE) --outfile=$@ + +$(PRJ).pdf: $(PRJ).ltx $(PRJ).tex + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + +$(PRJ).tex: $(SRC_FILE) + ./clean-case.pl $< $(TMP_FILE) + pod2latex -out $@ $(TMP_FILE) + recode latin1..utf8 $@ + +distrib: $(PRJ).zip + +$(PRJ).zip: $(DISTRIB_FILES) + zip -9j $@ $+ + +install: + $(INSTALL) -d $(bindir) $(man1dir) + $(INSTALL_SCRIPT) $(srcdir)/$(PRJ).pl $(bindir)/$(PRJ) + $(INSTALL_DATA) $(srcdir)/$(PRJ).man $(man1dir)/$(PRJ).1 + +check: $(SRC_FILE) + podchecker $< + +uninstall: + -rm -f $(bindir)/$(PRJ) $(man1dir)/$(PRJ).1 + +clean: + -rm -f $(PRJ).aux $(PRJ).log $(PRJ).toc + -rm -f $(PRJ).idx $(PRJ).ind $(PRJ).ilg + -rm -f pod2htmd.tmp pod2htmi.tmp + +distclean: clean + -rm -f Makefile config.status config.log config.cache + -rm -f $(PRJ).tex + +realclean: distclean + -rm -f $(ALL_FILES) $(PRJ).zip + +mostlyclean: clean + +.PHONY: default all doc distrib install check uninstall \ + clean distclean realclean mostlyclean test html diff --git a/Master/texmf-dist/doc/support/dosepsbin/README b/Master/texmf-dist/doc/support/dosepsbin/README new file mode 100644 index 00000000000..83dd6571808 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/README @@ -0,0 +1,53 @@ +README for dosepsbin 2011/11/10 v1.0 + +Copyright 2011 by Heiko Oberdiek + +License +======= +The file is part of project dosepsbin. +It's free software; you may redistribute it and/or +modify it under the same terms as Perl itself +(Perl Artistic License/GNU General Public License, version 2). + +Requirements +============ +* Perl + +Documentation +============= +The source of the documentation is embedded as POD data +in the Perl script dosepsbin.pl. The documentation is +available in various formats: +* Manual page: dosepsbin.man +* PDF file: dosepsbin.pdf +* HTML file: dosepsbin.html +* Text file: dosepsbin.txt +And program option --man displays the documentation on +the screen. + +Installation +============ +* Unix: + GNU autoconf was used, thus you can try: + ./configure + make install + It should install the script and manual page. + The other documentation files can be installed manually. + +* Manually: + * dosepsbin.pl: Install the file as `dosepsbin' in a directory + that is listed in environment variable `PATH', e.g. + /usr/local/bin/dosepsbin + * dosepsbin.man: Install the manual page as `dosepsbin.1' + in the appropriate directory, e.g.: + /usr/local/man/man1/dosepsbin.1 + * dosepsbin.pdf, dosepsbin.html, dosepsbin.html, README: + Install them where you find them, for example in directory: + /usr/local/share/doc/dosepsbin/ + +The files clean-case.pl and version.pl are just helper scripts for +generating the documentation and are provided for sake of completeness. +They are usually not needed, because the documentation files are +already generated and provided in the distribution. + +See the documentation for further information. diff --git a/Master/texmf-dist/doc/support/dosepsbin/clean-case.pl b/Master/texmf-dist/doc/support/dosepsbin/clean-case.pl new file mode 100644 index 00000000000..fe72e184d02 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/clean-case.pl @@ -0,0 +1,20 @@ +#!/usr/bin/env perl +use strict; +$^W=1; + +@ARGV == 2 or die "!!! Syntax: <input file> <output file>\n"; + +my $infile = $ARGV[0]; +my $outfile = $ARGV[1]; + +open(IN, '<', $infile) or die "!!! Error: Cannot open `$infile'!\n"; +open(OUT, '>', $outfile) or die "!!! Error: Cannot write `$outfile'!\n"; +while (<IN>) { + s/^(=head[1] [A-Z])(.*)/$1\L$2\E/; + s/(L<"[A-Z])([^"]+)">/$1\L$2\E">/g; + print OUT; +} +close(IN); +close(OUT); + +__END__ diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html new file mode 100644 index 00000000000..63477cdc835 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html @@ -0,0 +1,199 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>dosepsbin</title> +<link rev="made" href="mailto:feedback@suse.de" /> +</head> + +<body style="background-color: white"> + +<p><a name="__index__"></a></p> +<!-- INDEX BEGIN --> + +<ul> + + <li><a href="#name">Name</a></li> + <li><a href="#version">Version</a></li> + <li><a href="#synopsis">Synopsis</a></li> + <li><a href="#description">Description</a></li> + <ul> + + <li><a href="#dos_eps_binary_file_format">DOS EPS Binary File Format</a></li> + </ul> + + <li><a href="#options">Options</a></li> + <li><a href="#examples">Examples</a></li> + <li><a href="#author">Author</a></li> + <li><a href="#copyright_and_license">Copyright and license</a></li> + <li><a href="#see_also">See also</a></li> + <li><a href="#history">History</a></li> +</ul> +<!-- INDEX END --> + +<hr /> +<p> +</p> +<h1><a name="name">Name</a></h1> +<p>dosepsbin -- Extract PS/WMF/TIFF sections from DOS EPS binary files</p> +<p> +</p> +<hr /> +<h1><a name="version">Version</a></h1> +<p>2011-11-10 v1.0</p> +<p> +</p> +<hr /> +<h1><a name="synopsis">Synopsis</a></h1> +<p>The progam <strong>dosepsbin</strong> analyses an EPS file that is not +a plain ASCII PostScript file but given as DOS EPS binary file.</p> +<pre> + dosepsbin [options] <input file></pre> +<p>First it analyzes the <em>input file</em>, validates its header +and summarizes the available sections. Depending on the +given options, the sections are then written to files.</p> +<p>Options:</p> +<pre> + --eps-file <file> Write PS section to <file>. + --wmf-file <file> Write WMF section to <file>. + --tiff-file <file> Write WMF section to <file>. + --inputfile <file> The name of the input file. + --verbose Verbose output. + --quiet Only errors and warnings are printed. + --help Brief help message. + --man Full documentation. + --version Print version identification.</pre> +<p>The files for output must be different from the input file.</p> +<p> +</p> +<hr /> +<h1><a name="description">Description</a></h1> +<p> +</p> +<h2><a name="dos_eps_binary_file_format">DOS EPS Binary File Format</a></h2> +<p>A Encapsulated PostScript (EPS) file can also given in a special +binary format to support the inclusion of a thumbnail. The file +format starts with a binary header that contains the positions of +the possible sections:</p> +<ul> +<li><strong><a name="item_postscript">Postscript (PS)</a></strong><br /> +</li> +<li><strong><a name="item_format">Windows Metafile Format (WMF)</a></strong><br /> +</li> +<li><strong>Tag Image File Format (TIFF)</strong><br /> +</li> +</ul> +<p>The PS section must be present and either the WMF file or the TIFF +file should be given.</p> +<p> +</p> +<hr /> +<h1><a name="options">Options</a></h1> +<dl> +<dt><strong><a name="item__2d_2deps_2dfile_3d_3cfile_3e"><strong>-</strong><strong>-eps-file</strong>=<<em>file</em>></a></strong><br /> +</dt> +<dd> +The PS section is written to <<em>file</em>>. The output file must +be different from the input file. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dwmf_2dfile_3d_3cfile_3e"><strong>-</strong><strong>-wmf-file</strong>=<<em>file</em>></a></strong><br /> +</dt> +<dd> +The WMF section is written to <<em>file</em>> if present. The output +file must be different from the input file. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dtiff_2dfile_3d_3cfile_3e"><strong>-</strong><strong>-tiff-file</strong>=<<em>file</em>></a></strong><br /> +</dt> +<dd> +The TIFF section is written to <<em>file</em>> if present. The output +file must be different from the input file. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dinputfile_3d_3cfile_3e"><strong>-</strong><strong>-inputfile</strong>=<<em>file</em>></a></strong><br /> +</dt> +<dd> +The input file can also be given directly on the command line. +If the file does not exist, then the file with extension `.eps' +is tried. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dverbose"><strong>-</strong><strong>-verbose</strong></a></strong><br /> +</dt> +<dd> +Verbose messages. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dquiet"><strong>-</strong><strong>-quiet</strong></a></strong><br /> +</dt> +<dd> +No messages are printed except for errors and warnings. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dhelp"><strong>-</strong><strong>-help</strong></a></strong><br /> +</dt> +<dd> +Display help screen. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dman"><strong>-</strong><strong>-man</strong></a></strong><br /> +</dt> +<dd> +Prints manual page. +</dd> +<p></p> +<dt><strong><a name="item__2d_2dversion"><strong>-</strong><strong>-version</strong></a></strong><br /> +</dt> +<dd> +Print version identification and exit. +</dd> +<p></p></dl> +<p> +</p> +<hr /> +<h1><a name="examples">Examples</a></h1> +<p>The following command extracts the PS section from file <em>test.eps</em> +and stores the result in file <em>test-ps.eps</em>:</p> +<pre> + dosepsbin --eps-file test-ps.eps test.eps</pre> +<p> +</p> +<hr /> +<h1><a name="author">Author</a></h1> +<p>Heiko Oberdiek, email: heiko.oberdiek at googlemail.com</p> +<p> +</p> +<hr /> +<h1><a name="copyright_and_license">Copyright and license</a></h1> +<p>Copyright 2011 by Heiko Oberdiek.</p> +<p>This library is free software; you may redistribute it and/or +modify it under the same terms as Perl itself +(Perl Artistic License/GNU General Public License, version 2).</p> +<p> +</p> +<hr /> +<h1><a name="see_also">See also</a></h1> +<p>The DOS EPS binary file format is described +in section ``5.2 Windows Metafile or TIFF'':</p> +<pre> + Adobe Developer Support, + Encapsulated PostScript File Format Specification, + Version 3.0, + 1992-05-01, + <a href="http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf">http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf</a></pre> +<p> +</p> +<hr /> +<h1><a name="history">History</a></h1> +<ol> +<li><strong><a name="item__2f11_2f10_v1_2e0"><strong>2011/11/10 v1.0</strong></a></strong><br /> +</li> +<ul> +<li><strong><a name="item_first_version_2e">First version.</a></strong><br /> +</li> +</ul> +</ol> + +</body> + +</html> diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx new file mode 100644 index 00000000000..c2206cdc21d --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx @@ -0,0 +1,100 @@ +% dosepsbin.ltx +% +% Copyright 2011 by Heiko Oberdiek. +% +% The file is part of project dosepsbin. +% It's free software; you may redistribute it and/or +% modify it under the same terms as Perl itself +% (Perl Artistic License/GNU General Public License, version 2). + +\documentclass[a4paper,12pt]{article} + +\providecommand*{\DATE}{2011/11/10} +\providecommand*{\VERSION}{1.0} + +\usepackage[ + hmargin=1in, + top=.75in, + bottom=.5in, + includefoot, + headheight=14.5pt, + footskip=40pt, +]{geometry} + +\usepackage{fancyhdr} +\renewcommand*{\headrulewidth}{0pt} +\renewcommand*{\footrulewidth}{0.4pt} +\fancyhead{} +\fancyfoot[L]{\textsf{dosepsbin}} +\fancyfoot[C]{\DATE\ v\VERSION} +\fancyfoot[R]{\thepage} +\pagestyle{fancy} +\makeatletter +\let\ps@plain\ps@fancy +\makeatother + +\makeatletter +\renewenvironment*{theindex}{% + \section*{\indexname}% + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus .3pt}% + \let\item\@idxitem +}{% + \clearpage +} +\makeatother + +\usepackage{ifluatex} +\ifluatex + \usepackage{fontspec} +\else + \usepackage[T1]{fontenc}% + \usepackage{lmodern}% + \usepackage[utf8]{inputenc}% +\fi + +\usepackage{makeidx} + +\usepackage{hyperref} +\hypersetup{ + colorlinks, + pdfauthor={Heiko Oberdiek}, + pdftitle={dosepsbin}, +} +\definecolor{linkcolor}{rgb}{0,0,.8} +\hypersetup{ + linkcolor=linkcolor, +} + +\usepackage{bookmark} +\bookmarksetup{ + open, + numbered, +} + +\makeindex + +\author{Heiko Oberdiek} +\title{Program \textsf{dosepsbin}} +\date{\DATE\space v\VERSION} + +% ignore minor overfull \hbox warnings +\setlength{\hfuzz}{1.5pt} + +\begin{document} + +\maketitle + +\pdfbookmark[1]{\contentsname}{toc} +\tableofcontents + +\makeatletter +\let\org@section\section +\def\section{\@ifstar\org@section\org@section} +\makeatother + +\input{dosepsbin.tex} + +\printindex + +\end{document} diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf Binary files differnew file mode 100644 index 00000000000..854143d8eec --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt new file mode 100644 index 00000000000..3980a9e55c4 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt @@ -0,0 +1,119 @@ +NAME + + dosepsbin -- Extract PS/WMF/TIFF sections from DOS EPS binary files + +VERSION + + 2011-11-10 v1.0 + +SYNOPSIS + + The progam dosepsbin analyses an EPS file that is not a plain ASCII + PostScript file but given as DOS EPS binary file. + + dosepsbin [options] <input file> + + First it analyzes the *input file*, validates its header and summarizes + the available sections. Depending on the given options, the sections are + then written to files. + + Options: + + --eps-file <file> Write PS section to <file>. + --wmf-file <file> Write WMF section to <file>. + --tiff-file <file> Write WMF section to <file>. + --inputfile <file> The name of the input file. + --verbose Verbose output. + --quiet Only errors and warnings are printed. + --help Brief help message. + --man Full documentation. + --version Print version identification. + + The files for output must be different from the input file. + +DESCRIPTION + + DOS EPS Binary File Format + + A Encapsulated PostScript (EPS) file can also given in a special binary + format to support the inclusion of a thumbnail. The file format starts + with a binary header that contains the positions of the possible + sections: + + * Postscript (PS) + * Windows Metafile Format (WMF) + * Tag Image File Format (TIFF) + + The PS section must be present and either the WMF file or the TIFF file + should be given. + +OPTIONS + + --eps-file=<*file*> + The PS section is written to <*file*>. The output file must be + different from the input file. + + --wmf-file=<*file*> + The WMF section is written to <*file*> if present. The output file + must be different from the input file. + + --tiff-file=<*file*> + The TIFF section is written to <*file*> if present. The output file + must be different from the input file. + + --inputfile=<*file*> + The input file can also be given directly on the command line. If + the file does not exist, then the file with extension `.eps' is + tried. + + --verbose + Verbose messages. + + --quiet + No messages are printed except for errors and warnings. + + --help + Display help screen. + + --man + Prints manual page. + + --version + Print version identification and exit. + +EXAMPLES + + The following command extracts the PS section from file test.eps and + stores the result in file test-ps.eps: + + dosepsbin --eps-file test-ps.eps test.eps + +AUTHOR + + Heiko Oberdiek, email: heiko.oberdiek at googlemail.com + +COPYRIGHT AND LICENSE + + Copyright 2011 by Heiko Oberdiek. + + This library is free software; you may redistribute it and/or modify it + under the same terms as Perl itself (Perl Artistic License/GNU General + Public License, version 2). + +SEE ALSO + + The DOS EPS binary file format is described in section "5.2 Windows + Metafile or TIFF": + + Adobe Developer Support, + Encapsulated PostScript File Format Specification, + Version 3.0, + 1992-05-01, + http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf + +HISTORY + + 2011/11/10 v1.0 + + * First version. + diff --git a/Master/texmf-dist/doc/support/dosepsbin/version.pl b/Master/texmf-dist/doc/support/dosepsbin/version.pl new file mode 100644 index 00000000000..524edb8a6ec --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/version.pl @@ -0,0 +1,145 @@ +#!/usr/bin/env perl +use strict; +$^W=1; + +my $prj = 'dosepsbin'; +my $infile = "$prj.pl"; +my $acfile = 'configure.ac'; +my $ltxfile = "$prj.ltx"; +my $readmefile = 'README'; +my $datefile = 'date-version.txt'; +my $tmpfile = "version.tmp"; + +my $date = ''; +my $version = ''; +my $copyright_years = ''; +my $pl_date_version = ''; + +open(IN, '<', $infile) or die "!!! Error: Cannot open `$infile'!\n"; +while (<IN>) { + if (/my \$date\s*=\s*'([0-9\/]+)'/) { + $date = $1; + next; + } + if (/my \$version\s*=\s*'([0-9\.]+)'/) { + $version = $1; + next; + } + if (/my \$copyright\s*=\s*"Copyright (.*) \$author"/) { + $copyright_years = $1; + next; + } + if (/^(\d{4}-\d{2}-\d{2} v\d+\.\d+)\s*$/) { + $pl_date_version = $1; + next; + } +} + +$date or die "!!! Error: Date not found!\n"; +$version or die "!!! Error: Version not found!\n"; +$copyright_years or die "!!! Error: Copyright years not found!\n"; +my $isodate = $date; +$isodate =~ s|/|-|g; +my $date_version = "$isodate v$version"; +$pl_date_version or die "!!! Error: VERSION/POD not found!\n"; +$pl_date_version eq $date_version or die "!!! Error: Fix VERSION in pod section!\n"; + +open(OUT, '>', $tmpfile) or die "!!! Error: Cannot open `$tmpfile'!\n"; +open(IN, '<', $acfile) or die "!!! Error: Cannot open `$acfile'!\n"; +my $found = 0; +my $update = 0; +while (<IN>) { + if (/^(dnl Copyright )(.*)( by .*)$/) { + $found |= 1; + $_ = "$1$copyright_years$3\n"; + $update = 1 unless $2 eq $copyright_years; + } + if (/^(AC_INIT\(dosepsbin, )([^,]*)(,.*|\).*)$/) { + $found |= 2; + $_ = "$1$version$3\n"; + $update = 1 unless $2 eq $version; + } + print OUT; +} +die "!!! Error: COPYRIGHT or AC_INIT line not found!\n" unless $found = 3; +unlink $acfile or die "!!! Error: Cannot delete `$acfile'!\n"; +rename $tmpfile, $acfile + or die "!!! Error: Cannot rename `$tmpfile' to `$acfile'!\n"; +print "--> `$acfile' updated\n" if $update; + +open(OUT, '>', $tmpfile) or die "!!! Error: Cannot open `$tmpfile'!\n"; +open(IN, '<', $ltxfile) or die "!!! Error: Cannot open `$ltxfile'!\n"; +$found = 0; +$update = 0; +while (<IN>) { + if (/^(% Copyright )(.*)( by .*)$/) { + $found |= 1; + $_ = "$1$copyright_years$3\n"; + $update = 1 unless $2 eq $copyright_years; + } + if (/^(\\providecommand\*{\\DATE}{)(.*)(})$/) { + $found |= 2; + $_ = "$1$date$3\n"; + $update = 1 unless $2 eq $date; + } + if (/^(\\providecommand\*{\\VERSION}{)(.*)(})$/) { + $found |= 4; + $_ = "$1$version$3\n"; + $update = 1 unless $2 eq $version; + } + print OUT; +} +close(IN); +close(OUT); +die "!!! Error: COPYRIGHT or DATE or VERSION line not found!\n" + unless $found == 7; +unlink $ltxfile or die "!!! Error: Cannot delete `$ltxfile'!\n"; +rename $tmpfile, $ltxfile + or die "!!! Error: Cannot rename `$tmpfile' to `$ltxfile'!\n"; +print "--> `$ltxfile' updated\n" if $update; + +open(OUT, '>', $tmpfile) or die "!!! Error: Cannot open `$tmpfile'!\n"; +open(IN, '<', $readmefile) or die "!!! Error: Cannot open `$readmefile'!\n"; +$found = 0; +$update = 0; +while (<IN>) { + if (/^(Copyright )(.*)( by .*)$/) { + $found |= 1; + $_ = "$1$copyright_years$3\n"; + $update = 1 unless $2 eq $copyright_years; + } + if (/^(README for dosepsbin )([0-9\/]+) v([0-9\.]+)$/) { + $found |= 2; + $_ = "$1$date v$version\n"; + $update = 1 unless $2 eq $date and $3 eq $version; + } + print OUT; +} +close(IN); +close(OUT); +die "!!! Error: COPYRIGHT or DATE/VERSION line not found!\n" + unless $found == 3; +unlink $readmefile or die "!!! Error: Cannot delete `$readmefile'!\n"; +rename $tmpfile, $readmefile + or die "!!! Error: Cannot rename `$tmpfile' to `$readmefile'!\n"; +print "--> `$readmefile' updated.\n" if $update; + +my $old_date_version = ''; +if (-f $datefile) { + open(IN, '<', $datefile) or die "!!! Error: Cannot open `$datefile'!\n"; + my @lines = <IN>; + $old_date_version = "@lines"; + close(IN); +} +if ($old_date_version eq $date_version) { + # print "--> `$datefile' is already uptodate.\n"; +} +else { + open(OUT, '>', $datefile) or die "!!! Error: Cannot open `$datefile'!\n"; + print OUT $date_version; + close(OUT); + print "--> `$datefile' updated.\n"; +} + +1; +__END__ |