Workaround broken -C option in tar 1.2.6.
This is needed for migrating to Precise, since the version of
tar in Ubuntu Precise has a broken -C option.
BUG=chromium:181685
TEST=Unit tests. Remote trybot run.
Previous-Change-Id: I1356a1fe2e2e3b562d82360dc37e9c2278b567ee
Previous-Change-Id: Id3979ff8a727f342eae7c4f07fe6e3bf173b0ea9
Change-Id: Iaf2f2cb69b815b358095d0b1432efdcca25c4149
Previous-Reviewed-on: https://gerrit.chromium.org/gerrit/45295
(cherry picked from commit 135aa4e05c8f52444fa134071cdd299df2852f15)
Reviewed-on: https://gerrit.chromium.org/gerrit/45462
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/buildbot/cbuildbot_commands.py b/buildbot/cbuildbot_commands.py
index 20b28b9..64e2445 100644
--- a/buildbot/cbuildbot_commands.py
+++ b/buildbot/cbuildbot_commands.py
@@ -537,6 +537,7 @@
# We need to unzip the test results tarball first because we cannot update
# a compressed tarball.
+ gzipped_test_tarball = os.path.abspath(gzipped_test_tarball)
cros_build_lib.RunCommand([gzip, '-df', gzipped_test_tarball])
test_tarball = os.path.splitext(gzipped_test_tarball)[0] + '.tar'
@@ -562,8 +563,8 @@
log_stdout_to_file=minidump_stack_trace)
filename = ArchiveFile(minidump_stack_trace, archive_dir)
stack_trace_filenames.append(filename)
- cros_build_lib.RunCommand(['tar', 'uf', test_tarball,
- '--directory=%s' % temp_dir, '.'])
+ cmd = ['tar', 'uf', test_tarball, '.']
+ cros_build_lib.RunCommand(cmd, cwd=temp_dir)
cros_build_lib.RunCommand('%s -c %s > %s'
% (gzip, test_tarball, gzipped_test_tarball),
shell=True)