| 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);
|
| }
|
|
|
|
|