mirror of
https://github.com/containers/podman.git
synced 2025-09-17 23:18:39 +08:00
Vendor in latest buildah and imagebuilder
We want to add the latest support for COPY --chown UID:GID. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1289 Approved by: TomSweeneyRedHat
This commit is contained in:

committed by
Atomic Bot

parent
89a9750b6d
commit
57e1600315
13
vendor/github.com/openshift/imagebuilder/internals.go
generated
vendored
13
vendor/github.com/openshift/imagebuilder/internals.go
generated
vendored
@ -46,12 +46,23 @@ func handleJSONArgs(args []string, attributes map[string]bool) []string {
|
||||
return []string{strings.Join(args, " ")}
|
||||
}
|
||||
|
||||
func hasSlash(input string) bool {
|
||||
return strings.HasSuffix(input, string(os.PathSeparator)) || strings.HasSuffix(input, string(os.PathSeparator)+".")
|
||||
}
|
||||
|
||||
// makeAbsolute ensures that the provided path is absolute.
|
||||
func makeAbsolute(dest, workingDir string) string {
|
||||
// Twiddle the destination when its a relative path - meaning, make it
|
||||
// relative to the WORKINGDIR
|
||||
if dest == "." {
|
||||
if !hasSlash(workingDir) {
|
||||
workingDir += string(os.PathSeparator)
|
||||
}
|
||||
dest = workingDir
|
||||
}
|
||||
|
||||
if !filepath.IsAbs(dest) {
|
||||
hasSlash := strings.HasSuffix(dest, string(os.PathSeparator)) || strings.HasSuffix(dest, string(os.PathSeparator)+".")
|
||||
hasSlash := hasSlash(dest)
|
||||
dest = filepath.Join(string(os.PathSeparator), filepath.FromSlash(workingDir), dest)
|
||||
|
||||
// Make sure we preserve any trailing slash
|
||||
|
Reference in New Issue
Block a user