From 013683b030ca5199bd9b3a562b72da9d7918e427 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 26 Aug 2014 17:29:47 +0000 Subject: bundledoc git-svn-id: svn://tug.org/texlive/trunk@35041 c570f23f-e606-0410-a88d-b1316a301751 --- .../texk/texlive/linked_scripts/bundledoc/arlatex | 9 +++++-- .../texlive/linked_scripts/bundledoc/bundledoc | 30 ++++++++++++++-------- 2 files changed, 27 insertions(+), 12 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/texlive/linked_scripts/bundledoc/arlatex b/Build/source/texk/texlive/linked_scripts/bundledoc/arlatex index bb7e5d304bc..32cdd45c90a 100755 --- a/Build/source/texk/texlive/linked_scripts/bundledoc/arlatex +++ b/Build/source/texk/texlive/linked_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 ; @@ -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/Build/source/texk/texlive/linked_scripts/bundledoc/bundledoc b/Build/source/texk/texlive/linked_scripts/bundledoc/bundledoc index 322b88237a0..7c5d489eb51 100755 --- a/Build/source/texk/texlive/linked_scripts/bundledoc/bundledoc +++ b/Build/source/texk/texlive/linked_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 assumes you have B and uses it to produce a F<.zip> archive file. The -configuration file has B use the rather nonstandard -B to find LaTeX files. +configuration file now has B use B to find LaTeX +files; older version of MikTeX required the rather nonstandard +B for this purpose. + +=item F + +This is a variant of F that uses B instead +of B to archive files. B is a script included in the +B distribution that generates a self-extracting F<.tex> +file based on LaTeX's C environment. =back @@ -801,7 +811,7 @@ to run B on a different system. I'd like B 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) and you need to create a substantially different configuration file from F and F, please send it to me at the address listed in L<"AUTHOR"> so I can include it in a future version of B. (I make no promises, though). @@ -826,8 +836,8 @@ updating B to properly handle document subdirectories. =head1 SEE ALSO -gzip(1), kpsewhich(1), latex(1), perl(1), zip(1), the B -documentation +arlatex(1), gzip(1), kpsewhich(1), latex(1), perl(1), zip(1), +the B documentation =head1 AUTHOR -- cgit v1.2.3