From 72f18918a8ae655212ea2700b30f0dc4d758b843 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 30 Nov 2016 09:45:33 +0000 Subject: Promote BIP 123 Draft->Active, and implement it --- scripts/buildtable.pl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'scripts/buildtable.pl') 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
 in $fn" if eof $F;
 	}
 	my %found;
-	my ($title, $author, $status, $type);
+	my ($title, $author, $status, $type, $layer);
 	my ($field, $val);
 	while (<$F>) {
 		m[^
$] && 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"; -- cgit v1.2.3 From 959fecc15bdad070afa63455468b1dba54655fa6 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 30 Nov 2016 09:47:31 +0000 Subject: Promote BIP 2 Draft->Active, and implement it - Update all Accepted status to Proposed (renamed status) - The BIP Comments preamble headers added to every BIP - The License preamble headers have been added to all BIPs with a Copyright section --- scripts/buildtable.pl | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'scripts/buildtable.pl') diff --git a/scripts/buildtable.pl b/scripts/buildtable.pl index dbd42d9..ca2f4b8 100755 --- a/scripts/buildtable.pl +++ b/scripts/buildtable.pl @@ -9,12 +9,17 @@ my %RequiredFields = ( BIP => undef, Title => undef, Author => undef, + 'Comments-Summary' => undef, + 'Comments-URI' => undef, Status => undef, Type => undef, Created => undef, + # License => undef, (has exceptions) ); my %MayHaveMulti = ( Author => undef, + 'Comments-URI' => undef, + License => undef, 'Post-History' => undef, ); my %DateField = ( @@ -25,11 +30,11 @@ my %EmailField = ( Editor => undef, ); my %MiscField = ( + 'Comments-Summary' => undef, 'Discussions-To' => undef, 'Post-History' => undef, 'Replaces' => undef, 'Superseded-By' => undef, - 'Resolution' => undef, ); my %ValidLayer = ( @@ -42,7 +47,7 @@ my %ValidLayer = ( my %ValidStatus = ( Draft => undef, Deferred => undef, - Accepted => "background-color: #ffffcf", + Proposed => "background-color: #ffffcf", Rejected => "background-color: #ffcfcf", Withdrawn => "background-color: #ffcfcf", Final => "background-color: #cfffcf", @@ -54,6 +59,34 @@ my %ValidType = ( 'Informational' => undef, 'Process' => undef, ); +my %RecommendedLicenses = ( + 'BSD-2-Clause' => undef, + 'BSD-3-Clause' => undef, + 'CC0-1.0' => undef, + 'GNU-All-Permissive' => undef, +); +my %AcceptableLicenses = ( + %RecommendedLicenses, + 'Apache-2.0' => undef, + 'BSL-1.0' => undef, + 'CC-BY-4.0' => undef, + 'CC-BY-SA-4.0' => undef, + 'MIT' => undef, + 'AGPL-3.0' => undef, + 'AGPL-3.0+' => undef, + 'FDL-1.3' => undef, + 'GPL-2.0' => undef, + 'GPL-2.0+' => undef, + 'LGPL-2.1' => undef, + 'LGPL-2.1+' => undef, +); +my %DefinedLicenses = ( + %AcceptableLicenses, + 'OPL' => undef, + 'PD' => undef, +); +my %GrandfatheredPD = map { $_ => undef } qw(9 36 37 38 42 49 50 60 65 69 74 80 81 83 99 105 107 109 111 112 113 114 122 124 125 126 130 131 132 133 140 141 142 143 144 146 147 150 151 152); +my %TolerateMissingLicense = map { $_ => undef } qw(1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 30 31 32 33 34 35 39 43 44 45 47 61 62 64 66 67 68 70 71 72 73 75 101 102 103 106 120 121 123); my %emails; @@ -114,6 +147,15 @@ while (++$bipnum <= $topbip) { } elsif ($field eq 'Layer') { # BIP 123 die "Invalid layer $val in $fn" unless exists $ValidLayer{$val}; $layer = $val; + } elsif ($field eq 'License') { + die "Undefined license $val in $fn" unless exists $DefinedLicenses{$val}; + if (not $found{License}) { + die "Unacceptable license $val in $fn" unless exists $AcceptableLicenses{$val} or ($val eq 'PD' and exists $GrandfatheredPD{$bipnum}); + } + } elsif ($field eq 'Comments-URI') { + if (not $found{'Comments-URI'}) { + die unless $val eq sprintf('https://github.com/bitcoin/bips/wiki/Comments:BIP-%04d', $bipnum); + } } 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}) { @@ -122,6 +164,9 @@ while (++$bipnum <= $topbip) { die "Unknown field $field in $fn"; } } + if (not $found{License}) { + die "Missing License in $fn" unless exists $TolerateMissingLicense{$bipnum}; + } for my $field (keys %RequiredFields) { die "Missing $field in $fn" unless $found{$field}; } -- cgit v1.2.3 From 42770fb6194f0e55a7e7139cf7fe97f5c8f84f4e Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 15 Dec 2016 04:20:10 +0000 Subject: Bugfix: scripts/buildtable: Increment found marker *after* processing the header --- scripts/buildtable.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/buildtable.pl') diff --git a/scripts/buildtable.pl b/scripts/buildtable.pl index ca2f4b8..c2392af 100755 --- a/scripts/buildtable.pl +++ b/scripts/buildtable.pl @@ -115,7 +115,6 @@ while (++$bipnum <= $topbip) { } else { die "Bad line in $fn preamble"; } - ++$found{$field}; die "Extra spaces in $fn" if $val =~ /^\s/; if ($field eq 'BIP') { die "$fn claims to be BIP $val" if $val ne $bipnum; @@ -163,6 +162,7 @@ while (++$bipnum <= $topbip) { } elsif (not exists $MiscField{$field}) { die "Unknown field $field in $fn"; } + ++$found{$field}; } if (not $found{License}) { die "Missing License in $fn" unless exists $TolerateMissingLicense{$bipnum}; -- cgit v1.2.3