From: <otm...@us...> - 2008-12-01 23:33:57
|
Revision: 5671 http://jython.svn.sourceforge.net/jython/?rev=5671&view=rev Author: otmarhumbel Date: 2008-12-01 23:33:55 +0000 (Mon, 01 Dec 2008) Log Message: ----------- dump system properties to a file (in verbose mode) Modified Paths: -------------- trunk/installer/src/java/org/python/util/install/Installation.java Modified: trunk/installer/src/java/org/python/util/install/Installation.java =================================================================== --- trunk/installer/src/java/org/python/util/install/Installation.java 2008-12-01 18:33:00 UTC (rev 5670) +++ trunk/installer/src/java/org/python/util/install/Installation.java 2008-12-01 23:33:55 UTC (rev 5671) @@ -6,6 +6,7 @@ import java.io.FilenameFilter; import java.io.IOException; import java.text.MessageFormat; +import java.util.Enumeration; import java.util.Locale; import java.util.Properties; import java.util.ResourceBundle; @@ -326,6 +327,7 @@ try { boolean earlyVerbose = InstallerCommandLine.hasVerboseOptionInArgs(args); if (earlyVerbose) { + dumpSystemProperties(); ConsoleInstaller.message("reading jar info"); } JarInfo jarInfo = new JarInfo(); @@ -371,5 +373,23 @@ System.exit(1); } } + + private static void dumpSystemProperties() throws IOException { + @SuppressWarnings("unchecked") + Enumeration<String> names = (Enumeration<String>)System.getProperties().propertyNames(); + StringBuilder contents = new StringBuilder(400); + contents.append("Properties at the beginning of the Jython installation:\n\n"); + while (names.hasMoreElements()) { + String name = names.nextElement(); + String value = System.getProperty(name, ""); + contents.append(name); + contents.append('='); + contents.append(value); + contents.append("\n"); + } + File output = File.createTempFile("System", ".properties"); + FileHelper.write(output, contents.toString()); + ConsoleInstaller.message("system properties dumped to " + output.getAbsolutePath()); + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |