[or-cvs] r15278: Update reindex script to check filename lines. (tor/trunk/doc/spec/proposals)

nickm at seul.org nickm at seul.org
Sun Jun 15 17:08:29 UTC 2008


Author: nickm
Date: 2008-06-15 13:08:28 -0400 (Sun, 15 Jun 2008)
New Revision: 15278

Modified:
   tor/trunk/doc/spec/proposals/reindex.pl
Log:
Update reindex script to check filename lines.

Modified: tor/trunk/doc/spec/proposals/reindex.pl
===================================================================
--- tor/trunk/doc/spec/proposals/reindex.pl	2008-06-15 16:23:30 UTC (rev 15277)
+++ tor/trunk/doc/spec/proposals/reindex.pl	2008-06-15 17:08:28 UTC (rev 15278)
@@ -22,6 +22,7 @@
     my $num = substr($f, 0, 3);
     my $status = undef;
     my $title = undef;
+    my $alleged_fname = undef;
     if ($f !~ /\.txt/) { print "$f doesn't end with .txt\n"; }
     open(F, "$f");
     while (<F>) {
@@ -30,6 +31,10 @@
 	    $status = uc $1;
 	    chomp $status;
 	}
+	if (/^Filename: (.*)/) {
+	    $alleged_fname = $1;
+	    chomp $alleged_fname;
+	}
 	if (/^Title: (.*)/) {
 	    $title = $1;
 	    $title =~ s/\.$//;
@@ -41,6 +46,9 @@
 	unless (grep(/$status/, @KNOWN_STATUSES) == 1);
     die "Proposal $num has a bad status line" if (!defined $status);
     die "Proposal $num has a bad title line" if (!defined $title);
+    die "Proposal $num has no Filename line" unless (defined $alleged_fname);
+    die "Proposal $num says its fname is $alleged_fname, but it's really $f"
+	if ($alleged_fname ne $f);
     $title{$num} = $title;
     $status{$num} = $status;
 }



More information about the tor-commits mailing list