mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add -S option to tar for efficient sparse file handling
Fixes issue #3282
This commit is contained in:
parent
efde305c05
commit
733bf5d3dd
2 changed files with 3 additions and 2 deletions
1
AUTHORS
1
AUTHORS
|
@ -47,6 +47,7 @@ Daniel YC Lin <dlin.tw@gmail.com>
|
||||||
Darren Coxall <darren@darrencoxall.com>
|
Darren Coxall <darren@darrencoxall.com>
|
||||||
David Calavera <david.calavera@gmail.com>
|
David Calavera <david.calavera@gmail.com>
|
||||||
David Sissitka <me@dsissitka.com>
|
David Sissitka <me@dsissitka.com>
|
||||||
|
Dinesh Subhraveti <dineshs@altiscale.com>
|
||||||
Deni Bertovic <deni@kset.org>
|
Deni Bertovic <deni@kset.org>
|
||||||
Dominik Honnef <dominik@honnef.co>
|
Dominik Honnef <dominik@honnef.co>
|
||||||
Don Spaulding <donspauldingii@gmail.com>
|
Don Spaulding <donspauldingii@gmail.com>
|
||||||
|
|
|
@ -149,7 +149,7 @@ func escapeName(name string) string {
|
||||||
// Tar creates an archive from the directory at `path`, only including files whose relative
|
// 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.
|
// paths are included in `filter`. If `filter` is nil, then all files are included.
|
||||||
func TarFilter(path string, options *TarOptions) (io.Reader, error) {
|
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 {
|
if options.Includes == nil {
|
||||||
options.Includes = []string{"."}
|
options.Includes = []string{"."}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ func Untar(archive io.Reader, path string, options *TarOptions) error {
|
||||||
compression := DetectCompression(buf)
|
compression := DetectCompression(buf)
|
||||||
|
|
||||||
utils.Debugf("Archive compression detected: %s", compression.Extension())
|
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 {
|
if options != nil {
|
||||||
for _, exclude := range options.Excludes {
|
for _, exclude := range options.Excludes {
|
||||||
|
|
Loading…
Add table
Reference in a new issue