mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
vendor: bump fileutils to v0.5.0
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@ require (
|
||||
github.com/godbus/dbus/v5 v5.0.3
|
||||
github.com/golang/protobuf v1.4.2
|
||||
github.com/moby/sys/mountinfo v0.1.3
|
||||
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976
|
||||
github.com/mrunalp/fileutils v0.5.0
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6
|
||||
github.com/opencontainers/selinux v1.6.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
||||
@@ -34,8 +34,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJ
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/moby/sys/mountinfo v0.1.3 h1:KIrhRO14+AkwKvG/g2yIpNMOUVZ02xNhOw8KY1WsLOI=
|
||||
github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
|
||||
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976 h1:aZQToFSLH8ejFeSkTc3r3L4dPImcj7Ib/KgmkQqbGGg=
|
||||
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
|
||||
github.com/mrunalp/fileutils v0.5.0 h1:NKzVxiH7eSk+OQ4M+ZYW1K6h27RUV3MI6NUTsHhU6Z4=
|
||||
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6 h1:NhsM2gc769rVWDqJvapK37r+7+CBXI8xHhnfnt8uQsg=
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opencontainers/selinux v1.6.0 h1:+bIAS/Za3q5FTwWym4fTB0vObnfCf3G/NC7K6Jx62mY=
|
||||
|
||||
+24
-14
@@ -22,7 +22,7 @@ func CopyFile(source string, dest string) error {
|
||||
|
||||
uid := int(st.Uid)
|
||||
gid := int(st.Gid)
|
||||
modeType := si.Mode()&os.ModeType
|
||||
modeType := si.Mode() & os.ModeType
|
||||
|
||||
// Handle symlinks
|
||||
if modeType == os.ModeSymlink {
|
||||
@@ -52,19 +52,7 @@ func CopyFile(source string, dest string) error {
|
||||
|
||||
// Handle regular files
|
||||
if si.Mode().IsRegular() {
|
||||
sf, err := os.Open(source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sf.Close()
|
||||
|
||||
df, err := os.Create(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer df.Close()
|
||||
|
||||
_, err = io.Copy(df, sf)
|
||||
err = copyInternal(source, dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -85,6 +73,28 @@ func CopyFile(source string, dest string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyInternal(source, dest string) (retErr error) {
|
||||
sf, err := os.Open(source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer sf.Close()
|
||||
|
||||
df, err := os.Create(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
err := df.Close()
|
||||
if retErr == nil {
|
||||
retErr = err
|
||||
}
|
||||
}()
|
||||
|
||||
_, err = io.Copy(df, sf)
|
||||
return err
|
||||
}
|
||||
|
||||
// CopyDirectory copies the files under the source directory
|
||||
// to dest directory. The dest directory is created if it
|
||||
// does not exist.
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module github.com/mrunalp/fileutils
|
||||
|
||||
go 1.13
|
||||
Vendored
+1
-1
@@ -35,7 +35,7 @@ github.com/konsorten/go-windows-terminal-sequences
|
||||
# github.com/moby/sys/mountinfo v0.1.3
|
||||
## explicit
|
||||
github.com/moby/sys/mountinfo
|
||||
# github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976
|
||||
# github.com/mrunalp/fileutils v0.5.0
|
||||
## explicit
|
||||
github.com/mrunalp/fileutils
|
||||
# github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6
|
||||
|
||||
Reference in New Issue
Block a user