summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/App/DocKnot/Spin/Sitemap.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/App/DocKnot/Spin/Sitemap.pm b/lib/App/DocKnot/Spin/Sitemap.pm
index f8dfcd1..ee2d4d2 100644
--- a/lib/App/DocKnot/Spin/Sitemap.pm
+++ b/lib/App/DocKnot/Spin/Sitemap.pm
@@ -38,6 +38,7 @@ use List::SomeUtils qw(pairwise);
# Text exception on file parsing errors
sub _read_data {
my ($self, $path) = @_;
+ my %seen;
# @indents holds a stack of indentation levels to detect indentation
# changes that translate into page structure. Each element in the stack
@@ -71,6 +72,12 @@ sub _read_data {
die "invalid line $. in $path\n";
}
+ # Error on duplicate lines.
+ if ($seen{$url}) {
+ die "duplicate entry for $url in $path (line $.)\n";
+ }
+ $seen{$url} = 1;
+
# Open or close indentation levels.
my $indent = length($spaces);
if (!@indents || $indent > $indents[-1]->[0]) {