From 019d3d289ec29ce6ca72061f0e50b2b03afbbbc7 Mon Sep 17 00:00:00 2001 From: ekatek Date: Wed, 20 Aug 2014 15:20:22 -0700 Subject: [PATCH] don't crash when removing a nonexistent package --- tools/commands-packages.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/commands-packages.js b/tools/commands-packages.js index f64e537a3a..ab8dae91e0 100644 --- a/tools/commands-packages.js +++ b/tools/commands-packages.js @@ -1757,12 +1757,9 @@ main.registerCommand({ maxArgs: Infinity, requiresApp: true }, function (options) { - // Refresh the catalog, checking the remote package data on the - // server. Technically, we don't need to do this, since it is unlikely that - // new data will change our constraint solver decisions. But as a user, I - // would expect this command to update the local catalog. - // XXX what if we're offline? - refreshOfficialCatalogOrDie(); + // As user may expect this to update the catalog, but we con't actually need + // to, and it takes frustratingly long. + // refreshOfficialCatalogOrDie(); // Read in existing package dependencies. var packages = project.getConstraints(); @@ -1786,8 +1783,9 @@ main.registerCommand({ var messages = buildmessage.capture(function () { // Get the contents of our versions file, we will want them in order to - // remove to the user what we removed. - var versions = project.getVersions(); + // remove to the user what we removed. Note that we are actually just getting + // getting the versions file, not running the constraint solver. + var versions = project.dependencies; // Remove the packages from the project! There is really no way for this to // fail, unless something has gone horribly wrong, so we don't need to check