From c113cb283bb2b645bc64bf0467f2b442a6d5c3ae Mon Sep 17 00:00:00 2001 From: Sashko Stubailo Date: Thu, 8 Jan 2015 19:54:52 -0800 Subject: [PATCH] Deploying might work properly --- tools/tropohouse.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tools/tropohouse.js b/tools/tropohouse.js index 5a3e1814a7..79b342b887 100644 --- a/tools/tropohouse.js +++ b/tools/tropohouse.js @@ -171,6 +171,7 @@ _.extend(exports.Tropohouse.prototype, { // // XXX: Error handling. _downloadBuildToTempDir: function (versionInfo, buildRecord) { + console.log("downloading to temp dir"); var self = this; var targetDirectory = files.mkdtemp(); @@ -187,7 +188,7 @@ _.extend(exports.Tropohouse.prototype, { wait: false }); files.extractTarGz(packageTarball, targetDirectory); - + console.log("Extracted to " + targetDirectory); return targetDirectory; }, @@ -315,14 +316,15 @@ _.extend(exports.Tropohouse.prototype, { }, function() { var buildTempDirs = []; - // XXX on windows we will special case this whole block // Find the previous actual directory of the package - var packageLinkTarget = null; - if (process.platform === "win32") { // On Windows, we don't use symlinks. - packageLinkTarget = packagePath; + // If there's already a package in the tropohouse, start with it. + if (files.exists(packagePath)) { + buildTempDirs.push(packagePath); + } } else { + var packageLinkTarget = null; try { packageLinkTarget = files.readFile(packagePath); } catch (e) { @@ -336,14 +338,15 @@ _.extend(exports.Tropohouse.prototype, { throw e; } } - } - // If there's already a package in the tropohouse, start with it. - if (packageLinkTarget) { - buildTempDirs.push( - files.pathResolve(files.pathDirname(packagePath), - packageLinkTarget)); + // If there's already a package in the tropohouse, start with it. + if (packageLinkTarget) { + buildTempDirs.push( + files.pathResolve(files.pathDirname(packagePath), + packageLinkTarget)); + } } + // XXX how does concurrency work here? we could just get errors if we // try to rename over the other thing? but that's the same as in // warehouse? @@ -360,6 +363,8 @@ _.extend(exports.Tropohouse.prototype, { if (buildmessage.jobHasMessages()) return; + console.log(buildTempDirs); + // We need to turn our builds into a single isopack. var isopack = new Isopack; _.each(buildTempDirs, function (buildTempDir, i) {