- Timestamp:
- Feb 5, 2014, 4:36:27 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/backend/oni/management/Installer.java
r924 r925 7 7 import java.io.IOException; 8 8 import java.io.InputStream; 9 import java.io.PrintWriter; 9 10 import java.text.SimpleDateFormat; 10 11 import java.util.Date; … … 479 480 log.logAppOutput(res, true); 480 481 481 // Apply patches in levelFolderXML 482 File lastFolder = null; 483 for (File f : patches.get(level)) { 484 File pathOfPatch = f.getParentFile(); 485 if (!pathOfPatch.equals(lastFolder)) { 486 lastFolder = pathOfPatch; 487 488 res = XMLTools.patch(pathOfPatch, levelFolderXML); 489 log.logAppOutput(res, false); 490 } 491 } 482 // Create masterpatch file (containing calls to all individual 483 // patches) 484 File masterpatch = new File(levelFolderXML, "masterpatch.txt"); 485 PrintWriter masterpatchWriter = null; 486 try { 487 masterpatchWriter = new PrintWriter(masterpatch); 488 } catch (FileNotFoundException e) { 489 e.printStackTrace(); 490 } 491 for (File patch : patches.get(level)) { 492 String patternWildcard = patch.getName(); 493 patternWildcard = patternWildcard.substring(0, 494 patternWildcard.indexOf(".oni-patch")); 495 patternWildcard = patternWildcard + ".xml"; 496 patternWildcard = patternWildcard.replace('-', '*'); 497 File xmlFilePath = new File(levelFolderXML, patternWildcard); 498 masterpatchWriter.println(String.format("\"%s\" \"%s\"", 499 patch.getPath(), xmlFilePath.getPath())); 500 } 501 masterpatchWriter.close(); 502 // Apply patches through masterpatch in levelFolderXML 503 res = XMLTools.patch(masterpatch); 504 log.logAppOutput(res, false); 492 505 493 506 // Create .oni files from XML
Note:
See TracChangeset
for help on using the changeset viewer.