Skip to content

Commit 3052549

Browse files
committed
Add timeout to tar command and exit if it doesn't succeed.
Also remove the verbose option of the tar file to improve speed. Bug: flutter/flutter#57176
1 parent c41258e commit 3052549

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎packages/fuchsia_ctl/bin/main.dart‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ Future<OperationResult> pushPackages(
262262

263263
stdout.writeln('Untaring $repoArchive to ${repo.path}');
264264
repo.createSync(recursive: true);
265-
await tar.untar(repoArchive, repo.path);
265+
final OperationResult result = await tar.untar(repoArchive, repo.path);
266+
if (!result.success) {
267+
stdout.writeln(
268+
'Error untarring $repoArchive \nstdout: ${result.info} \nstderr: ${result.error}');
269+
exit(-1);
270+
}
266271

267272
final String repositoryBase = path.join(repo.path, 'amber-files');
268273
stdout.writeln('Serving $repositoryBase to $targetIp');

‎packages/fuchsia_ctl/lib/src/tar.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class SystemTar implements Tar {
4242
) async {
4343
final ProcessResult result = await processManager.run(<String>[
4444
'tar',
45-
'-xvf', src, //
45+
'-xf', src, //
4646
'-C', destination,
47-
]);
47+
]).timeout(const Duration(minutes: 10));
4848

4949
return OperationResult.fromProcessResult(result);
5050
}

0 commit comments

Comments
 (0)