[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7891] avoid multiple levels of quoting in shell script
From: |
gavinsmith0123 |
Subject: |
[7891] avoid multiple levels of quoting in shell script |
Date: |
Sat, 1 Jul 2017 16:13:09 -0400 (EDT) |
Revision: 7891
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7891
Author: gavin
Date: 2017-07-01 16:13:09 -0400 (Sat, 01 Jul 2017)
Log Message:
-----------
avoid multiple levels of quoting in shell script
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Convert/XSParagraph/configure.ac
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2017-07-01 14:37:17 UTC (rev 7890)
+++ trunk/ChangeLog 2017-07-01 20:13:09 UTC (rev 7891)
@@ -1,5 +1,16 @@
2017-07-01 Gavin Smith <address@hidden>
+ * tp/Texinfo/Convert/XSParagraph/configure.ac (fetch_conf): Put
+ all sed commands within an environment variable, 'sed_script'.
+ Assign 'sed_script' from a double-quoted string, using shell
+ variables to include awkward characters. This avoids there
+ being multiple level of quoting present which can be extremely
+ confusing, i.e., autoconf's quadrigraphs, quoting within the
+ backquoted string where sed is called, as well as sed's own
+ escaping of special characters.
+
+2017-07-01 Gavin Smith <address@hidden>
+
* info/t/c-u-m-x-scroll-forward.sh, info/t/inc-sea-insensitive.sh,
info/t/search-split-after-index.sh, info/t/split-footnotes.sh,
info/t/star-note-non-whitespace.sh, info/t/tab-argument.sh,
Modified: trunk/tp/Texinfo/Convert/XSParagraph/configure.ac
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/configure.ac 2017-07-01 14:37:17 UTC
(rev 7890)
+++ trunk/tp/Texinfo/Convert/XSParagraph/configure.ac 2017-07-01 20:13:09 UTC
(rev 7891)
@@ -1,6 +1,6 @@
# configure.ac for XSParagraph
#
-# Copyright 2015, 2016 Free Software Foundation, Inc.
+# Copyright 2015, 2016, 2017 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -14,19 +14,25 @@
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
+b='\'
+o='@<:@' dnl quadrigraph for [ - see autoconf documentatoin
+c='@:>@' dnl quadrigraph for ]
+
+# This turns a string like "cc='cc';" into a string like "cc".
+# Afterwards, convert \ into / in case \ is a path separator,
+# so it is not interpreted as a special character by the shell.
+
+sed_script="
+s/^$o^=$c*= *//
+s/^'//
+s/ *; *$//
+s/'$//
+s/$b$b/$b//g"
+
fetch_conf ()
{
conf_value=`${PERL} -V:$1`
- # This turns a string like "cc='cc';" into a string like "cc".
- # Afterwards, convert \ into / in case \ is a path separator,
- # so it is not interpreted as a special character by the shell.
- conf_value=`echo $conf_value \
- | sed -e 's/^@<:@^=@:>@*= *//' \
- -e 's/^'\\''//' \
- -e 's/ *; *$//' \
- -e 's/'\\''$//' \
- -e 's/\\\\/\\//g' `
- #echo got "$conf_value"
+ conf_value=`echo $conf_value | sed "$sed_script"`
}
AC_DEFUN([lookup_perl_conf],
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7891] avoid multiple levels of quoting in shell script,
gavinsmith0123 <=