Changeset 28010

Show
Ignore:
Timestamp:
09.08.2013 13:11:46 (6 years ago)
Author:
jmt12
Message:

Correctly set up the environment for calls to txt2tdb and also replace external file move command with internal one from nio

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/src/java/org/nzdl/gsdl/GSInfoDB.java

    r27910 r28010  
    6868        System.err.println("[DEBUG] Command: " + pb.command()); 
    6969      } 
     70      // - alter environment 
     71      Map<String, String> pb_env = pb.environment(); 
     72      pb_env.put("PATH", gsdl_home + "/ext/tdb-edit/linux/bin:" + gsdl_home + "/ext/tdb-edit/bin/script:" + pb_env.get("PATH")); 
     73      pb_env.put("LD_LIBRARY_PATH", gsdl_home + "/ext/tdb-edit/linux/lib:" + pb_env.get("LD_LIBRARY_PATH")); 
    7074      // Start the writer listening 
    7175      dbprocess = pb.start(); 
     
    9498      dbwriter.close(); 
    9599      dbprocess.waitFor(); 
     100      if (debug) 
     101      { 
     102        System.err.println("[DEBUG] temporary database size: " + this.tmp_file_path.toFile().length() + " bytes"); 
     103      } 
    96104      // Move the database into its final location 
     105      Files.move(this.tmp_file_path, this.file_path, StandardCopyOption.REPLACE_EXISTING); 
     106 
     107 
    97108      Runtime rut = Runtime.getRuntime(); 
    98109      Process process = rut.exec(new String[] {"mv", this.tmp_file_path.toString(), this.file_path.toString()}); 
    99110      // The below always says the file doesn't exist over NFS? 
    100       /* 
    101111      if (!this.file_path.toFile().exists()) 
    102112      { 
    103113        System.err.println("Error! Failed to move database file: " + this.tmp_file_path.toString() + " => " + this.file_path.toString()); 
    104114      } 
    105       */ 
     115      if (debug) 
     116      { 
     117        System.err.println("[DEBUG] final database size: " + this.file_path.toFile().length() + " bytes"); 
     118      } 
    106119    } 
    107120    catch (Exception ex)