groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: tmac/strip.sed: Operate only if given permission.


From: G. Branden Robinson
Subject: [groff] 01/01: tmac/strip.sed: Operate only if given permission.
Date: Mon, 5 Nov 2018 07:14:54 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit c4d82acf4de9f1d6e19ef824607f3fd45f0dcf33
Author: G. Branden Robinson <address@hidden>
Date:   Mon Nov 5 07:00:46 2018 -0500

    tmac/strip.sed: Operate only if given permission.
    
        * tmac/strip.sed: Do nothing whatsoever to any input file that
        lacks a line matching "%beginstrip%".  This implements a
        contract between the macro file writer and the stripper script
        (roff input is not parseable with crude weaponry like regular
        expressions).  In practice, most of the changes performed by the
        script were already in a block enforcing this.  My changes:
          + Stop unconditionally inserting a roff comment noting the
            reader of stripping at line 2.  Instead, replace the line
            matching "%beginstrip%" with this comment if and only if it
            is present.
          + Stop deleting lines containing only the empty request if
            they occur before "%beginstrip%".
          + Tweak the wording of the roff comment.
          + Remove comment within the sed script; see
        <https://lists.gnu.org/archive/html/groff/2017-11/msg00057.html>
            and the sed section of "Limitations of Usual Tools" in the
            GNU Autoconf Manual.
    
        * tmac/e.tmac-u: Add a comment line to visually separate the end
        of the license statement from the comment emplaced by strip.sed.
        This is also consistent with the mdoc macro files.
    
        Invalidates <https://savannah.gnu.org/bugs/index.php?53784>.
    
    Signed-off-by: G. Branden Robinson <address@hidden>
---
 tmac/e.tmac-u  | 1 +
 tmac/strip.sed | 9 ++++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tmac/e.tmac-u b/tmac/e.tmac-u
index 5aabfa9..cba8fbc 100644
--- a/tmac/e.tmac-u
+++ b/tmac/e.tmac-u
@@ -10,6 +10,7 @@
 .\" University may not be used to endorse or promote products derived
 .\" from this software without specific prior written permission.  This
 .\" software is provided "as is" without express or implied warranty.
+.\"
 .\"    %beginstrip%
 .\"
 .\"**************************************************************
diff --git a/tmac/strip.sed b/tmac/strip.sed
index c2c9e89..7175637 100644
--- a/tmac/strip.sed
+++ b/tmac/strip.sed
@@ -1,8 +1,7 @@
-2 i\
-.\\" This is a generated file, created by 'tmac/strip.sed' in groff's\
-.\\" source code bundle from a file having '-u' appended to its name.
-# strip comments, spaces, etc., after a line containing '%beginstrip%'
 /%beginstrip%/,$ {
+  /%beginstrip%/c\
+.\\" This is a generated file, created by 'tmac/strip.sed' in groff's\
+.\\" source distribution from a file having '-u' appended to its name.
   s/^\.[        ]*/./
   s/^\.\\".*/./
   s/^\\#.*/./
@@ -10,5 +9,5 @@
   s/\\#.*/\\/
   /.[ad]s/!s/[  ]*\\"//
   /.[ad]s/s/\([^        ]*\)\\"/\1/
+  /^\.$/d
 }
-/^\.$/d



reply via email to

[Prev in Thread] Current Thread [Next in Thread]