ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r708670 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
Date Tue, 28 Oct 2008 21:08:05 GMT
Author: jglick
Date: Tue Oct 28 14:08:05 2008
New Revision: 708670

URL: http://svn.apache.org/viewvc?rev=708670&view=rev
Log:
Suppress displaying the stderr prompt for storepass/keypass when we in fact are passing it
on stdin.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java?rev=708670&r1=708669&r2=708670&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java Tue Oct
28 14:08:05 2008
@@ -24,10 +24,12 @@
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
+import org.apache.tools.ant.filters.LineContainsRegExp;
 import org.apache.tools.ant.types.Environment;
 import org.apache.tools.ant.types.FileSet;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.types.RedirectorElement;
+import org.apache.tools.ant.types.RegularExpression;
 import org.apache.tools.ant.util.JavaEnvUtils;
 
 /**
@@ -244,6 +246,14 @@
             }
             result.setInputString(input.toString());
             result.setLogInputString(false);
+            // Try to avoid showing password prompts on log output, as they would be confusing.
+            LineContainsRegExp filter = new LineContainsRegExp();
+            RegularExpression rx = new RegularExpression();
+            // XXX only handles English locale, not ja or zh_CN
+            rx.setPattern("^(Enter Passphrase for keystore: |Enter key password for .+: )$");
+            filter.addConfiguredRegexp(rx);
+            filter.setNegate(true);
+            result.createErrorFilterChain().addLineContainsRegExp(filter);
         }
         return result;
     }



Mime
View raw message