summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-08-26 17:29:47 +0000
committerKarl Berry <karl@freefriends.org>2014-08-26 17:29:47 +0000
commit013683b030ca5199bd9b3a562b72da9d7918e427 (patch)
tree0676a8c33931d8de449a7e01016c04201090fb3a /Master/texmf-dist/scripts
parentf37a8d071f5ba62ebfb723ea32f128e66a4fd66e (diff)
bundledoc
git-svn-id: svn://tug.org/texlive/trunk@35041 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/bundledoc/arlatex9
-rwxr-xr-xMaster/texmf-dist/scripts/bundledoc/bundledoc30
2 files changed, 27 insertions, 12 deletions
diff --git a/Master/texmf-dist/scripts/bundledoc/arlatex b/Master/texmf-dist/scripts/bundledoc/arlatex
index bb7e5d304bc..32cdd45c90a 100755
--- a/Master/texmf-dist/scripts/bundledoc/arlatex
+++ b/Master/texmf-dist/scripts/bundledoc/arlatex
@@ -9,7 +9,7 @@
########################################################################
# arlatex #
-# Copyright (C) 2011 Scott Pakin #
+# Copyright (C) 2014 Scott Pakin #
# #
# This program may be distributed and/or modified under the conditions #
# of the LaTeX Project Public License, either version 1.3c of this #
@@ -27,7 +27,7 @@
########################################################################
use 5.006; # Fail gracefully if we're not using Perl v5.6.0.
-our $VERSION = "1.02"; # Specify the version of arlatex.
+our $VERSION = "1.03"; # Specify the version of arlatex.
use Getopt::Long;
use Pod::Usage;
use File::Basename;
@@ -38,6 +38,7 @@ use strict;
my $progname = basename($0); # Name of this program
my $latexfile; # Main LaTeX document
my $outfile = "-"; # Output file (default is standard output)
+my $baseoutfile = "-"; # Base name of output file
######################################################################
@@ -46,6 +47,8 @@ sub includefile ($)
{
my $filename = $_[0];
my $basefilename = basename $filename;
+ next if $basefilename eq $baseoutfile; # Don't let a file overwrite itself.
+ $basefilename = "\"$basefilename\"" if $basefilename =~ /\s/ && substr($basefilename, 0, 1) ne '"';
open (SOMEFILE, "<$filename") || die "${progname}: $! ($filename)\n";
print OUTFILE "\\begin{filecontents*}{$basefilename}\n";
print OUTFILE <SOMEFILE>;
@@ -71,6 +74,7 @@ if (!-e $latexfile) {
$latexfile = $newlatexfile;
}
}
+$baseoutfile = basename $outfile if $outfile ne "-";
# Read the entire input file.
open (LATEXFILE, "<$latexfile") || die "${progname}: $! ($latexfile)\n";
@@ -84,6 +88,7 @@ open (OUTFILE, ">$outfile") || die "${progname}: $! ($outfile)\n";
while ($entirefile[0] =~ /^\s*(\%.*)?$/) {
print OUTFILE (shift @entirefile);
}
+print OUTFILE "\\IfFileExists{filecontents.sty}{\\RequirePackage{filecontents}}{}\n";
my @expandedARGV;
foreach my $filename (@ARGV) {
if (-f $filename) {
diff --git a/Master/texmf-dist/scripts/bundledoc/bundledoc b/Master/texmf-dist/scripts/bundledoc/bundledoc
index 322b88237a0..7c5d489eb51 100755
--- a/Master/texmf-dist/scripts/bundledoc/bundledoc
+++ b/Master/texmf-dist/scripts/bundledoc/bundledoc
@@ -7,7 +7,7 @@
########################################################################
# bundledoc #
-# Copyright (C) 2011 Scott Pakin #
+# Copyright (C) 2014 Scott Pakin #
# #
# This program may be distributed and/or modified under the conditions #
# of the LaTeX Project Public License, either version 1.3c of this #
@@ -25,7 +25,7 @@
########################################################################
use 5.006; # Fail gracefully if we're not using Perl v5.6.0.
-our $VERSION = "3.1"; # Specify the version of bundledoc.
+our $VERSION = "3.2"; # Specify the version of bundledoc.
use File::Basename;
use File::Copy;
use File::Spec::Functions qw(abs2rel catfile devnull rel2abs rootdir updir);
@@ -39,9 +39,9 @@ use strict;
######################################################################
# Variables the user can override with a configuration file
-# DEFAULTS: Unix + kpathsea
+# DEFAULTS: Linux + kpathsea
my %uservariable;
-$uservariable{"bundle"} = '(tar -cvf - $BDINPUTS | compress > $BDBASE.tar.Z)';
+$uservariable{"bundle"} = '(tar -cvf - $BDINPUTS | gzip --best > $BDBASE.tar.gz)';
$uservariable{"find"} = 'kpsewhich -progname=latex $BDINPUTS';
$uservariable{"sink"} = '> ' . devnull() . ' 2>&1';
@@ -66,8 +66,10 @@ my %subdirs; # Map from a qualified name to its sub
# or abort if we can't.
sub qualifyname ($)
{
+ my $filename = $_[0];
+ $filename = "\"$filename\"" if $filename =~ /\s/ && substr($filename, 0, 1) ne '"';
my $command = $uservariable{find};
- $command =~ s/[\$\%]BDINPUTS\%?/$_[0]/g;
+ $command =~ s/[\$\%]BDINPUTS\%?/$filename/g;
$command =~ s/[\$\%]BDBASE\%?/$ENV{"BDBASE"}/g;
my $qualified = `$command` ||
die "${progname}: \"$uservariable{find}\" (BDINPUTS=\"$_[0]\") failed to find $_[0]\n";
@@ -694,8 +696,16 @@ files.
Configuration file for MikTeX installations. MikTeX is a popular TeX
distribution for Microsoft Windows. F<miktex.cfg> assumes you have
B<zip> and uses it to produce a F<.zip> archive file. The
-configuration file has B<bundledoc> use the rather nonstandard
-B<initexmf> to find LaTeX files.
+configuration file now has B<bundledoc> use B<kpsewhich> to find LaTeX
+files; older version of MikTeX required the rather nonstandard
+B<initexmf> for this purpose.
+
+=item F<texlive-unix-arlatex.cfg>
+
+This is a variant of F<texlive-unix.cfg> that uses B<arlatex> instead
+of B<gzip> to archive files. B<arlatex> is a script included in the
+B<bundledoc> distribution that generates a self-extracting F<.tex>
+file based on LaTeX's C<filecontents> environment.
=back
@@ -801,7 +811,7 @@ to run B<bundledoc> on a different system.
I'd like B<bundledoc> to work on as wide a variety of TeX
distributions as possible. If your platform is significantly
different from the ones listed in L<"Testing Status"> (e.g., if you're
-running MacOS) and you need to create a substantially different
+running Z<OS X>) and you need to create a substantially different
configuration file from F<texlive-unix.cfg> and F<miktex.cfg>, please
send it to me at the address listed in L<"AUTHOR"> so I can include it
in a future version of B<bundledoc>. (I make no promises, though).
@@ -826,8 +836,8 @@ updating B<bundledoc> to properly handle document subdirectories.
=head1 SEE ALSO
-gzip(1), kpsewhich(1), latex(1), perl(1), zip(1), the B<snapshot>
-documentation
+arlatex(1), gzip(1), kpsewhich(1), latex(1), perl(1), zip(1),
+the B<snapshot> documentation
=head1 AUTHOR