mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Only choose prerelease package versions if asked
Make sure 'meteor add foo' gives the same constraint to the solver as 'foo' from .meteor/packages: namely, '>=0.0.0' not 'unconstrained' (since the first rules out rcs and the second doesn't)
This commit is contained in:
@@ -362,6 +362,12 @@ ConstraintSolver.Constraint.prototype.isSatisfied = function (candidateUV,
|
||||
var self = this;
|
||||
check(candidateUV, ConstraintSolver.UnitVersion);
|
||||
|
||||
// Pre-releases only match precisely; @1.2.3-rc1 doesn't necessarily match
|
||||
// 1.2.4, and @1.2.3 doesn't necessarily match 1.2.4-rc1.
|
||||
if (/-/.test(candidateUV.version) || /-/.test(self.version)) {
|
||||
return self.version === candidateUV.version;
|
||||
}
|
||||
|
||||
if (self.type === "exactly")
|
||||
return self.version === candidateUV.version;
|
||||
|
||||
|
||||
@@ -1746,9 +1746,10 @@ main.registerCommand({
|
||||
packages[constraint.name] = constraint.constraintString;
|
||||
|
||||
// Also, add it to all of our combined dependencies.
|
||||
var constraintForResolver = _.clone(constraint);
|
||||
constraintForResolver.packageName = constraintForResolver.name;
|
||||
delete constraintForResolver.name;
|
||||
// This matches code in project.calculateCombinedConstraints.
|
||||
var constraintForResolver = _.extend(
|
||||
{ packageName: constraint.name },
|
||||
utils.parseVersionConstraint(constraint.constraintString));
|
||||
allPackages.push(constraintForResolver);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user