From 43c9edad8a53a9748287b0175124e25bee6c39cb Mon Sep 17 00:00:00 2001 From: Todd Owen Date: Sun, 15 Jun 2014 22:38:41 +0800 Subject: [PATCH] unarchive: do not assume tar supports -C Fixes #7777 (But don't rewrite the tar invocation in is_unarchived(), since a tar that supports "--diff" certainly supports "-C" as well). --- library/files/unarchive | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/files/unarchive b/library/files/unarchive index 29e9ddb9e48..3decb69e122 100644 --- a/library/files/unarchive +++ b/library/files/unarchive @@ -120,8 +120,8 @@ class TgzFile(object): return dict(unarchived=unarchived, rc=rc, out=out, err=err, cmd=cmd) def unarchive(self): - cmd = '%s -C "%s" -x%sf "%s"' % (self.cmd_path, self.dest, self.zipflag, self.src) - rc, out, err = self.module.run_command(cmd) + cmd = '%s -x%sf "%s"' % (self.cmd_path, self.zipflag, self.src) + rc, out, err = self.module.run_command(cmd, cwd=self.dest) return dict(cmd=cmd, rc=rc, out=out, err=err) def can_handle_archive(self):