| Index: tools/export_tarball/export_tarball.py
|
| diff --git a/tools/export_tarball/export_tarball.py b/tools/export_tarball/export_tarball.py
|
| index 08a87560906fb8f4a3a1e0466bbdc770e08cdaaa..8d27f3fa33c951ce588ca8fa4555c06aed878a5c 100755
|
| --- a/tools/export_tarball/export_tarball.py
|
| +++ b/tools/export_tarball/export_tarball.py
|
| @@ -134,6 +134,7 @@ def main(argv):
|
| # TODO(phajdan.jr): Remove --xz option when it's not needed for compatibility.
|
| parser.add_option("--xz", action="store_true")
|
| parser.add_option("--verbose", action="store_true", default=False)
|
| + parser.add_option("--progress", action="store_true", default=False)
|
|
|
| options, args = parser.parse_args(argv)
|
|
|
| @@ -174,7 +175,19 @@ def main(argv):
|
| finally:
|
| archive.close()
|
|
|
| - if subprocess.call(['xz', '-9', output_fullname]) != 0:
|
| + if options.progress:
|
| + sys.stdout.flush()
|
| + pv = subprocess.Popen(
|
| + ['pv', '--force', output_fullname],
|
| + stdout=subprocess.PIPE,
|
| + stderr=sys.stdout)
|
| + with open(output_fullname + '.xz', 'w') as f:
|
| + rc = subprocess.call(['xz', '-9', '-'], stdin=pv.stdout, stdout=f)
|
| + pv.wait()
|
| + else:
|
| + rc = subprocess.call(['xz', '-9', output_fullname])
|
| +
|
| + if rc != 0:
|
| print 'xz -9 failed!'
|
| return 1
|
|
|
|
|