mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Vendored hashicorp/go-getter
Brings in fix for directory permissions when expanding tarballs
This commit is contained in:
8
vendor/github.com/hashicorp/go-getter/decompress_tar.go
generated
vendored
8
vendor/github.com/hashicorp/go-getter/decompress_tar.go
generated
vendored
@@ -101,10 +101,14 @@ func untar(input io.Reader, dst, src string, dir bool) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Adding a file or subdirectory changes the mtime of a directory
|
||||
// We therefore wait until we've extracted everything and then set the mtime and atime attributes
|
||||
// Perform a final pass over extracted directories to update metadata
|
||||
for _, dirHdr := range dirHdrs {
|
||||
path := filepath.Join(dst, dirHdr.Name)
|
||||
// Chmod the directory since they might be created before we know the mode flags
|
||||
if err := os.Chmod(path, dirHdr.FileInfo().Mode()); err != nil {
|
||||
return err
|
||||
}
|
||||
// Set the mtime/atime attributes since they would have been changed during extraction
|
||||
if err := os.Chtimes(path, dirHdr.AccessTime, dirHdr.ModTime); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user