Browse Source

HADOOP-426. Fix streaming contrib module to work correctly on Solaris. This was causing nightly builds to fail. Contributed by Michel.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@429868 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 năm trước cách đây
mục cha
commit
d4facd8303

+ 4 - 0
CHANGES.txt

@@ -7,6 +7,10 @@ Trunk (unreleased changes)
     web UI code with DatanodeInfo, the preferred public class.
     (Devaraj Das via cutting)
 
+ 2. HADOOP-426.  Fix streaming contrib module to work correctly on
+    Solaris.  This was causing nightly builds to fail.
+    (Michel Tourn via cutting)
+
 
 Release 0.5.0 - 2006-08-04
 

+ 5 - 1
src/contrib/streaming/src/java/org/apache/hadoop/streaming/Environment.java

@@ -30,12 +30,16 @@ public class Environment extends Properties
    {
       // Extend this code to fit all operating
       // environments that you expect to run in
+      // http://lopica.sourceforge.net/os.html
       String command = null;
       String OS = System.getProperty("os.name");
       String lowerOs = OS.toLowerCase();
       if (OS.indexOf("Windows") > -1) {
          command = "cmd /C set";
-      } else if (OS.indexOf("ix") > -1 || OS.indexOf("inux") > -1) {
+      } else if (lowerOs.indexOf("ix") > -1 || lowerOs.indexOf("linux") > -1 
+        || lowerOs.indexOf("freebsd") > -1
+        || lowerOs.indexOf("sunos") > -1 || lowerOs.indexOf("solaris") > -1
+        || lowerOs.indexOf("hp-ux") > -1) {
          command = "env";
       } else if(lowerOs.startsWith("mac os x")) {
          command = "env";