fixing version in publishing

This commit is contained in:
ekatek
2014-03-07 13:11:00 -08:00
parent 1669a2bd77
commit e42632b4e5
3 changed files with 10 additions and 6 deletions

View File

@@ -11,10 +11,10 @@ PackageVersion.parseVersionConstraint = function (versionString) {
return versionDesc; return versionDesc;
} }
if (versionString.charAt(0) === '=') { /* if (versionString.charAt(0) === '=') {
versionDesc.exact = true; versionDesc.exact = true;
versionString = versionString.substr(1); versionString = versionString.substr(1);
} } */
// XXX check for a dash in the version in case of foo@1.2.3-rc0 // XXX check for a dash in the version in case of foo@1.2.3-rc0

View File

@@ -551,7 +551,7 @@ main.registerCommand({
var getVersionFromVersionConstraint = function(constraint) { var getVersionFromVersionConstraint = function(constraint) {
if (constraint[0] === "=") { if (constraint && constraint[0] === "=") {
return constraint.split("=")[1]; return constraint.split("=")[1];
} }
return constraint; return constraint;
@@ -609,6 +609,7 @@ constraint.packageName + "@" + constraint.versionConstraint + ": no such versio
// Add the package to the list of packages that we use directly. // Add the package to the list of packages that we use directly.
usingDirectly[constraint.packageName] = constraint.versionConstraint; usingDirectly[constraint.packageName] = constraint.versionConstraint;
var usingIndirectly = project.getDepsAsObj(project.getIndirectDependencies(options.appDir)); var usingIndirectly = project.getDepsAsObj(project.getIndirectDependencies(options.appDir));
console.log(usingDirectly);
// Call the constraint solver. // Call the constraint solver.
var ConstraintSolver = unipackage.load({ var ConstraintSolver = unipackage.load({
@@ -617,7 +618,10 @@ constraint.packageName + "@" + constraint.versionConstraint + ": no such versio
release: release.current.name release: release.current.name
})['constraint-solver'].ConstraintSolver; })['constraint-solver'].ConstraintSolver;
console.log("Going to init constraint resolver");
var resolver = new ConstraintSolver.Resolver(cat); var resolver = new ConstraintSolver.Resolver(cat);
console.log("Initialized constraint resolver");
var newVersions = resolver.resolve(usingDirectly, var newVersions = resolver.resolve(usingDirectly,
usingIndirectly, usingIndirectly,
{ optionsGoHere : false }); { optionsGoHere : false });
@@ -1476,7 +1480,7 @@ main.registerCommand({
if (! version) { if (! version) {
process.stderr.write( process.stderr.write(
"That package cannot be published because it doesn't have a version.\n"); "That package cannot be published because it doesn't have a version.\n");
return 1; return 1;
} }

View File

@@ -982,14 +982,14 @@ _.extend(Package.prototype, {
_.keys(self.defaultSlices)); _.keys(self.defaultSlices));
//XXX: this is commented out, but maybe shouldn't be. //XXX: this is commented out, but maybe shouldn't be.
if (! chosenArch) { /*if (! chosenArch) {
buildmessage.error( buildmessage.error(
(self.name || "this app") + (self.name || "this app") +
" is not compatible with architecture '" + arch + "'", " is not compatible with architecture '" + arch + "'",
{ secondary: true }); { secondary: true });
// recover by returning by no slices // recover by returning by no slices
return []; return [];
} }*/
return _.map(self.defaultSlices[chosenArch], function (name) { return _.map(self.defaultSlices[chosenArch], function (name) {
return self.getSingleSlice(name, arch); return self.getSingleSlice(name, arch);