Chromium Code Reviews

Unified Diff: sdk/lib/_internal/pub/lib/src/source/hosted.dart

Issue 766393002: Fix a couple bugs in r42055. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub_generated/bin/async_compile.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/source/hosted.dart
diff --git a/sdk/lib/_internal/pub/lib/src/source/hosted.dart b/sdk/lib/_internal/pub/lib/src/source/hosted.dart
index 825a87257384c62e6834b01a23c925754a16ff73..593f99353467837b6aa12fec735f22fbcb79cd15 100644
--- a/sdk/lib/_internal/pub/lib/src/source/hosted.dart
+++ b/sdk/lib/_internal/pub/lib/src/source/hosted.dart
@@ -134,7 +134,9 @@ class HostedSource extends CachedSource {
var url = _directoryToUrl(path.basename(serverDir));
var packages = _getCachedPackagesInDirectory(path.basename(serverDir));
packages.sort(Package.orderByNameAndVersion);
- for (var package in packages) {
+ // TODO(nweiz): Use a normal for loop here when
+ // https://github.com/dart-lang/async_await/issues/72 is fixed.
+ await Future.forEach(packages, (package) async {
try {
await _download(url, package.name, package.version, package.dir);
successes++;
@@ -148,7 +150,7 @@ class HostedSource extends CachedSource {
tryDeleteEntry(package.dir);
}
- }
+ });
}
return new Pair(successes, failures);
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub_generated/bin/async_compile.dart » ('j') | no next file with comments »

Powered by Google App Engine