]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Update reindex script to check filename lines.
authorNick Mathewson <nickm@torproject.org>
Sun, 15 Jun 2008 17:08:28 +0000 (17:08 +0000)
committerNick Mathewson <nickm@torproject.org>
Sun, 15 Jun 2008 17:08:28 +0000 (17:08 +0000)
svn:r15278

doc/spec/proposals/reindex.pl

index adffbd7f113dfda23a7f8b711f69967abe5b03f4..be1ef1ffc406661998bd95e583af9af02c4e38f5 100755 (executable)
@@ -22,6 +22,7 @@ for my $f (@files) {
     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 @@ for my $f (@files) {
            $status = uc $1;
            chomp $status;
        }
+       if (/^Filename: (.*)/) {
+           $alleged_fname = $1;
+           chomp $alleged_fname;
+       }
        if (/^Title: (.*)/) {
            $title = $1;
            $title =~ s/\.$//;
@@ -41,6 +46,9 @@ for my $f (@files) {
        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;
 }