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

Unified Diff: utils/pub/hosted_source.dart

Issue 11170003: Pub fix for Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments 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 | « no previous file | utils/pub/io.dart » ('j') | utils/pub/io.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/hosted_source.dart
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart
index 4ca407420b45dc165e8bc40f6840f568ee0837f6..b3676b86c51d9f2f1db08a386e3f347e5e9fe9db 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -86,17 +86,16 @@ class HostedSource extends Source {
// 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);
Bob Nystrom 2012/10/16 14:07:29 Maybe I just haven't had my coffee yet, but I don'
Anders Johnsen 2012/10/16 14:29:57 The problem is that before, you started the rename
Bob Nystrom 2012/10/16 16:07:00 /me smacks forehead. Right you are. Thanks.
}
-
- return rename;
}).transform((_) => true);
}
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | utils/pub/io.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698