mirror of
https://github.com/containers/podman.git
synced 2025-11-14 01:57:58 +08:00
Vendor in containers/(storage,image, common, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/storage/pkg/fileutils/fileutils.go
generated
vendored
8
vendor/github.com/containers/storage/pkg/fileutils/fileutils.go
generated
vendored
@@ -1,6 +1,7 @@
|
||||
package fileutils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -9,7 +10,6 @@ import (
|
||||
"strings"
|
||||
"text/scanner"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -340,13 +340,13 @@ func ReadSymlinkedDirectory(path string) (string, error) {
|
||||
// The target of the symbolic link can be a file and a directory.
|
||||
func ReadSymlinkedPath(path string) (realPath string, err error) {
|
||||
if realPath, err = filepath.Abs(path); err != nil {
|
||||
return "", errors.Wrapf(err, "unable to get absolute path for %q", path)
|
||||
return "", fmt.Errorf("unable to get absolute path for %q: %w", path, err)
|
||||
}
|
||||
if realPath, err = filepath.EvalSymlinks(realPath); err != nil {
|
||||
return "", errors.Wrapf(err, "failed to canonicalise path for %q", path)
|
||||
return "", fmt.Errorf("failed to canonicalise path for %q: %w", path, err)
|
||||
}
|
||||
if _, err := os.Stat(realPath); err != nil {
|
||||
return "", errors.Wrapf(err, "failed to stat target %q of %q", realPath, path)
|
||||
return "", fmt.Errorf("failed to stat target %q of %q: %w", realPath, path, err)
|
||||
}
|
||||
return realPath, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user