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

Unified Diff: utils/pub/io.dart

Issue 11146022: Put a nasty sleep() on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 6e45a7412a1f26eb3c378f1f10d10c14097e5f5a..c5f64c6bd0b237dbe0c653bb96c56a3d14890428 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -685,7 +685,13 @@ Future<bool> _extractTarGzWindows(InputStream stream, String destination) {
// Write the archive to a temp file.
tempDir = temp;
return createFileFromStream(stream, join(tempDir, 'data.tar.gz'));
- }).chain((tarGz) {
+ }).chain((_) {
+ // TODO(rnystrom): Hack. We get intermittent "file already in use" errors.
kasperl 2012/10/16 05:44:46 This smells like a dart:io issue. Did you file a b
+ // It looks like the 7zip process is starting up before the file has
+ // finished being written. So we'll just sleep for a couple of seconds
+ // here. :(
+ return sleep(2000);
+ }).chain((_) {
// 7zip can't unarchive from gzip -> tar -> destination all in one step
// first we un-gzip it to a tar file.
// Note: Setting the working directory instead of passing in a full file
@@ -697,7 +703,6 @@ Future<bool> _extractTarGzWindows(InputStream stream, String destination) {
'${Strings.join(result.stdout, "\n")}\n'
'${Strings.join(result.stderr, "\n")}';
}
-
// Find the tar file we just created since we don't know its name.
return listDir(tempDir);
}).chain((files) {
@@ -717,6 +722,7 @@ Future<bool> _extractTarGzWindows(InputStream stream, String destination) {
}).chain((result) {
if (result.exitCode != 0) {
throw 'Could not un-tar (exit code ${result.exitCode}). Error:\n'
+ '${Strings.join(result.stdout, "\n")}\n'
'${Strings.join(result.stderr, "\n")}';
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698