From e69eef70c1ecd307af7df62e377353b9fefff0ba Mon Sep 17 00:00:00 2001 From: Dinesh Subhraveti Date: Thu, 19 Dec 2013 21:41:22 -0800 Subject: [PATCH] Add -S option to tar for efficient sparse file handling Fixes issue #3282 Upstream-commit: 733bf5d3ddbfb6dba7c2c0996c4af47a765e4593 Component: engine --- components/engine/AUTHORS | 1 + components/engine/archive/archive.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/engine/AUTHORS b/components/engine/AUTHORS index 60533c1cc2..2476208d13 100644 --- a/components/engine/AUTHORS +++ b/components/engine/AUTHORS @@ -47,6 +47,7 @@ Daniel YC Lin Darren Coxall David Calavera David Sissitka +Dinesh Subhraveti Deni Bertovic Dominik Honnef Don Spaulding diff --git a/components/engine/archive/archive.go b/components/engine/archive/archive.go index ae2c030cb7..f8fcf0b163 100644 --- a/components/engine/archive/archive.go +++ b/components/engine/archive/archive.go @@ -149,7 +149,7 @@ func escapeName(name string) string { // Tar creates an archive from the directory at `path`, only including files whose relative // paths are included in `filter`. If `filter` is nil, then all files are included. func TarFilter(path string, options *TarOptions) (io.Reader, error) { - args := []string{"tar", "--numeric-owner", "-f", "-", "-C", path, "-T", "-"} + args := []string{"tar", "-S", "--numeric-owner", "-f", "-", "-C", path, "-T", "-"} if options.Includes == nil { options.Includes = []string{"."} } @@ -228,7 +228,7 @@ func Untar(archive io.Reader, path string, options *TarOptions) error { compression := DetectCompression(buf) utils.Debugf("Archive compression detected: %s", compression.Extension()) - args := []string{"--numeric-owner", "-f", "-", "-C", path, "-x" + compression.Flag()} + args := []string{"-S", "--numeric-owner", "-f", "-", "-C", path, "-x" + compression.Flag()} if options != nil { for _, exclude := range options.Excludes {