| 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;
|
|
|