groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/04: eqn2graph: Remove -unsafe option.


From: G. Branden Robinson
Subject: [groff] 04/04: eqn2graph: Remove -unsafe option.
Date: Thu, 26 Apr 2018 04:29:31 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 3fa04f3e60bebfdcf968f573e6b46e6236a55789
Author: G. Branden Robinson <address@hidden>
Date:   Thu Apr 26 04:27:43 2018 -0400

    eqn2graph: Remove -unsafe option.
    
    contrib/eqn2graph/eqn2graph.sh:
    * Unrecognize "-unsafe" option and eliminate $groff_opts
    variable.  As far as I can tell, this option had no effect
    because (1) pic is not run on the input stream (no -p argument
    to groff); (2) eqn doesn't support "shelling out" as pic does;
    and (3) there is no way to embed *roff requests inside a
    sequence of eqn commands.  If I'm wrong, let me know.
    
    contrib/eqn2graph/eqn2graph.1.man:
    * Undocument "-unsafe" option.
    
    Signed-off-by: G. Branden Robinson <address@hidden>
---
 ChangeLog                         | 15 +++++++++++++++
 NEWS                              |  2 ++
 contrib/eqn2graph/eqn2graph.1.man | 18 ------------------
 contrib/eqn2graph/eqn2graph.sh    | 12 +++---------
 4 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9b9d7c9..18edd8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2018-04-26  G. Branden Robinson <address@hidden>
 
+       eqn2graph: Remove -unsafe option.
+
+       contrib/eqn2graph/eqn2graph.sh:
+       * Unrecognize "-unsafe" option and eliminate $groff_opts
+       variable.  As far as I can tell, this option had no effect
+       because (1) pic is not run on the input stream (no -p argument
+       to groff); (2) eqn doesn't support "shelling out" as pic does;
+       and (3) there is no way to embed *roff requests inside a
+       sequence of eqn commands.  If I'm wrong, let me know.
+
+       contrib/eqn2graph/eqn2graph.1.man:
+       * Undocument "-unsafe" option.
+
+2018-04-26  G. Branden Robinson <address@hidden>
+
        eqn2graph: Parallelize changes with pic2graph.
 
        contrib/eqn2graph/eqn2graph.sh:
diff --git a/NEWS b/NEWS
index 4d9ad17..d3c7fc2 100644
--- a/NEWS
+++ b/NEWS
@@ -61,6 +61,8 @@ o eqn2graph and pic2graph now attempt to adapt to very old 
installed
   programs emit a warning to standard error if the search fails and the old
   method is used.
 
+o eqn2graph no longer supports the "-unsafe" option.  It did nothing.
+
 o groffer now supports the output of XHTML.  Use the "--xhtml" or
   "--mode=xhtml" command-line options to generate it.
 
diff --git a/contrib/eqn2graph/eqn2graph.1.man 
b/contrib/eqn2graph/eqn2graph.1.man
index afe57c6..f9bd344 100644
--- a/contrib/eqn2graph/eqn2graph.1.man
+++ b/contrib/eqn2graph/eqn2graph.1.man
@@ -15,7 +15,6 @@ eqn2graph \- convert an EQN equation into a cropped image
 .\" ====================================================================
 .
 .SY eqn2graph
-.OP \-unsafe
 .OP \-format output-format
 .RI [ \%convert-arguments ]
 .YS
@@ -86,23 +85,6 @@ pixels.
 .\" ====================================================================
 .
 .TP
-.B \-unsafe
-Run
-.I groff
-in
-.I unsafe
-mode, enabling the
-.I PIC
-command
-.B sh
-to execute arbitrary Unix shell commands.
-.
-The
-.I groff
-default is to forbid this.
-.
-.
-.TP
 .BI "\-format " output-format
 Write the image in
 .IR output-format ,
diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh
index daa8517..620dd37 100644
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -8,7 +8,6 @@
 #
 # Take an eqn equation on stdin, emit cropped bitmap on stdout.
 # The eqn markup should *not* be wrapped in .EQ/.EN, this script will do that.
-# A -U option on the command line enables gpic/groff "unsafe" mode.
 # A -format FOO option changes the image output format to any format
 # supported by convert(1).  All other options are passed to convert(1).
 # The default format is PNG.
@@ -25,14 +24,11 @@
 #
 # 1. None of the options of eqn(1) are relevant.
 #
-# 2. Only the -U option of groff(1) is relevant.
-#
-# 3. Many options of convert(1) are potentially relevant, (especially 
+# 2. Many options of convert(1) are potentially relevant, (especially
 # -density, -interlace, -transparency, -border, and -comment).
 #
-# Thus, we pass -U to groff(1), and everything else to convert(1).
+# Thus, we pass everything except -format to convert(1).
 #
-groff_opts=""
 convert_opts=""
 convert_trim_arg="-trim"
 format="png"
@@ -40,8 +36,6 @@ format="png"
 while [ "$1" ]
 do
     case $1 in
-    -unsafe)
-       groff_opts="-U";;
     -format)
        format=$2
        shift;;
@@ -106,7 +100,7 @@ trap 'exit_status=$?; rm -rf "$tmp" && exit $exit_status' 
EXIT INT TERM
 # 4. Use convert(1) to crop the Postscript and turn it into a bitmap.
 read equation
 (echo ".EQ"; echo 'delim $$'; echo ".EN"; echo '$'"$equation"'$') | \
-       groff -e $groff_opts -Tps -P-pletter > "$tmp"/eqn2graph.ps \
+       groff -e -Tps -P-pletter > "$tmp"/eqn2graph.ps \
        && convert $convert_trim_arg $convert_opts "$tmp"/eqn2graph.ps \
           "$tmp"/eqn2graph.$format \
        && cat "$tmp"/eqn2graph.$format



reply via email to

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