mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-25 17:45:39 +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) {
|
linkKeywordFunc = func(path string, info os.FileInfo, r io.Reader) (string, error) {
|
||||||
if sys, ok := info.Sys().(*tar.Header); ok {
|
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 {
|
if info.Mode()&os.ModeSymlink != 0 {
|
||||||
|
|
Loading…
Reference in a new issue