summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-11-26 14:43:23 +0000
committerKarl Berry <karl@freefriends.org>2008-11-26 14:43:23 +0000
commit91a07e5039963a38b2b24af568581d73e872ad34 (patch)
tree60c1944ab2e2fbe797824d0653fabe3eb9c6e956 /Master/tlpkg/TeXLive
parentfd1e7d74f623e3dd04600dd96d6eef44b6446ab1 (diff)
doc, $0 in die
git-svn-id: svn://tug.org/texlive/trunk@11433 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm33
1 files changed, 18 insertions, 15 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 3cc08682d8a..5f3c6ffc39c 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -194,7 +194,7 @@ It returns the actual number of packages (TLPOBJs) read from C<$filename>.
sub from_file {
my ($self, $path) = @_;
if (@_ != 2) {
- die "need filename for initialization";
+ die "$0: from_file needs filename for initialization";
}
my $root_from_path = dirname(dirname($path));
if (defined($self->{'root'})) {
@@ -242,7 +242,7 @@ sub from_file {
unlink($tlpdbfile);
} else {
unlink($lzmafile);
- open $retfh, "<$tlpdbfile" or die "open($tlpdbfile) failed: $!";
+ open($retfh, "<$tlpdbfile") || die "$0: open($tlpdbfile) failed: $!";
debug("found the uncompressed lzma file\n");
}
}
@@ -254,11 +254,11 @@ sub from_file {
# lzma did not succeed, so try the normal file
$retfh = TeXLive::TLUtils::download_file($path, "|");
if (!$retfh) {
- die("Cannot open tlpdb file: $path");
+ die "open tlpdb($path) failed: $!";
}
}
} else {
- open(TMP,"<$path") || die("Cannot open tlpdb file: $path");
+ open(TMP, "<$path") || die "$0: open($path) failed: $!";
$retfh = \*TMP;
}
my $found = 0;
@@ -313,7 +313,7 @@ sub save {
my $self = shift;
my $path = $self->location;
mkdirhier(dirname($path));
- open(FOO,">$path") || die("Cannot open $path for writing: $!");
+ open(FOO, ">$path") || die "$0: open(>$path) failed: $!";
$self->writeout(\*FOO);
close(FOO);
}
@@ -396,9 +396,9 @@ sub _add_tlpcontainer {
$container .= ".lzma";
$unpackprog="NO_IDEA_HOW_TO_UNPACK_LZMA";
$args="NO IDEA WHAT ARGS IT NEEDS";
- die "lzma checked for but not implemented, maybe update TLPDB.pm\n";
+ die "$0: lzma checked for but not implemented, maybe update TLPDB.pm";
} else {
- die "Cannot find package $container (.zip or .lzma) in $ziplocation\n";
+ die "$0: No package $container (.zip or .lzma) in $ziplocation";
}
tlwarn("Huuu, this needs testing and error checking!\n");
tlwarn("Should we use -a -- adapt line endings etc?\n");
@@ -680,7 +680,9 @@ sub _generate_listfile {
}
}
}
- open(TMP, ">$destdir/$listname") or die "Cannot open $destdir/$listname!";
+ open(TMP, ">$destdir/$listname")
+ || die "$0: open(>$destdir/$listname) failed: $!";
+
# title and size information for collections and schemes in the
# first two lines, marked with *
if ($tlp->category eq "Collection") {
@@ -1052,7 +1054,7 @@ sub fmtutil_cnf_lines {
my %fmtcnffiles;
foreach my $p ($self->list_packages) {
my $obj = $self->get_package ($p);
- die "No TeX Live package named $p, strange" if ! $obj;
+ die "$0: No TeX Live package named $p, strange" if ! $obj;
foreach my $e ($obj->executes) {
if ($e =~ m/BuildFormat (.*)$/) {
$fmtcnffiles{$1} = 1;
@@ -1082,7 +1084,7 @@ sub updmap_cfg_lines {
my %maps;
foreach my $p ($self->list_packages) {
my $obj = $self->get_package ($p);
- die "No TeX Live package named $p, strange" if ! $obj;
+ die "$0: No TeX Live package named $p, strange" if ! $obj;
foreach my $e ($obj->executes) {
if ($e =~ m/addMap (.*)$/) {
$maps{$1} = 1;
@@ -1158,7 +1160,7 @@ sub _parse_hyphen_execute {
foreach my $pkg ($self->list_packages) {
my $obj = $self->get_package ($pkg);
- die "No TeX Live package named $pkg, too strange" if ! $obj;
+ die "$0: No TeX Live package named $pkg, too strange" if ! $obj;
my $first = 1;
foreach my $e ($obj->executes) {
if ($e =~ m/AddHyphen\s+(.*)\s*/) {
@@ -1174,7 +1176,7 @@ sub _parse_hyphen_execute {
foreach my $p (split(' ', $1)) {
my ($a, $b) = split /=/, $p;
if ($a eq "name") {
- die "AddHyphen line needs name=something: $pkg, $e" unless $b;
+ die "$0: AddHyphen line needs name=something: $pkg, $e" unless $b;
$name = $b; next;
}
if ($a eq "lefthyphenmin") {
@@ -1187,7 +1189,7 @@ sub _parse_hyphen_execute {
next;
}
if ($a eq "file") {
- die "AddHyphen line needs file=something: $pkg, $e" unless $b;
+ die "$0: AddHyphen line needs file=something: $pkg, $e" unless $b;
$file = $b;
next;
}
@@ -1195,9 +1197,10 @@ sub _parse_hyphen_execute {
@synonyms = split /,/, $b;
next;
}
- die "Unknown language directive in $pkg: $e";
+ die "$0: Unknown language directive in $pkg: $e";
}
- my @foo = &$coderef ($name, $lefthyphenmin, $righthyphenmin, $file, @synonyms);
+ my @foo = &$coderef ($name, $lefthyphenmin, $righthyphenmin,
+ $file, @synonyms);
push @langlines, @foo;
}
}