From 093262994f4504b8f4bcd637076ef4645e615365 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 8 Sep 2019 21:54:05 +0000 Subject: bundledoc (8sep19) git-svn-id: svn://tug.org/texlive/trunk@52059 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/man/man1/arlatex.1 | 22 +++-- Master/texmf-dist/doc/man/man1/arlatex.man1.pdf | Bin 33308 -> 32743 bytes Master/texmf-dist/doc/man/man1/bundledoc.1 | 52 ++++++----- Master/texmf-dist/doc/man/man1/bundledoc.man1.pdf | Bin 50299 -> 48814 bytes Master/texmf-dist/doc/support/bundledoc/README | 16 ++-- Master/texmf-dist/scripts/bundledoc/bundledoc | 100 +++++++++++++++++----- 6 files changed, 133 insertions(+), 57 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/man/man1/arlatex.1 b/Master/texmf-dist/doc/man/man1/arlatex.1 index b485702d89d..8ffce4fe1a2 100644 --- a/Master/texmf-dist/doc/man/man1/arlatex.1 +++ b/Master/texmf-dist/doc/man/man1/arlatex.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -54,16 +54,20 @@ .\" Avoid warning from groff about undefined register 'F'. .de IX .. -.if !\nF .nr F 0 -.if \nF>0 \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{\ -. nr % 0 -. nr F 2 +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} . \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -278,7 +282,7 @@ find it. That is, if the user running \fBlatex\fR on an a different directory. .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fIbundledoc\fR\|(1), \fIlatex\fR\|(1), \fIshar\fR\|(1), \fItar\fR\|(1), \fIzip\fR\|(1) +\&\fBbundledoc\fR\|(1), \fBlatex\fR\|(1), \fBshar\fR\|(1), \fBtar\fR\|(1), \fBzip\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" Scott Pakin, \fIscott+bdoc@pakin.org\fR diff --git a/Master/texmf-dist/doc/man/man1/arlatex.man1.pdf b/Master/texmf-dist/doc/man/man1/arlatex.man1.pdf index 676feee04e8..668dce95763 100644 Binary files a/Master/texmf-dist/doc/man/man1/arlatex.man1.pdf and b/Master/texmf-dist/doc/man/man1/arlatex.man1.pdf differ diff --git a/Master/texmf-dist/doc/man/man1/bundledoc.1 b/Master/texmf-dist/doc/man/man1/bundledoc.1 index 7f0ee40a690..2579c865686 100644 --- a/Master/texmf-dist/doc/man/man1/bundledoc.1 +++ b/Master/texmf-dist/doc/man/man1/bundledoc.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -54,16 +54,20 @@ .\" Avoid warning from groff about undefined register 'F'. .de IX .. -.if !\nF .nr F 0 -.if \nF>0 \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{\ -. nr % 0 -. nr F 2 +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} . \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -129,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BUNDLEDOC 1" -.TH BUNDLEDOC 1 "2018-05-23" "v3.3" "User Commands" +.TH BUNDLEDOC 1 "2019-09-08" "v3.4" "User Commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -142,7 +146,7 @@ bundledoc [\fB\-\-version\fR] [\fB\-\-help\fR] [\fB\-\-\fR[\fBno\fR]\fBverbose\fR] -[\fB\-\-texfile\fR=\fIfile\fR] +[\fB\-\-texfile\fR=\fIfile.tex\fR] [\fB\-\-directory\fR=\fIdirectory\fR] [\fB\-\-\fR[\fBno\fR]\fBlocalonly\fR] [\fB\-\-exclude\fR=\fIstring\fR] @@ -150,8 +154,8 @@ bundledoc [\fB\-\-manifest\fR=\fIfile\fR] [\fB\-\-\fR\fBlistdeps\fR=[yes|no|only|rel]...] [\fB\-\-\fR[\fBno\fR]\fBkeepdirs\fR] -[\fB\-\-config\fR=\fIfile\fR] -\&\fI.dep file\fR +[\fB\-\-config\fR=\fIfile.cfg\fR] +\&\fIfile.dep\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBbundledoc\fR is a post-processor for the \fBsnapshot\fR package that @@ -184,8 +188,9 @@ In the following descriptions, \fIsomefile\fR refers to the name of your main LaTeX document (no extension). .PP \&\fBbundledoc\fR requires the name of the dependency file produced by -\&\fBsnapshot\fR (normally \fIsomefile\fR\fI.dep\fR). The following options may -also be given: +\&\fBsnapshot\fR, normally \fIsomefile\fR\fI.dep\fR). (For convenience, the file +can be specified without its \fI.dep\fR extension.) The following +options may also be given: .IP "\fB\-\-version\fR" 4 .IX Item "--version" Output the \fBbundledoc\fR script's version number. This overrides all @@ -301,7 +306,8 @@ The \f(CW\*(C`\-\-config\*(C'\fR option is used to point \fBbundledoc\fR to the appropriate configuration (\fI.cfg\fR) file for your TeX distribution and operating system. \fBbundledoc\fR comes with a few configuration files and it's easy to write more. See \*(L"\s-1CONFIGURATION FILES\*(R"\s0 (below) for -a description of the configuration file format. +a description of the configuration file format. For convenience, the +file can be specified without its \fI.cfg\fR extension. .SH "CONFIGURATION FILES" .IX Header "CONFIGURATION FILES" .SS "Format" @@ -390,8 +396,11 @@ distribution running on Microsoft Windows: \& bundledoc \-\-config=miktex.cfg myfile.dep .Ve .PP -(In practice, it's probably necessary to specify to \f(CW\*(C`\-\-config\*(C'\fR the -complete path to \fBbundledoc\fR's \fImiktex.cfg\fR configuration file.) +This can be abbreviated to +.PP +.Vb 1 +\& bundledoc \-\-config=miktex myfile +.Ve .PP The following builds a \fI.tar.gz\fR archive with the TeX Live distribution running on a Unix-like operating system. \fBbundledoc\fR @@ -517,11 +526,14 @@ other common font formats, as well. .IX Subsection "Acknowledgments" Thanks to Fabien Vignes-Tourneret for suggesting what became the \&\f(CW\*(C`\-\-localonly\*(C'\fR option and for a discussion that led to the -\&\f(CW\*(C`\-\-exclude\*(C'\fR and \f(CW\*(C`\-\-include\*(C'\fR options; and to Marius Kleiner for -updating \fBbundledoc\fR to properly handle document subdirectories. +\&\f(CW\*(C`\-\-exclude\*(C'\fR and \f(CW\*(C`\-\-include\*(C'\fR options; to Marius Kleiner for updating +\&\fBbundledoc\fR to properly handle document subdirectories; and to Frank +Mittelbach for suggesting using Kpathsea to help find \fI.cfg\fR files +and to automatically append \fI.cfg\fR and \fI.dep\fR extensions if +necessary. .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fIarlatex\fR\|(1), \fIgzip\fR\|(1), \fIkpsewhich\fR\|(1), \fIlatex\fR\|(1), \fIperl\fR\|(1), \fIzip\fR\|(1), +\&\fBarlatex\fR\|(1), \fBgzip\fR\|(1), \fBkpsewhich\fR\|(1), \fBlatex\fR\|(1), \fBperl\fR\|(1), \fBzip\fR\|(1), the \fBsnapshot\fR documentation .SH "AUTHOR" .IX Header "AUTHOR" diff --git a/Master/texmf-dist/doc/man/man1/bundledoc.man1.pdf b/Master/texmf-dist/doc/man/man1/bundledoc.man1.pdf index 39d7e9c8495..6d3a5638ebd 100644 Binary files a/Master/texmf-dist/doc/man/man1/bundledoc.man1.pdf and b/Master/texmf-dist/doc/man/man1/bundledoc.man1.pdf differ diff --git a/Master/texmf-dist/doc/support/bundledoc/README b/Master/texmf-dist/doc/support/bundledoc/README index 30b66220219..bf65ec4454e 100644 --- a/Master/texmf-dist/doc/support/bundledoc/README +++ b/Master/texmf-dist/doc/support/bundledoc/README @@ -25,14 +25,14 @@ as its archiver in place of tar, zip, etc. Files ----- --rwxrwxr-x 1 pakin users 9978 May 22 22:39 arlatex --rw-r--r-- 1 pakin users 10176 May 22 22:40 arlatex.1 --rw-r--r-- 1 pakin users 16731 May 22 22:40 arlatex.pdf --rwxrwxr-x 1 pakin users 29338 May 22 22:37 bundledoc --rw-r--r-- 1 pakin users 23015 May 22 22:37 bundledoc.1 --rw-r--r-- 1 pakin users 29217 May 22 22:37 bundledoc.pdf +-rwxrwxr-x 1 pakin users 9978 May 22 2018 arlatex +-rw-r--r-- 1 pakin users 10262 Sep 6 22:21 arlatex.1 +-rw-r--r-- 1 pakin users 33296 Sep 6 22:26 arlatex.pdf +-rwxrwxr-x 1 pakin users 31263 Sep 7 23:17 bundledoc +-rw-r--r-- 1 pakin users 23351 Sep 7 23:18 bundledoc.1 +-rw-r--r-- 1 pakin users 49713 Sep 7 23:18 bundledoc.pdf -rw-rw-r-- 1 pakin users 342 Jan 22 2014 miktex.cfg --rw-r--r-- 1 pakin users 4430 May 22 22:40 README +-rw-r--r-- 1 pakin users 4435 Sep 7 23:18 README -rw-r--r-- 1 pakin users 248 Aug 24 2014 texlive-unix-arlatex.cfg -rw-rw-r-- 1 pakin users 230 Apr 9 2010 texlive-unix.cfg @@ -84,7 +84,7 @@ Copyright and license --------------------- bundledoc - Copyright (C) 2018 Scott Pakin + Copyright (C) 2018-2019 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 diff --git a/Master/texmf-dist/scripts/bundledoc/bundledoc b/Master/texmf-dist/scripts/bundledoc/bundledoc index 142f1aaac0d..02c7d8e5d93 100755 --- a/Master/texmf-dist/scripts/bundledoc/bundledoc +++ b/Master/texmf-dist/scripts/bundledoc/bundledoc @@ -7,7 +7,7 @@ ######################################################################## # bundledoc # -# Copyright (C) 2018 Scott Pakin # +# Copyright (C) 2018-2019 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 # @@ -24,8 +24,8 @@ # in the Files section of the associated README file. # ######################################################################## -use 5.006; # Fail gracefully if we're not using Perl v5.6.0. -our $VERSION = "3.3"; # Specify the version of bundledoc. +use 5.006; # Fail gracefully if we're not using Perl v5.6.0+. +our $VERSION = "3.4"; # Specify the version of bundledoc. use File::Basename; use File::Copy; use File::Spec::Functions qw(abs2rel catfile devnull rel2abs rootdir updir); @@ -87,8 +87,7 @@ sub executecmd ($) my $retval; if ($verbose) { - print "EXECUTING: $command\n"; - print " (BDINPUTS = $ENV{BDINPUTS})\n"; + print "EXECUTING $command WITH BDINPUTS = $ENV{BDINPUTS}\n"; } if ($pathsep eq "\\") { # Dirty trick to work around idiotic "\" --> "/" conversion @@ -100,12 +99,65 @@ sub executecmd ($) die "${progname}: $!. Failing command was:\n\t$command\n" if $retval; } +# Append ".dep" to the dependency file if necessary. +sub find_dependency_file ($) +{ + my $depfile = $_[0]; + + # Return the file as is if it exists. + return $depfile if -e $depfile || $depfile =~ /\.dep$/; + + # Return the file with ".dep" appended if that exists. + return "${depfile}.dep" if -e "${depfile}.dep"; + + # Give up and return the file as specified. + return $depfile; +} + +# Try hard to find a configuration file. Return the name of the actual file we +# located. +sub find_config_file ($) +{ + my $configfile = $_[0]; + no warnings; # Don't complain if kpsewhich isn't found. + + # Attempt 1: See if the file exists as named. + return $configfile if -e $configfile; + + # Attempt 2: Append ".cfg" if it's not already there. + my $config_cfg = $configfile; + if ($config_cfg !~ /\.cfg$/) { + $config_cfg = "${configfile}.cfg"; + return $config_cfg if -e $config_cfg; + } + + # Attempt 3: Use kpsewhich to find the file with ".cfg" appended. (We + # don't search for it without ".cfg" because kpsewhich may find a version + # with ".tex" appended.) + my $kpfound = `kpsewhich $config_cfg`; + if (defined $kpfound) { + chomp $kpfound; + return $kpfound if -e $kpfound; + } + + # Give up. Return the file name as specified. + return $configfile; +} + # Read a configuration file, and set %uservariable accordingly. sub process_config_file ($) { - my $configfile = $_[0]; + my $configfile = find_config_file $_[0]; + printf("CONFIGURATION FILE: %s\n", rel2abs($configfile)) if $verbose; my $prevline = ""; - open (CONFIGFILE, "<$configfile") || die "${progname}: $! ($configfile)\n"; + open (CONFIGFILE, "<", $configfile) || do { + my $configlist = $configfile; + if (! -e $configfile) { + # Error is "file not found". List the files we considered. + $configlist .= "; also considered ${configfile}.cfg" if $configfile !~ /\.cfg$/; + } + die "${progname}: $! ($configlist)\n"; + }; while (my $oneline=) { # Read a line and trim it. chomp $oneline; @@ -222,7 +274,7 @@ sub find_dependencies () my $numextras = 0; foreach my $include_glob (@include_files) { foreach my $include_file (glob $include_glob) { - push @dependencies, $include_file; + push @dependencies, qualifyname $include_file; $numextras++; } } @@ -255,6 +307,7 @@ my $showhelp = ""; $keepdirs = 0; $verbose = 0; $localonly = 0; +my $configfile; Getopt::Long::Configure("bundling"); GetOptions ('texfile=s' => \$texfile, 'directory=s' => \$docdirname, @@ -263,7 +316,7 @@ GetOptions ('texfile=s' => \$texfile, 'localonly!' => \$localonly, 'exclude=s' => \@exclude_files, 'include=s' => \@include_files, - 'config=s' => sub { process_config_file($_[1]) }, + 'config=s' => \$configfile, 'v|verbose!' => \$verbose, 'listdeps=s' => \@listdeps, 'V|version' => sub { print "bundledoc $VERSION\n"; exit -1 }, @@ -276,7 +329,8 @@ pod2usage (-message => "(For more detailed help, enter \"$0 --help --verbose\".) pod2usage (-message => "${progname}: Too few arguments", -exitval => 1, -verbose => 0) if $#ARGV==-1; -$depfile = shift; # Dependencies from snapshot.sty +$depfile = find_dependency_file shift; # Dependencies from snapshot.sty +process_config_file $configfile if defined $configfile; ($texfile = $depfile) =~ s/\.[^.]*$/.tex/ if !$texfile; # Main LaTeX source file ($docdirname = basename($depfile)) =~ s/\.[^.]*$// if !$docdirname; # Name to use for the document directory ($ENV{"BDBASE"} = rel2abs($depfile)) =~ s/\.[^.]*$//; # May be needed by user-defined variables @@ -370,7 +424,7 @@ bundledoc [B<--version>] [B<--help>] [B<-->[B]B] -[B<--texfile>=I] +[B<--texfile>=I] [B<--directory>=I] [B<-->[B]B] [B<--exclude>=I] @@ -378,8 +432,8 @@ bundledoc [B<--manifest>=I] [B<-->B=[yes|no|only|rel]...] [B<-->[B]B] -[B<--config>=I] -I<.dep file> +[B<--config>=I] +I =head1 DESCRIPTION @@ -414,8 +468,9 @@ In the following descriptions, I refers to the name of your main LaTeX document (no extension). B requires the name of the dependency file produced by -B (normally IF<.dep>). The following options may -also be given: +B, normally IF<.dep>). (For convenience, the file +can be specified without its F<.dep> extension.) The following +options may also be given: =over 4 @@ -561,7 +616,8 @@ The C<--config> option is used to point B to the appropriate configuration (F<.cfg>) file for your TeX distribution and operating system. B comes with a few configuration files and it's easy to write more. See L<"CONFIGURATION FILES"> (below) for -a description of the configuration file format. +a description of the configuration file format. For convenience, the +file can be specified without its F<.cfg> extension. =back @@ -654,8 +710,9 @@ distribution running on Microsoft Windows: bundledoc --config=miktex.cfg myfile.dep -(In practice, it's probably necessary to specify to C<--config> the -complete path to B's F configuration file.) +This can be abbreviated to + + bundledoc --config=miktex myfile The following builds a F<.tar.gz> archive with the TeX Live distribution running on a Unix-like operating system. B @@ -830,8 +887,11 @@ other common font formats, as well. Thanks to Fabien Vignes-Tourneret for suggesting what became the C<--localonly> option and for a discussion that led to the -C<--exclude> and C<--include> options; and to Marius Kleiner for -updating B to properly handle document subdirectories. +C<--exclude> and C<--include> options; to Marius Kleiner for updating +B to properly handle document subdirectories; and to Frank +Mittelbach for suggesting using Kpathsea to help find F<.cfg> files +and to automatically append F<.cfg> and F<.dep> extensions if +necessary. =head1 SEE ALSO -- cgit v1.2.3