summaryrefslogtreecommitdiff
path: root/scripts/buildtable.pl
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2016-11-30 09:45:33 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2016-11-30 09:45:33 +0000
commit72f18918a8ae655212ea2700b30f0dc4d758b843 (patch)
tree1380e14fc68548a7aceaaed6cb9e03ccdeff91f9 /scripts/buildtable.pl
parent453b8ab83299b8f2468830d2f803f96fba98d7f9 (diff)
downloadbips-72f18918a8ae655212ea2700b30f0dc4d758b843.tar.xz
Promote BIP 123 Draft->Active, and implement it
Diffstat (limited to 'scripts/buildtable.pl')
-rwxr-xr-xscripts/buildtable.pl20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/buildtable.pl b/scripts/buildtable.pl
index d8f52f2..dbd42d9 100755
--- a/scripts/buildtable.pl
+++ b/scripts/buildtable.pl
@@ -3,6 +3,7 @@ use strict;
use warnings;
my $topbip = 9999;
+my $include_layer = 0;
my %RequiredFields = (
BIP => undef,
@@ -31,6 +32,13 @@ my %MiscField = (
'Resolution' => undef,
);
+my %ValidLayer = (
+ 'Consensus (soft fork)' => undef,
+ 'Consensus (hard fork)' => undef,
+ 'Peer Services' => undef,
+ 'API/RPC' => undef,
+ 'Applications' => undef,
+);
my %ValidStatus = (
Draft => undef,
Deferred => undef,
@@ -58,7 +66,7 @@ while (++$bipnum <= $topbip) {
die "No <pre> in $fn" if eof $F;
}
my %found;
- my ($title, $author, $status, $type);
+ my ($title, $author, $status, $type, $layer);
my ($field, $val);
while (<$F>) {
m[^</pre>$] && last;
@@ -103,6 +111,9 @@ while (++$bipnum <= $topbip) {
} else {
$type = $val;
}
+ } elsif ($field eq 'Layer') { # BIP 123
+ die "Invalid layer $val in $fn" unless exists $ValidLayer{$val};
+ $layer = $val;
} elsif (exists $DateField{$field}) {
die "Invalid date format in $fn" unless $val =~ /^20\d{2}\-(?:0\d|1[012])\-(?:[012]\d|30|31)$/;
} elsif (exists $EmailField{$field}) {
@@ -120,6 +131,13 @@ while (++$bipnum <= $topbip) {
}
print "\n";
print "| [[${fn}|${bipnum}]]\n";
+ if ($include_layer) {
+ if (defined $layer) {
+ print "| ${layer}\n";
+ } else {
+ print "|\n";
+ }
+ }
print "| ${title}\n";
print "| ${author}\n";
print "| ${type}\n";