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

Unified Diff: lib/src/entrypoint.dart

Issue 1528523003: Clean up the semantics of package descriptions. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years 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
« no previous file with comments | « lib/src/command/cache_add.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/entrypoint.dart
diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index 60f07eead00353d3260b283d683b2c6080c4766d..507b12cc3956b41636f2306a081717a03fc8d613 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -173,8 +173,8 @@ class Entrypoint {
deleteEntry(packagesDir);
}
- var ids = await Future.wait(result.packages.map(_get));
- _saveLockFile(ids);
+ await Future.wait(result.packages.map(_get));
+ _saveLockFile(result.packages);
if (_packageSymlinks) _linkSelf();
_linkOrDeleteSecondaryPackageDirs();
@@ -393,20 +393,18 @@ class Entrypoint {
/// This automatically downloads the package to the system-wide cache as well
/// if it requires network access to retrieve (specifically, if the package's
/// source is a [CachedSource]).
- Future<PackageId> _get(PackageId id) {
- if (id.isRoot) return new Future.value(id);
+ Future _get(PackageId id) async {
+ if (id.isRoot) return;
var source = cache.sources[id.source];
- return new Future.sync(() {
- if (!_packageSymlinks) {
- if (source is! CachedSource) return null;
- return source.downloadToSystemCache(id);
- }
+ if (!_packageSymlinks) {
+ if (source is CachedSource) await source.downloadToSystemCache(id);
+ return;
+ }
- var packageDir = p.join(packagesDir, id.name);
- if (entryExists(packageDir)) deleteEntry(packageDir);
- return source.get(id, packageDir);
- }).then((_) => source.resolveId(id));
+ var packageDir = p.join(packagesDir, id.name);
+ if (entryExists(packageDir)) deleteEntry(packageDir);
+ await source.get(id, packageDir);
}
/// Throws a [DataError] if the `.packages` file doesn't exist or if it's
« no previous file with comments | « lib/src/command/cache_add.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698