diff options
Diffstat (limited to 'Master/texmf-dist/scripts/glossaries/makeglossaries')
-rwxr-xr-x | Master/texmf-dist/scripts/glossaries/makeglossaries | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/Master/texmf-dist/scripts/glossaries/makeglossaries b/Master/texmf-dist/scripts/glossaries/makeglossaries index 827ec71a1db..58077a46a42 100755 --- a/Master/texmf-dist/scripts/glossaries/makeglossaries +++ b/Master/texmf-dist/scripts/glossaries/makeglossaries @@ -2,7 +2,7 @@ # File : makeglossaries # Author : Nicola Talbot -# Version : 1.7 (2009/09/23) +# Version : 1.8 (2009/11/03) # Description: simple Perl script that calls makeindex or xindy. # Intended for use with "glossaries.sty" (saves having to remember # all the various switches) @@ -30,6 +30,9 @@ my $version="1.7 (2009-09-23)"; # History: +# v1.8 (2009-11-03) : +# * Create an empty output file if the input file is empty +# without calling xindy/makeindex # v1.7 (2009-09-23) : # * Issue warning rather than error when empty/non existant file # checks fail @@ -334,6 +337,17 @@ else my $inputfile = "$name.$thistype{in}"; + my $outfile; + + if ($opt_o eq "") + { + $outfile = "$name.$thistype{out}"; + } + else + { + $outfile = $opt_o; + } + # v1.7 print warnings to STDOUT instead of STDERR # v1.6 added file existance test @@ -355,20 +369,21 @@ else if (-z $inputfile) { print "Warning: File '$inputfile' is empty.\n", - "Have you used any entries defined in glossary '$type'?\n", - "*** Skipping glossary '$type'. ***\n"; - next; - } + "Have you used any entries defined in glossary '$type'?\n"; - my $outfile; + # create an empty output file and move on to the next glossary - if ($opt_o eq "") - { - $outfile = "$name.$thistype{out}"; - } - else - { - $outfile = $opt_o; + if (open OFD, ">$outfile") + { + print OFD "\\null\n"; + close OFD; + } + else + { + print STDERR "Unable to create '$outfile' $!\n"; + } + + next; } my $transcript; |