| Index: sdk/lib/_internal/pub/lib/src/lock_file.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/lock_file.dart b/sdk/lib/_internal/pub/lib/src/lock_file.dart
|
| index 1e85a4d0e37f080c2bae62b9d59ccccc66dc06f1..316e8b58803b9b72e6421b8804c8ac146849b79e 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/lock_file.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/lock_file.dart
|
| @@ -58,21 +58,20 @@ class LockFile {
|
| throw new FormatException('Package $name is missing a source.');
|
| }
|
| var sourceName = spec['source'];
|
| - if (!sources.contains(sourceName)) {
|
| - throw new FormatException(
|
| - 'Could not find a source named $sourceName.');
|
| - }
|
| - var source = sources[sourceName];
|
|
|
| - // Parse the description.
|
| if (!spec.containsKey('description')) {
|
| throw new FormatException('Package $name is missing a description.');
|
| }
|
| var description = spec['description'];
|
| - description = source.parseDescription(filePath, description,
|
| - fromLockFile: true);
|
|
|
| - var id = new PackageId(name, source, version, description);
|
| + // Parse the description if we know the source.
|
| + if (sources.contains(sourceName)) {
|
| + var source = sources[sourceName];
|
| + description = source.parseDescription(filePath, description,
|
| + fromLockFile: true);
|
| + }
|
| +
|
| + var id = new PackageId(name, sourceName, version, description);
|
|
|
| // Validate the name.
|
| if (name != id.name) {
|
| @@ -97,7 +96,7 @@ class LockFile {
|
| sortedKeys.forEach((name) {
|
| packagesObj[name] = {
|
| 'version': packages[name].version.toString(),
|
| - 'source': packages[name].source.name,
|
| + 'source': packages[name].source,
|
| 'description': packages[name].description
|
| };
|
| });
|
|
|