| Index: utils/pub/system_cache.dart
|
| diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
|
| index d4f41d3df63ccfe3d19c4da15dcb5084b397dcc7..8f4b5bd110e8df906b9de60d2647a12487d55463 100644
|
| --- a/utils/pub/system_cache.dart
|
| +++ b/utils/pub/system_cache.dart
|
| @@ -20,11 +20,17 @@ class SystemCache {
|
| final Map<PackageId, Future<Package>> _pendingInstalls;
|
|
|
| /**
|
| + * The sources from which to install packages.
|
| + */
|
| + final SourceRegistry sources;
|
| +
|
| + /**
|
| * Creates a new package cache which is backed by the given directory on the
|
| * user's file system.
|
| */
|
| SystemCache(this.rootDir)
|
| - : _pendingInstalls = new Map<PackageId, Future<Package>>();
|
| + : _pendingInstalls = new Map<PackageId, Future<Package>>(),
|
| + sources = new SourceRegistry();
|
|
|
| /**
|
| * Loads all of the package ids in the cache and returns them.
|
| @@ -32,7 +38,7 @@ class SystemCache {
|
| Future<List<PackageId>> listAll() {
|
| return listDir(rootDir).chain((paths) {
|
| final sources = paths.map((path) {
|
| - final source = Source.fromName(basename(path));
|
| + final source = sources[basename(path)];
|
| return listDir(path).transform((subpaths) {
|
| return subpaths.map((subpath) =>
|
| new PackageId(basename(subpath), source));
|
| @@ -68,7 +74,7 @@ class SystemCache {
|
| if (!found) {
|
| throw 'Package ${id.fullName} not found in source "${id.source.name}".';
|
| }
|
| - return Package.load(path);
|
| + return Package.load(path, sources);
|
| });
|
|
|
| always(future, () => _pendingInstalls.remove(id));
|
|
|