mirror of
https://github.com/containers/podman.git
synced 2025-12-04 04:09:40 +08:00
Update buildah to current master
Vendor some changes to parsing code that we need for Podman. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
14
vendor/github.com/containers/buildah/util/util_not_uint64.go
generated
vendored
Normal file
14
vendor/github.com/containers/buildah/util/util_not_uint64.go
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// +build darwin
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func makeHardlinkDeviceAndInode(st *syscall.Stat_t) hardlinkDeviceAndInode {
|
||||
return hardlinkDeviceAndInode{
|
||||
device: uint64(st.Dev),
|
||||
inode: uint64(st.Ino),
|
||||
}
|
||||
}
|
||||
14
vendor/github.com/containers/buildah/util/util_uint64.go
generated
vendored
Normal file
14
vendor/github.com/containers/buildah/util/util_uint64.go
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// +build linux
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func makeHardlinkDeviceAndInode(st *syscall.Stat_t) hardlinkDeviceAndInode {
|
||||
return hardlinkDeviceAndInode{
|
||||
device: st.Dev,
|
||||
inode: st.Ino,
|
||||
}
|
||||
}
|
||||
31
vendor/github.com/containers/buildah/util/util_unix.go
generated
vendored
Normal file
31
vendor/github.com/containers/buildah/util/util_unix.go
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// +build linux darwin
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type hardlinkDeviceAndInode struct {
|
||||
device, inode uint64
|
||||
}
|
||||
|
||||
type HardlinkChecker struct {
|
||||
hardlinks sync.Map
|
||||
}
|
||||
|
||||
func (h *HardlinkChecker) Check(fi os.FileInfo) string {
|
||||
if st, ok := fi.Sys().(*syscall.Stat_t); ok && fi.Mode().IsRegular() && st.Nlink > 1 {
|
||||
if name, ok := h.hardlinks.Load(makeHardlinkDeviceAndInode(st)); ok && name.(string) != "" {
|
||||
return name.(string)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (h *HardlinkChecker) Add(fi os.FileInfo, name string) {
|
||||
if st, ok := fi.Sys().(*syscall.Stat_t); ok && fi.Mode().IsRegular() && st.Nlink > 1 {
|
||||
h.hardlinks.Store(makeHardlinkDeviceAndInode(st), name)
|
||||
}
|
||||
}
|
||||
16
vendor/github.com/containers/buildah/util/util_windows.go
generated
vendored
Normal file
16
vendor/github.com/containers/buildah/util/util_windows.go
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// +build !linux,!darwin
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
type HardlinkChecker struct {
|
||||
}
|
||||
|
||||
func (h *HardlinkChecker) Check(fi os.FileInfo) string {
|
||||
return ""
|
||||
}
|
||||
func (h *HardlinkChecker) Add(fi os.FileInfo, name string) {
|
||||
}
|
||||
Reference in New Issue
Block a user