summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-07-13 17:28:37 +0000
committerKarl Berry <karl@freefriends.org>2007-07-13 17:28:37 +0000
commitfb0bcf8cd0780abc8f8386ec1a6d8e32833d284a (patch)
treee93041c084a38670aa374b01c29d15c883e2d22c
parentc847617ad264b8da5bd02d78fe0342d3b35b1ef0 (diff)
diagnostic wording
git-svn-id: svn://tug.org/texlive/trunk@4577 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index cf03fe819f0..969463118c6 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -35,12 +35,13 @@ sub new {
sub from_file {
my $self = shift;
- if (@_ != 1) {
- die("Need a filename for initialization!");
- }
- open(TMP,"<$_[0]") || die("Cannot open tlpsrc file: $_[0]");
+ die("Need exactly one filename for initialization!") if @_ != 1;
+ my $srcfile = $_[0];
+
+ open(TMP, "<$srcfile") || die("failed to open tlpsrc '$srcfile': $!");
my @lines = <TMP>;
close(TMP);
+
my $name = "";
# default category = Package
my $category = "Package";
@@ -57,17 +58,17 @@ sub from_file {
if ($line =~ /^\s*$/) {
if (!$started) { next; }
if ($finished) { next; }
- die("No empty line allowed in tlpsrc file $_[0]!");
+ die("$srcfile: empty line not allowed in tlpsrc");
}
if ($line =~ /^ /) {
- die("No continuation lines >>>$line<<< allowed in TLPSRC files!");
+ die "$srcfile: continuation line not allowed in tlpsrc: $line\n";
}
if ($line =~ /^name\s*([-\w]+)$/) {
$name = "$1";
- $started && die("Cannot have two name directives!");
+ $started && die("$srcfile: tlpsrc cannot have two name directives");
$started = 1;
} else {
- $started || die("First directive needs to be 'name'");
+ $started || die("$srcfile: first tlpsrc directive must be 'name'");
if ($line =~ /^shortdesc\s*(.*)$/) {
$shortdesc = "$1";
next;
@@ -99,8 +100,7 @@ sub from_file {
push @depends, "$1" if ("$1" ne "");
next;
} else {
- #die("Unknown directive ...$line... in $_[0], please fix it!");
- print STDERR "Unknown directive ...$line... in $_[0], please fix it!\n";
+ warn "$srcfile: unknown tlpsrc directive, please fix: $line\n";
}
}
}