Index: lib/src/io.dart |
diff --git a/lib/src/io.dart b/lib/src/io.dart |
index 69248cdb8a2f30d1dcf8959a11d3e66e07f8bd77..9ea932de0f031f14c113fa0edf1d55e2f977a25b 100644 |
--- a/lib/src/io.dart |
+++ b/lib/src/io.dart |
@@ -1012,7 +1012,7 @@ ByteStream createTarGz(List contents, {String baseDir}) { |
return path.relative(entry, from: baseDir); |
}).toList(); |
- if (Platform.operatingSystem != "windows") { |
+ if (!Platform.isWindows) { |
var args = [ |
// ustar is the most recent tar format that's compatible across all |
// OSes. |
@@ -1025,6 +1025,12 @@ ByteStream createTarGz(List contents, {String baseDir}) { |
"/dev/stdin" |
]; |
+ // The ustar format doesn't support large UIDs, which can happen if |
+ // someone's using Active Directory on Linux. We don't care about |
+ // preserving ownership anyway, so we just set them to 0. Note that BSD |
+ // tar doesn't support the `--owner` or `--group` arguments. |
+ if (Platform.isLinux) args.addAll(["--owner=0", "--group=0"]); |
+ |
var process = await startProcess("tar", args); |
process.stdin.add(UTF8.encode(contents.join("\n"))); |
process.stdin.close(); |