Author: nigel
Date: Tue Aug 14 14:57:52 2007
New Revision: 565940

URL: http://svn.apache.org/viewvc?view=rev&rev=565940
Log:
HADOOP-1714.  Fix TestDFSUpgradeFromImage to work on Windows.  Contributed by 
Raghu.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileUtil.java
    
lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=565940&r1=565939&r2=565940
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Aug 14 14:57:52 2007
@@ -526,6 +526,9 @@
 154. HADOOP-1716.  Fix a Pipes wordcount example to remove the 'file:'
      schema from its output path.  (omalley via cutting)
 
+155. HADOOP-1714.  Fix TestDFSUpgradeFromImage to work on Windows.
+     (Raghu Angadi via nigel)
+
 
 Release 0.13.0 - 2007-06-08
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileUtil.java
URL: 
http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileUtil.java?view=diff&rev=565940&r1=565939&r2=565940
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileUtil.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileUtil.java Tue Aug 14 
14:57:52 2007
@@ -316,16 +316,26 @@
 
   /**
    * Convert a os-native filename to a path that works for the shell.
-   * @param file The filename to convert
+   * @param filename The filename to convert
    * @return The unix pathname
    * @throws IOException on windows, there can be problems with the subprocess
    */
-  public static String makeShellPath(File file) throws IOException {
+  public static String makeShellPath(String filename) throws IOException {
     if (Path.WINDOWS) {
-      return new CygPathCommand(file.toString()).getResult();
+      return new CygPathCommand(filename).getResult();
     } else {
-      return file.toString();
-    }
+      return filename;
+    }    
+  }
+  
+  /**
+   * Convert a os-native filename to a path that works for the shell.
+   * @param file The filename to convert
+   * @return The unix pathname
+   * @throws IOException on windows, there can be problems with the subprocess
+   */
+  public static String makeShellPath(File file) throws IOException {
+    return makeShellPath(file.toString());
   }
 
   /**

Modified: 
lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java
URL: 
http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java?view=diff&rev=565940&r1=565939&r2=565940
==============================================================================
--- 
lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java 
(original)
+++ 
lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSUpgradeFromImage.java 
Tue Aug 14 14:57:52 2007
@@ -70,7 +70,8 @@
     }
     
     LOG.info("Unpacking the tar file " + tarFile);
-    String[] cmd = { "tar", "-zxf", tarFile, "-C", dataDir };
+    String[] cmd = { "tar", "-zxf", FileUtil.makeShellPath(tarFile), 
+                     "-C", FileUtil.makeShellPath(dataDir) };
     Command.execCommand(cmd);
     
     //Now read the reference info


Reply via email to