[nasm:nasm-2.15.xx] doc: one more copyright year issue. Add metadata macros to fix.

nasm-bot for H. Peter Anvin hpa at zytor.com
Fri Jul 17 19:51:03 PDT 2020


Commit-ID:  d76663a6376c405d78c1eb36f641b0338738cbb9
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=d76663a6376c405d78c1eb36f641b0338738cbb9
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Fri, 17 Jul 2020 19:48:36 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Fri, 17 Jul 2020 19:48:36 -0700

doc: one more copyright year issue. Add metadata macros to fix.

Yet another place in the documentation where the copyright year comes
in. Instead of having to deal with it manually over and over, add
support for inserting the metadata strings as macros in the output.

Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>


---
 doc/nasmdoc.src | 12 +++++-------
 doc/rdsrc.pl    | 13 ++++++++++++-
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index 1572e3f0..51a6b766 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -39,7 +39,7 @@
 \M{title}{NASM - The Netwide Assembler}
 \M{author}{The NASM Development Team}
 \M{copyright_tail}{-- All Rights Reserved}
-\M{license}{This document is redistributable under the license given in the file "LICENSE" distributed in the NASM archive.}
+\M{license}{This document is redistributable under the license given in the section "License".}
 \M{summary}{This file documents NASM, the Netwide Assembler: an assembler targetting the Intel x86 series of processors, with portable source.}
 \M{infoname}{NASM}
 \M{infofile}{nasm}
@@ -321,14 +321,12 @@ known x86 architectural extensions, and has strong support for macros.
 NASM also comes with a set of utilities for handling its own RDOFF2
 object-file format.
 
-\S{legal} \i{License} Conditions
+\S{legal} \i{License}
 
-Please see the file \c{LICENSE}, supplied as part of any NASM
-distribution archive, for the license conditions under which you may
-use NASM.  NASM is now under the so-called 2-clause BSD license, also
-known as the simplified BSD license.
+NASM is under the so-called 2-clause BSD license, also
+known as the simplified BSD license:
 
-Copyright 1996-2017 the NASM Authors - All rights reserved.
+Copyright \m{year} the NASM Authors - All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl
index fff62ec5..3f90d461 100644
--- a/doc/rdsrc.pl
+++ b/doc/rdsrc.pl
@@ -115,10 +115,12 @@
 #   another, so that \I{foobar} has the effect of \I{bazquux}, and
 #   \i{foobar} has the effect of \I{bazquux}foobar
 #
-# Metadata
+# Metadata/macros
 # \M{key}{something}
 #   defines document metadata, such as authorship, title and copyright;
 #   different output formats use this differently.
+# \m{key}
+#   insert the {something} string associated with metadata {key}
 #
 # Include subfile
 # \&{filename}
@@ -270,6 +272,15 @@ sub got_para {
 
   @$pname = ();
 
+  # Replace metadata macros
+  while (/^(.*)\\m\{([^\}]*)\}(.*)$/) {
+      if (defined($metadata{$2})) {
+	  $_ = $1.$metadata{$2}.$3;
+      } else {
+	  $_ = $1.$2.$3;
+      }
+  }
+
   # Strip off _leading_ spaces, then determine type of paragraph.
   s/^\s*//;
   $irewrite = undef;


More information about the Nasm-commits mailing list