1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2025-07-01 06:08:30 +00:00

archive/tar: make output deterministic

Replaces PID in PaxHeaders with 0.  Sorts PAX header keys before writing
them to the archive.

Fixes #12358

Change-Id: If239f89c85f1c9d9895a253fb06a47ad44960124
Reviewed-on: https://go-review.googlesource.com/13975
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
Matt Layher 2015-08-27 14:52:06 -04:00 committed by Vincent Batts
parent bffda594f7
commit 2424f4e367
5 changed files with 70 additions and 8 deletions

View file

@ -327,3 +327,14 @@ func toASCII(s string) string {
}
return buf.String()
}
// isHeaderOnlyType checks if the given type flag is of the type that has no
// data section even if a size is specified.
func isHeaderOnlyType(flag byte) bool {
switch flag {
case TypeLink, TypeSymlink, TypeChar, TypeBlock, TypeDir, TypeFifo:
return true
default:
return false
}
}