diff --git a/tools/isopack.js b/tools/isopack.js index 1ef6c73d7c..1a50b4c42b 100644 --- a/tools/isopack.js +++ b/tools/isopack.js @@ -670,7 +670,7 @@ _.extend(Isopack.prototype, { var unibuildJson = JSON.parse( files.readFile(files.pathJoin(dir, unibuildMeta.path))); - unibuildJson = colonConverter.convertUnibuild(unibuildJson); + var unibuildBasePath = files.pathDirname(files.pathJoin(dir, unibuildMeta.path)); diff --git a/tools/tropohouse.js b/tools/tropohouse.js index 39d13d6308..d04f32c507 100644 --- a/tools/tropohouse.js +++ b/tools/tropohouse.js @@ -219,6 +219,25 @@ _.extend(exports.Tropohouse.prototype, { // Result: Now we are in a state where the isopack.json file paths are // consistent with the paths in the downloaded tarball. + + // Now, we have to convert the unibuild files in the same way. + _.each(metadata.builds, function (unibuildMeta) { + var unibuildJsonPath = files.pathJoin(dir, unibuildMeta.path); + var unibuildJson = JSON.parse(files.readFile(unibuildJsonPath)); + + if (unibuildJson.format !== "unipackage-unibuild-pre1") { + throw new Error("Unsupported isopack unibuild format: " + + JSON.stringify(unibuildJson.format)); + } + + var convertedUnibuild = colonConverter.convertUnibuild(unibuildJson); + + files.writeFile(convertedUnibuild, + new Buffer(JSON.stringify(unibuildJson, null, 2), 'utf8'), + {mode: 0444}); + // Result: Now we are in a state where the unibuild file paths are + // consistent with the paths in the downloaded tarball. + }); } return targetDirectory;