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

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 427343002: Silence harmless tar warnings on Linux when downloading OS X tarfiles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index 90e8cf749092ae8a36a81a986526d2ba49c7a7bb..864d6f4c6171087dc81ac367f6f86200fb014488 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -793,8 +793,16 @@ Future<bool> extractTarGz(Stream<List<int>> stream, String destination) {
return _extractTarGzWindows(stream, destination);
}
- return startProcess("tar",
- ["--extract", "--gunzip", "--directory", destination]).then((process) {
+ var args = ["--extract", "--gunzip", "--directory", destination];
+ if (Platform.operatingSystem == "linux") {
+ // BSD tar (the default on OS X) can insert strange headers to a tarfile
+ // that GNU tar (the default on Linux) is unable to understand. This will
+ // cause GNU tar to emit a number of harmless but scary-looking warnings
+ // which are silenced by this flag.
+ args.insert(0, "--warning=no-unknown-keyword");
+ }
+
+ return startProcess("tar", args).then((process) {
// Ignore errors on process.std{out,err}. They'll be passed to
// process.exitCode, and we don't want them being top-levelled by
// std{out,err}Sink.
« 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