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
Change-Id: I44e60a50d2998fa2808673f30f80bfb5ce9af6fa
Previous-Reviewed-on: https://gerrit.chromium.org/gerrit/45295
(cherry picked from commit 48ad59329085b218371c8117a3181bc8ecce5fe9)
Reviewed-on: https://gerrit.chromium.org/gerrit/45471
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 785a075..0186e22 100644
--- a/buildbot/cbuildbot_commands.py
+++ b/buildbot/cbuildbot_commands.py
@@ -463,6 +463,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'
 
@@ -488,8 +489,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('gzip -c %s > %s'
                             % (test_tarball, gzipped_test_tarball), shell=True)
   os.unlink(test_tarball)