Skip to content

Commit

Permalink
Add -S option to tar for efficient sparse file handling
Browse files Browse the repository at this point in the history
Fixes issue #3282
  • Loading branch information
dineshs-altiscale committed Dec 20, 2013
1 parent efde305 commit 733bf5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Daniel YC Lin <dlin.tw@gmail.com>
Darren Coxall <darren@darrencoxall.com>
David Calavera <david.calavera@gmail.com>
David Sissitka <me@dsissitka.com>
Dinesh Subhraveti <dineshs@altiscale.com>
Deni Bertovic <deni@kset.org>
Dominik Honnef <dominik@honnef.co>
Don Spaulding <donspauldingii@gmail.com>
Expand Down
4 changes: 2 additions & 2 deletions archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{"."}
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 733bf5d

Please sign in to comment.