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/14 17:59:57 UTC

[1/3] ant git commit: detect solaris 10 to avoid certain POSIX expressions

Repository: ant
Updated Branches:
  refs/heads/master 9ef4ba386 -> 0dfa2918b


detect solaris 10 to avoid certain POSIX expressions


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

Branch: refs/heads/master
Commit: 022cee192e61a8306d1d46e44666d9612cfb1482
Parents: 1348ebb
Author: Jeffrey Adamson <jw...@us.ibm.com>
Authored: Fri Jan 13 11:16:45 2017 -0500
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Jan 14 18:58:42 2017 +0100

----------------------------------------------------------------------
 src/script/ant | 39 ++++++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/022cee19/src/script/ant
----------------------------------------------------------------------
diff --git a/src/script/ant b/src/script/ant
index 780764d..d98168c 100644
--- a/src/script/ant
+++ b/src/script/ant
@@ -22,6 +22,19 @@ use_jikes_default=false
 ant_exec_debug=false
 show_help=false
 
+if [ -z "$PROTECT_NL" ]
+then
+  PROTECT_NL=true
+  os=`uname -s`
+  rel=`uname -r`
+  # heirloom bourne-shell used by Solaris 10 is not POSIX
+  #  it lacks features necessary to protect trailing NL from subshell trimming
+  if [ "$os" = SunOS -a "$rel" = "5.10" ]
+  then
+    PROTECT_NL=false
+  fi
+fi
+
 for arg in "$@" ; do
   if [ "$arg" = "--noconfig" ] ; then
     no_config=true
@@ -37,17 +50,24 @@ for arg in "$@" ; do
       show_help=true
     fi
 
+    if [ "$PROTECT_NL" = "true" ] ; then
+      # pad the value with X to protect trailing NLs from subshell output trimming
+      esc_arg="${arg}X"
+    else
+      esc_arg="${arg}"
+    fi
+
     # wrap all arguments as "" strings, escape any internal back-slash, double-quote, $, or back-tick characters
     #  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"
     # 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}"
+    # Solaris sed only processes lines with trailing newline, passing in an extra newline
+    # subshell (heirloom and posix) will trim the added trailing newline
+    esc_arg="`printf '%s\n' "$esc_arg" | sed -e 's@\([$\"\`\\]\)@\\\\\\1@g' `"
+    
+    if [ "$PROTECT_NL" = "true" ] ; then
+      # remove the padding X added above, this syntax is POSIX compatible but not heirloom-sh
+      esc_arg="${esc_arg%X}"
+    fi
     quoted_arg="\"$esc_arg\""
 
     if $ant_exec_debug
@@ -352,7 +372,8 @@ else
 fi
 ant_exec_command="exec \"\$JAVACMD\" $ANT_OPTS -classpath \"\$LOCALCLASSPATH\" -Dant.home=\"\$ANT_HOME\" -Dant.library.dir=\"\$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"\$CLASSPATH\""
 if $ant_exec_debug ; then
-    echo "$ant_exec_command $ant_exec_args"
+    # using printf to avoid echo line continuation and escape interpretation confusion
+    printf "%s\n" "$ant_exec_command $ant_exec_args"
 fi
 
 eval "$ant_exec_command $ant_exec_args"


[3/3] ant git commit: Merge branch '1.9.x' - closes #29

Posted by bo...@apache.org.
Merge branch '1.9.x' - closes #29


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

Branch: refs/heads/master
Commit: 0dfa2918b51c213a13edbcc660984f631f6c92f7
Parents: 9ef4ba3 8d03bfd
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Jan 14 18:59:36 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Jan 14 18:59:40 2017 +0100

----------------------------------------------------------------------
 src/script/ant | 39 ++++++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------



[2/3] ant git commit: trim whitespace

Posted by bo...@apache.org.
trim whitespace


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

Branch: refs/heads/master
Commit: 8d03bfd672247e72a6b8b93dbb27ecbe5c432727
Parents: 022cee1
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Jan 14 18:59:12 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Jan 14 18:59:12 2017 +0100

----------------------------------------------------------------------
 src/script/ant | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/8d03bfd6/src/script/ant
----------------------------------------------------------------------
diff --git a/src/script/ant b/src/script/ant
index d98168c..8252d77 100644
--- a/src/script/ant
+++ b/src/script/ant
@@ -63,7 +63,7 @@ for arg in "$@" ; do
     # Solaris sed only processes lines with trailing newline, passing in an extra newline
     # subshell (heirloom and posix) will trim the added trailing newline
     esc_arg="`printf '%s\n' "$esc_arg" | sed -e 's@\([$\"\`\\]\)@\\\\\\1@g' `"
-    
+
     if [ "$PROTECT_NL" = "true" ] ; then
       # remove the padding X added above, this syntax is POSIX compatible but not heirloom-sh
       esc_arg="${esc_arg%X}"