mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-05 00:15:58 +00:00
keywords: return "link" keyword along with its value
Originally only returning `Sys.linkname` when evaluating a tar header's link field. We want it to be in the form of keyword=value instead. Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
parent
faa80931af
commit
f0f15a0e49
1 changed files with 4 additions and 1 deletions
|
@ -216,7 +216,10 @@ var (
|
|||
}
|
||||
linkKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
|
||||
if sys, ok := info.Sys().(*tar.Header); ok {
|
||||
return sys.Linkname, nil
|
||||
if sys.Linkname != "" {
|
||||
return fmt.Sprintf("link=%s", sys.Linkname), nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
if info.Mode()&os.ModeSymlink != 0 {
|
||||
|
|
Loading…
Reference in a new issue