mirror of
https://github.com/containers/podman.git
synced 2025-09-27 16:54:42 +08:00
Bump to Buildah 1.16.0-dev in upstream
Bump Buildah to v1.16.0-dev in the upstream branch of Podman. This will allow us to get a number of new issues into the upstream branch for use. The version of Buildah will need to be bumped to v1.16.0 and then vendored into Podman before we release Podman v2.0 Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
16
vendor/github.com/containers/buildah/util/util.go
generated
vendored
16
vendor/github.com/containers/buildah/util/util.go
generated
vendored
@ -469,3 +469,19 @@ func FindLocalRuntime(runtime string) string {
|
||||
}
|
||||
return localRuntime
|
||||
}
|
||||
|
||||
// MergeEnv merges two lists of environment variables, avoiding duplicates.
|
||||
func MergeEnv(defaults, overrides []string) []string {
|
||||
s := make([]string, 0, len(defaults)+len(overrides))
|
||||
index := make(map[string]int)
|
||||
for _, envSpec := range append(defaults, overrides...) {
|
||||
envVar := strings.SplitN(envSpec, "=", 2)
|
||||
if i, ok := index[envVar[0]]; ok {
|
||||
s[i] = envSpec
|
||||
continue
|
||||
}
|
||||
s = append(s, envSpec)
|
||||
index[envVar[0]] = len(s) - 1
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
Reference in New Issue
Block a user