diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-26 15:58:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-26 15:58:41 +0000 |
commit | ffc8bb403efdf5b822b9f1e49ff4a5940b0ca5c5 (patch) | |
tree | 949c50f727c360c67241140223afaa796f379435 /Master/tlpkg | |
parent | 158133cf010cbf75dc6bab5069a5185632725f81 (diff) |
(repository_to_array): die if passed empty string,
since this should never happen. Noticed in report
from Bernhard Waldbrunner, 22 May 2018 20:26:15.
Also, omit \n from most die statements, for more context.
git-svn-id: svn://tug.org/texlive/trunk@47846 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 71df6d1613a..633fa8630da 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -877,7 +877,7 @@ sub mkdirhier { } elsif (defined wantarray) { return(0); } else { - die "$0: $reterror\n"; + die "$0: $reterror"; } } } @@ -1124,7 +1124,7 @@ sub copy { chmod $mode, "$outfile"; while ($read = sysread (IN, $buffer, $blocksize)) { - die "read($infile) failed: $!\n" unless defined $read; + die "read($infile) failed: $!" unless defined $read; $offset = 0; while ($read) { $written = syswrite (OUT, $buffer, $read, $offset); @@ -2399,6 +2399,8 @@ sub setup_programs { if ($::opt_verbosity >= 1) { require Data::Dumper; + use vars qw($Data::Dumper::Indent $Data::Dumper::Sortkeys + $Data::Dumper::Purity); # -w pain $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; # stable output $Data::Dumper::Purity = 1; # recursive structures must be safe @@ -3553,7 +3555,8 @@ sub process_logging_options { # open log file if one was requested. if ($opt_logfile) { - open(TLUTILS_LOGFILE, ">$opt_logfile") || die "open(>$opt_logfile) failed: $!\n"; + open(TLUTILS_LOGFILE, ">$opt_logfile") + || die "open(>$opt_logfile) failed: $!\n"; $::LOGFILE = \*TLUTILS_LOGFILE; $::LOGFILENAME = $opt_logfile; } @@ -4184,7 +4187,7 @@ sub mktexupd { # check whether files exist if ($mustexist) { foreach my $file (keys %files) { - die "File \"$file\" doesn't exist.\n" if (! -f $file); + die "mktexupd: exec file does not exist: $file" if (! -f $file); } } my $delim= (&win32)? ';' : ':'; @@ -4302,10 +4305,19 @@ sub prepend_own_path { } +=item C<repository_to_array($r)> + +Return hash of tags to urls for space-separated list of repositories +passed in C<$r>. If passed undef or empty string, die. + +=cut + sub repository_to_array { my $r = shift; my %r; - my @repos = split ' ', $r; + die "internal error, repository_to_array passed nothing (caller=" + . caller . ")"; + my @repos = split (' ', $r); if ($#repos == 0) { # only one repo, this is the main one! $r{'main'} = $repos[0]; @@ -4398,7 +4410,7 @@ sub ensure_json_available { # that didn't work out, use home-grown json if ($envdefined) { # environment asks for JSON but cannot be loaded, die! - tldie("env variable TL_JSONMODE request JSON module but cannot be load!\n"); + tldie("envvar TL_JSONMODE request JSON module but cannot be loaded!\n"); } $jsonmode = "texlive"; debug("texlive json module used!\n"); |