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

Unified Diff: utils/pub/system_cache.dart

Issue 10736015: Make the Git source install to the system cache. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes 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/system_cache.dart
diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
index 8065f9a16606650b5a7f347205fc89fa8e27d3e6..fd9035417ebe4c31d0d3fc26370dca3735c332b8 100644
--- a/utils/pub/system_cache.dart
+++ b/utils/pub/system_cache.dart
@@ -82,18 +82,7 @@ class SystemCache {
var pending = _pendingInstalls[id];
if (pending != null) return pending;
- var path = id.source.systemCacheDirectory(id);
- var future = exists(path).chain((exists) {
- // TODO(nweiz): better error handling
- if (exists) throw 'Package $id is already installed.';
- return ensureDir(dirname(path));
- }).chain((_) {
- return id.source.install(id, path);
- }).chain((found) {
- if (!found) throw 'Package $id not found.';
- return Package.load(path, sources);
- });
-
+ var future = id.source.installToSystemCache(id);
always(future, () => _pendingInstalls.remove(id));
_pendingInstalls[id] = future;
return future;
« utils/pub/git_source.dart ('K') | « utils/pub/source.dart ('k') | utils/pub/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698