File: archive_110.go

package info (click to toggle)
golang-github-containers-storage 1.24.8%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,324 kB
  • sloc: sh: 812; ansic: 319; makefile: 175; awk: 12
file content (22 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// +build go1.10

package archive

import (
	"archive/tar"
	"time"
)

func copyPassHeader(hdr *tar.Header) {
	hdr.Format = tar.FormatPAX
}

func maybeTruncateHeaderModTime(hdr *tar.Header) {
	if hdr.Format == tar.FormatUnknown {
		// one of the first things archive/tar does is round this
		// value, possibly up, if the format isn't specified, while we
		// are much better equipped to handle truncation when scanning
		// for changes between source and an extracted copy of this
		hdr.ModTime = hdr.ModTime.Truncate(time.Second)
	}
}