changeset 291:7dd1318c8652

Abort if we encounter non-unique titles. (Closes: #508268)
author Steve Kemp <steve@steve.org.uk>
date Tue, 09 Dec 2008 18:05:55 +0000
parents 382b8fc443c3
children 644ba9f3ffd2
files bin/chronicle debian/changelog
diffstat 2 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bin/chronicle	Sat Dec 06 22:17:54 2008 +0000
+++ b/bin/chronicle	Tue Dec 09 18:05:55 2008 +0000
@@ -643,6 +643,36 @@
         exit;
     }
 
+    #
+    #  Make sure we have no duplicate titles.
+    #
+    my %titles;
+    foreach my $key ( keys( %results  ) )
+    {
+        #
+        #  Get the title for this file.
+        #
+        my $title = $results{$key}->{'title'};
+        next if ( !defined($title ) );
+
+        #
+        #  If we've seen this already then abort
+        #
+        if ( $titles{$title} )
+        {
+            print "Non-unique title: $title\n";
+            print "Shared by (at least):\n";
+            print "\t" . $key . "\n";
+            print "\t" . $titles{$title} . "\n";
+            print "\nAborting\n";
+            exit;
+        }
+        else
+        {
+            $titles{$title} = $key;
+        }
+    }
+
     return %results;
 }
 
--- a/debian/changelog	Sat Dec 06 22:17:54 2008 +0000
+++ b/debian/changelog	Tue Dec 09 18:05:55 2008 +0000
@@ -1,3 +1,10 @@
+chronicle (3.4-1) unstable; urgency=medium
+
+  * Abort if non-unique titles are encountered.
+    (Closes: #508268)
+
+ -- XXX
+
 chronicle (3.3-1) unstable; urgency=medium
 
   * Default to UTF-8 when processing input in textile formats.  Allow