Read versions instead of packages in the packages.js hack

This commit is contained in:
ekatek
2014-03-07 11:18:36 -08:00
parent f26c8f42e5
commit 78497c0b6b
3 changed files with 17 additions and 11 deletions

View File

@@ -1754,8 +1754,8 @@ _.extend(Package.prototype, {
_.each(["client", "server"], function (sliceName) {
// Determine used packages
// var names = project.getAllDependencies(appDir);
var names = project.getPackages(appDir);
var vers = project.getAllDependencies(appDir);
var arch = sliceName === "server" ? "os" : "browser";
@@ -1763,13 +1763,16 @@ _.extend(Package.prototype, {
// instead of an override.
names = _.map(names, function(name) {
var narr = name.split("@=");
if (narr.length === 2) {
var newPath = tropohouse.packagePath(narr[0], narr[1]);
self.library.override(narr[0], newPath);
}
return narr[0];
});
vers = _.map(vers, function(name) {
var newPath = tropohouse.packagePath(name.packageName, name.versionConstraint, "browser+os");
self.library.override(name.packageName, newPath);
return name.packageName;
});
names = _.union(names, vers);
// Create slice
var slice = new Slice(self, {
name: sliceName,

View File

@@ -54,9 +54,9 @@ tropohouse.downloadedBuilds = function (packageName, version) {
tropohouse.downloadedBuildsDirectory(packageName, version));
};
tropohouse.packagePath = function (packageName, version) {
tropohouse.packagePath = function (packageName, version, arch) {
return path.join(tropohouse.getWarehouseDir(), "packages", packageName,
version);
version, arch);
};
tropohouse.downloadSpecifiedBuild = function (buildRecord) {

View File

@@ -99,7 +99,10 @@ _.extend(WatchSet.prototype, {
if (self.files[filePath] === hash)
return;
// Nope, inconsistent.
self.alwaysFire = true;
console.log(filePath, hash, self.files[filePath]);
self.files[filePath] = hash;
// self.alwaysFire = true;
return;
}
self.files[filePath] = hash;
@@ -135,9 +138,9 @@ _.extend(WatchSet.prototype, {
self.alwaysFire = true;
return;
}
_.each(other.files, function (hash, name) {
self.addFile(name, hash);
});
// _.each(other.files, function (hash, name) {
// self.addFile(name, hash);
// });
_.each(other.directories, function (dir) {
// XXX this doesn't deep-clone the directory, but I think these objects
// are never mutated