Fix detection of unsuitable resolutions.

This commit is contained in:
André Cruz
2013-06-07 13:37:04 +01:00
parent e704733743
commit d020acca22

View File

@@ -590,21 +590,21 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
});
}
if (!suitable) {
this._logger.conflict('warn', 'Unsuitable resolution for ' + name + ': ' + resolution, {
if (suitable === -1) {
this._logger.warn('resolution', 'Unsuitable resolution declared for ' + name + ': ' + resolution, {
name: name,
picks: dataPicks,
resolution: resolution
});
} else {
this._logger.conflict('solved', 'Unable to find suitable version for ' + name, {
name: name,
picks: dataPicks,
resolution: resolution,
suitable: dataPicks[suitable]
});
return Q.resolve(picks[suitable]);
}
this._logger.conflict('solved', 'Unable to find suitable version for ' + name, {
name: name,
picks: dataPicks,
resolution: resolution,
suitable: dataPicks[suitable]
});
return Q.resolve(picks[suitable]);
}
// If interactive is disabled, error out
@@ -636,7 +636,7 @@ Manager.prototype._electSuitable = function (name, semvers, nonSemvers) {
}
if (this._saveResolutions) {
this._logger.info('resolution', 'Saved ' + name + '#' + resolution + ' as the resolution', {
this._logger.info('resolution', 'Saved ' + name + '#' + resolution + ' as resolution', {
package: name,
resolution: resolution,
action: this._resolutions[name] ? 'edit' : 'add'