summaryrefslogtreecommitdiff
path: root/darcs-all
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-08-19 23:24:20 +0000
committerIan Lynagh <igloo@earth.li>2010-08-19 23:24:20 +0000
commitd2b30a14b7b21ba17220cf14f3abd3868b5fa5d2 (patch)
tree6ebb7dc29bf45054a453bd936440e44152d66732 /darcs-all
parent22cbec8d2dfbfdb7c6625a093ccb518fedf3a2d7 (diff)
downloadhaskell-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-all10
1 files changed, 8 insertions, 2 deletions
diff --git a/darcs-all b/darcs-all
index 5ced5b79d7..b4ba47e8a9 100644
--- a/darcs-all
+++ b/darcs-all
@@ -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: $_";
}
}
}