1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-23 08:35:44 +00:00

keywords: tar.Xattrs is deprecated by PAXRecords

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2022-04-08 22:48:20 -04:00
parent 3bc8e48538
commit 7b5bbd4eaa
Signed by: vbatts
GPG key ID: 10937E57733F1362

View file

@ -1,3 +1,4 @@
//go:build linux
// +build linux // +build linux
package mtree package mtree
@ -69,11 +70,11 @@ var (
} }
xattrKeywordFunc = func(path string, info os.FileInfo, r io.Reader) ([]KeyVal, error) { xattrKeywordFunc = func(path string, info os.FileInfo, r io.Reader) ([]KeyVal, error) {
if hdr, ok := info.Sys().(*tar.Header); ok { if hdr, ok := info.Sys().(*tar.Header); ok {
if len(hdr.Xattrs) == 0 { if len(hdr.PAXRecords) == 0 {
return nil, nil return nil, nil
} }
klist := []KeyVal{} klist := []KeyVal{}
for k, v := range hdr.Xattrs { for k, v := range hdr.PAXRecords {
encKey, err := govis.Vis(k, DefaultVisFlags) encKey, err := govis.Vis(k, DefaultVisFlags)
if err != nil { if err != nil {
return nil, nil return nil, nil