aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelliottcable2009-10-17 22:39:27 -0800
committerMax Howell2009-11-11 19:18:55 +0000
commit794cb43534c41a3dc6108f5fdbfcb31488392f55 (patch)
treef0cde4885f87a1ac3fa30fc1fa6961daad60f4c2
parent888c311d47eb22cca61986834be223bf59324347 (diff)
downloadhomebrew-794cb43534c41a3dc6108f5fdbfcb31488392f55.tar.bz2
Applied Mark Norman Francis’ patch to fix the [Deprecated] warnings from Java
-rw-r--r--Library/Formula/ec2-api-tools.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/Formula/ec2-api-tools.rb b/Library/Formula/ec2-api-tools.rb
index e79dadd02..d635edcf9 100644
--- a/Library/Formula/ec2-api-tools.rb
+++ b/Library/Formula/ec2-api-tools.rb
@@ -5,6 +5,13 @@ class Ec2ApiTools <Formula
@url='http://ec2-downloads.s3.amazonaws.com/ec2-api-tools-1.3-41620.zip'
@md5='14734acff6ac8f6899de0398d3eeb0f6'
+ def patches
+ # (From http://gist.github.com/200283) Gets rid of the
+ # “[Deprecated] Xalan: org.apache.xml.res.XMLErrorResources_en_US”
+ # messages that the tools spew on 1.3-41620 under Snow Leopard
+ DATA
+ end
+
def install
# Nothing to be done but copying things into place
FileUtils.rm Dir['bin/*\.cmd']
@@ -42,3 +49,25 @@ directory, `~/.ec2`, and then add the following to your profile file:
end
end
+
+
+__END__
+diff --git i/bin/ec2-cmd w/bin/ec2-cmd
+index 57051eb..edc2aae 100755
+--- i/bin/ec2-cmd
++++ w/bin/ec2-cmd
+@@ -58,4 +58,13 @@ fi
+
+ CMD=$1
+ shift
+-"$JAVA_HOME/bin/java" $EC2_JVM_ARGS $cygprop -classpath "$CP" com.amazon.aes.webservices.client.cmd.$CMD "$@"
++
++# to filter out the "deprecated" warnings introduced by Snow Leopard...
++exec 3>&1 # ... redirect fd3 to stdout
++exec 4>&2 # ... redirect fd4 to stderr
++
++# ... execute the java, sending stderr to stdout (so it gets grepped),
++# but stdout goes to fd3 (the preserved real stdout)
++# and the grepped output goes to fd4 (the preserved stderr)
++"$JAVA_HOME/bin/java" $EC2_JVM_ARGS $cygprop -classpath "$CP" com.amazon.aes.webservices.client.cmd.$CMD "$@" \
++ 2>&1 >&3 | grep -v '^\[Deprecated\] Xalan' >&4