You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2017/01/09 17:37:08 UTC

[1/2] ant git commit: remove obsolete awk escaping - related to PR 60562

Repository: ant
Updated Branches:
  refs/heads/master d801c5488 -> 94dc12187


remove obsolete awk escaping - related to PR 60562


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/af4eb228
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/af4eb228
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/af4eb228

Branch: refs/heads/master
Commit: af4eb228ec9fb6b950848fe0623cde054ef3ba35
Parents: 2cd0300
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jan 9 18:36:14 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jan 9 18:36:14 2017 +0100

----------------------------------------------------------------------
 src/script/ant | 44 ++++----------------------------------------
 1 file changed, 4 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/af4eb228/src/script/ant
----------------------------------------------------------------------
diff --git a/src/script/ant b/src/script/ant
index 5d1d154..780764d 100644
--- a/src/script/ant
+++ b/src/script/ant
@@ -22,17 +22,6 @@ use_jikes_default=false
 ant_exec_debug=false
 show_help=false
 
-esc_tool=sed
-
-# if awk esc_tool is chosen, use nawk when available
-if [ "$esc_tool" = "awk" ]
-then
-  awk_exec=awk
-  # Solaris_awk does not support gsub, but Solaris_nawk does
-  # `command -v` behavior is part of posix spec
-  command -v nawk >/dev/null && awk_exec=nawk
-fi
-
 for arg in "$@" ; do
   if [ "$arg" = "--noconfig" ] ; then
     no_config=true
@@ -52,35 +41,10 @@ for arg in "$@" ; do
     #  use printf to avoid echo interpretation behaviors such as escapes and line continuation
     #  pad the value with X to protect leading/trailing whitespace from subshell output trimming
     esc_arg="X${arg}X"
-    case "$esc_tool" in
-      'sed')
-        # Mac bsd_sed does not support group-0, so pattern uses group-1
-        # Solaris sed only proceses lines with trailing newline, passing in an extra newline
-        # subshell assignment will trim the added trailing newline
-        esc_arg="$(printf '%s\n' "$esc_arg" | sed -e 's@\([$"\\`]\)@\\\1@g')"
-        ;;
-      'awk')
-        esc_arg="$(printf '%s' "$esc_arg" | "$awk_exec" '{ gsub(/\\/, "\\\\"); print }' )"
-        esc_arg="$(printf '%s' "$esc_arg" | "$awk_exec" '{ gsub(/\$/, "\\$");  print }' )"
-        esc_arg="$(printf '%s' "$esc_arg" | "$awk_exec" '{ gsub(/\"/, "\\\""); print }' )"
-        esc_arg="$(printf '%s' "$esc_arg" | "$awk_exec" '{ gsub(/`/,  "\\`");  print }' )"
-        ;;
-#      'bash')
-#        # does not depend upon `sed` or `echo` quirks
-#        # tested with bash `[ -n "${BASH_VERSION}" ]`
-#        # tested with zsh `[ -n "${ZSH_NAME}" ]`
-#        # tested with ksh93+ `ksh_ver="$(echo "$KSH_VERSION" | grep -m 1 -o '[0-9]\+' | head -n 1)"; [ "$ksh_ver" -gt 88 ]`
-#        # fails in ksh88, dash, ash
-#        esc_arg="${esc_arg//\\/\\\\}" # must be first since later patterns introduce backslash chars
-#        esc_arg="${esc_arg//\$/\\\$}"
-#        esc_arg="${esc_arg//\"/\\\"}"
-#        esc_arg="${esc_arg//\`/\\\`}"
-#        ;;
-      '*')
-        echo "could not determine escaping tool"
-        exit 1
-        ;;
-    esac
+    # Mac bsd_sed does not support group-0, so pattern uses group-1
+    # Solaris sed only proceses lines with trailing newline, passing in an extra newline
+    # subshell assignment will trim the added trailing newline
+    esc_arg="$(printf '%s\n' "$esc_arg" | sed -e 's@\([$"\\`]\)@\\\1@g')"
     # remove the padding Xs added above
     esc_arg="${esc_arg#X}"
     esc_arg="${esc_arg%X}"


[2/2] ant git commit: Merge branch '1.9.x'

Posted by bo...@apache.org.
Merge branch '1.9.x'


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/94dc1218
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/94dc1218
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/94dc1218

Branch: refs/heads/master
Commit: 94dc12187df290e75823f0ba0e733e1b2a76570b
Parents: d801c54 af4eb22
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jan 9 18:36:57 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jan 9 18:36:57 2017 +0100

----------------------------------------------------------------------
 src/script/ant | 44 ++++----------------------------------------
 1 file changed, 4 insertions(+), 40 deletions(-)
----------------------------------------------------------------------