diff options
author | Ian Lynagh <igloo@earth.li> | 2010-08-19 23:24:20 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-08-19 23:24:20 +0000 |
commit | d2b30a14b7b21ba17220cf14f3abd3868b5fa5d2 (patch) | |
tree | 6ebb7dc29bf45054a453bd936440e44152d66732 /darcs-all | |
parent | 22cbec8d2dfbfdb7c6625a093ccb518fedf3a2d7 (diff) | |
download | haskell-d2b30a14b7b21ba17220cf14f3abd3868b5fa5d2.tar.gz |
Give clearer errors for bad input in the packages file; suggested by pejo
Diffstat (limited to 'darcs-all')
-rw-r--r-- | darcs-all | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -157,6 +157,7 @@ sub darcsall { my $tag; my @repos; my $command = $_[0]; + my $line; my ($repo_base, $checked_out_tree) = getrepo(); @@ -164,8 +165,10 @@ sub darcsall { @repos = <IN>; close IN; + $line = 0; foreach (@repos) { chomp; + $line++; if (/^([^# ]+) +([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)$/) { $localpath = $1; $tag = $2; @@ -198,7 +201,7 @@ sub darcsall { } } elsif (! /^(#.*)?$/) { - die "Bad line: $_"; + die "Bad content on line $line of packages file: $_"; } } } @@ -210,6 +213,7 @@ sub darcsget { my $path; my $tag; my @repos; + my $line; my ($repo_base, $checked_out_tree) = getrepo(); @@ -225,8 +229,10 @@ sub darcsget { @repos = <IN>; close IN; + $line = 0; foreach (@repos) { chomp; + $line++; if (/^([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)$/) { $localpath = $1; $tag = $2; @@ -249,7 +255,7 @@ sub darcsget { } } elsif (! /^(#.*)?$/) { - die "Bad line: $_"; + die "Bad content on line $line of packages file: $_"; } } } |