summary refs log tree commit diff
path: root/rfc
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-19 15:49:08 -0500
committerJune McEnroe <june@causal.agency>2020-12-19 15:49:08 -0500
commit83d63b64c7c18b05912c8574c595b540c58a1229 (patch)
tree178a3f85da1f47f6b9672aad00aa588220fbba41 /rfc
parentOpen rfc-index.txt for :RFC without argument (diff)
downloadsrc-83d63b64c7c18b05912c8574c595b540c58a1229.tar.gz
src-83d63b64c7c18b05912c8574c595b540c58a1229.zip
Sort RFC tags file
This supposedly lets vim do binary search on the file, not that it
seemed slow before. Also handle section headings with no names.
Diffstat (limited to 'rfc')
-rw-r--r--rfc/Makefile2
-rw-r--r--rfc/rfctags.pl5
2 files changed, 4 insertions, 3 deletions
diff --git a/rfc/Makefile b/rfc/Makefile
index c83f9879..630b09f9 100644
--- a/rfc/Makefile
+++ b/rfc/Makefile
@@ -1,7 +1,7 @@
 MODULE = ftp.rfc-editor.org::rfcs-text-only
 
 tags: rfctags.pl
-	perl rfctags.pl > $@
+	perl rfctags.pl | sort -f > $@
 
 sync:
 	rsync -z ${MODULE}/rfc-index.txt ${MODULE}/'rfc[0-9]*.txt' .
diff --git a/rfc/rfctags.pl b/rfc/rfctags.pl
index cd3ba288..5833e17a 100644
--- a/rfc/rfctags.pl
+++ b/rfc/rfctags.pl
@@ -5,15 +5,16 @@ use open ':encoding(ISO-8859-1)';
 use IO::Uncompress::Gunzip qw($GunzipError);
 
 ($,, $\) = ("\t", "\n");
+print '!_TAG_FILE_SORTED', 2, $0; # Promise to pipe this through sort -f
 for my $rfc (<*.txt.gz>) {
 	my $handle = new IO::Uncompress::Gunzip $rfc
 		or die "${rfc}: ${GunzipError}";
 	while (<$handle>) {
 		chomp;
 		# Section headings
-		if (/^([\d.]+|[A-Z][.])\s+([^\t]+)/) {
+		if (/^([\d.]+|[A-Z][.])\s+([^\t]+)?/) {
 			print $1, $rfc, $.;
-			print $2, $rfc, $.;
+			print $2, $rfc, $. if $2;
 		}
 		# References
 		if (/^\s*(\[[\w-]+\])\s{2,}/) {
;id=88fe358bbb56353d4b28a67fdfd6a26c913ed8cd&follow=1'>Add ISC license headerJune McEnroe 2021-08-22Update to Linux man-pages 5.12Štěpán Němec 2021-06-21Add manuals for macOS 11.3June McEnroe 2021-05-08Update to OpenBSD 6.9June McEnroe 2021-04-26Update to Linux man-pages 5.11June McEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe