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

Unified Diff: dart/utils/pub/hosted_source.dart

Issue 11174004: Merge revisions 13674, 13676, 13677, 13678 to trunk (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 2 months 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 | « dart/tools/VERSION ('k') | dart/utils/pub/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/utils/pub/hosted_source.dart
===================================================================
--- dart/utils/pub/hosted_source.dart (revision 13677)
+++ dart/utils/pub/hosted_source.dart (working copy)
@@ -77,7 +77,8 @@
// Download and extract the archive to a temp directory.
var tempDir;
- return Futures.wait([httpGet(fullUrl), createTempDir()]).chain((args) {
+ return Futures.wait([httpGet(fullUrl),
+ systemCache.createTempDir()]).chain((args) {
tempDir = args[1];
return timeout(extractTarGz(args[0], tempDir), HTTP_TIMEOUT,
'Timed out while fetching URL "$fullUrl".');
@@ -85,17 +86,16 @@
// Now that the install has succeeded, move it to the real location in
// the cache. This ensures that we don't leave half-busted ghost
// directories in the user's pub cache if an install fails.
- var rename = renameDir(tempDir, destPath);
- // TODO(rnystrom): Awful hack. On Windows, we see cases where the extract
- // has not finished by the time we get here, so the rename fails with a
- // "directory in use" error. So, we will just wait a couple of seconds
- // before we start.
if (io.Platform.operatingSystem == "windows") {
- rename = sleep(2000).chain((_) => rename);
+ // TODO(rnystrom): Awful hack. On Windows, we see cases where the
+ // extract has not finished by the time we get here, so the rename fails
+ // with a "directory in use" error. So, we will just wait a couple of
+ // seconds before we start.
+ return sleep(2000).chain((_) => renameDir(tempDir, destPath));
+ } else {
+ return renameDir(tempDir, destPath);
}
-
- return rename;
}).transform((_) => true);
}
« no previous file with comments | « dart/tools/VERSION ('k') | dart/utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698