Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: utils/pub/entrypoint.dart

Issue 10809058: Make "pub update PACKAGE" update a specific package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: utils/pub/entrypoint.dart
diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart
index 6729381df8e05163dbafbc7b552a1a83e995aece..d3f79beca41923a4006129aa927716c7b5b4bbe4 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -116,12 +116,28 @@ class Entrypoint {
* package to its "package" directory, writing a new [LockFile]. Returns a
* [Future] that completes when all dependencies are installed.
*/
- Future updateDependencies() {
+ Future updateAllDependencies() {
return resolveVersions(cache.sources, root, new LockFile.empty()).
chain(_installDependencies);
}
/**
+ * Installs the latest available versions of [dependencies], while leaving
+ * other dependencies as specified by the [LockFile]. Returns a [Future] that
+ * completes when all dependencies are installed.
+ */
+ Future updateDependencies(List<String> dependencies) {
+ return _loadLockFile().chain((lockFile) {
+ for (var dependency in dependencies) {
+ // TODO(nweiz): How do we want to detect and handle unknown
+ // dependencies here?
+ lockFile.packages.remove(dependency);
+ }
+ return resolveVersions(cache.sources, root, lockFile);
+ }).chain(_installDependencies);
+ }
+
+ /**
* Installs all dependencies listed in [packageVersions] and writes a
* [LockFile].
*/

Powered by Google App Engine
This is Rietveld 408576698