Fix uniload for packages with plugins

This commit is contained in:
Matthew Arbesfeld
2014-08-20 20:54:58 -07:00
parent 080f6f60dd
commit d771fdbf2a
2 changed files with 18 additions and 1 deletions

View File

@@ -448,6 +448,13 @@ _.extend(CompleteCatalog.prototype, {
// OK, we're building something while uniload
var ret = {};
_.each(constraints, function (constraint) {
if (_.has(constraint, 'version')) {
if (constraint.version !== null) {
throw Error("Uniload specifying version? " + JSON.stringify(constraint));
}
delete constraint.version;
}
// Constraints for uniload should just be packages with no version
// constraint and one local version (since they should all be in core).
if (!_.has(constraint, 'packageName') || _.size(constraint) !== 1) {

View File

@@ -14,7 +14,17 @@ exports.PackageLoader = function (options) {
var self = this;
if (!options.catalog)
throw Error("Must specify a catalog");
self.versions = options.versions || null;
self.versions = null;
// Ignore specified versions if we're doing this as part of uniload.
// The PackageLoader created in uniload.js will not specify a versions option,
// but other PackageLoaders (eg, created to build plugins in compiler.compile)
// might, but we should ignore that since uniload never loads versioned
// packages; it only loads precompiled packages (for built releases) or local
//packages (from checkout).
if (options.versions && options.catalog !== catalog.uniload)
self.versions = options.versions;
self.uniloadDir = options.uniloadDir;
self.constraintSolverOpts = options.constraintSolverOpts;
self.catalog = options.catalog;