mirror of
https://github.com/containers/podman.git
synced 2025-11-29 17:48:05 +08:00
vendor: update containers/{common,storage,image,buildah}
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
3
vendor/github.com/moby/buildkit/frontend/dockerfile/parser/parser.go
generated
vendored
3
vendor/github.com/moby/buildkit/frontend/dockerfile/parser/parser.go
generated
vendored
@@ -49,8 +49,7 @@ func (node *Node) Location() []Range {
|
||||
// Dump dumps the AST defined by `node` as a list of sexps.
|
||||
// Returns a string suitable for printing.
|
||||
func (node *Node) Dump() string {
|
||||
str := ""
|
||||
str += strings.ToLower(node.Value)
|
||||
str := strings.ToLower(node.Value)
|
||||
|
||||
if len(node.Flags) > 0 {
|
||||
str += fmt.Sprintf(" %q", node.Flags)
|
||||
|
||||
4
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/equal_env_unix.go
generated
vendored
4
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/equal_env_unix.go
generated
vendored
@@ -4,8 +4,8 @@
|
||||
package shell
|
||||
|
||||
// EqualEnvKeys compare two strings and returns true if they are equal.
|
||||
// On Unix this comparison is case sensitive.
|
||||
// On Windows this comparison is case insensitive.
|
||||
// On Unix this comparison is case-sensitive.
|
||||
// On Windows this comparison is case-insensitive.
|
||||
func EqualEnvKeys(from, to string) bool {
|
||||
return from == to
|
||||
}
|
||||
|
||||
6
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/equal_env_windows.go
generated
vendored
6
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/equal_env_windows.go
generated
vendored
@@ -3,8 +3,8 @@ package shell
|
||||
import "strings"
|
||||
|
||||
// EqualEnvKeys compare two strings and returns true if they are equal.
|
||||
// On Unix this comparison is case sensitive.
|
||||
// On Windows this comparison is case insensitive.
|
||||
// On Unix this comparison is case-sensitive.
|
||||
// On Windows this comparison is case-insensitive.
|
||||
func EqualEnvKeys(from, to string) bool {
|
||||
return strings.ToUpper(from) == strings.ToUpper(to)
|
||||
return strings.EqualFold(from, to)
|
||||
}
|
||||
|
||||
81
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/lex.go
generated
vendored
81
vendor/github.com/moby/buildkit/frontend/dockerfile/shell/lex.go
generated
vendored
@@ -335,39 +335,23 @@ func (sw *shellWord) processDollar() (string, error) {
|
||||
}
|
||||
name := sw.processName()
|
||||
ch := sw.scanner.Next()
|
||||
chs := string(ch)
|
||||
nullIsUnset := false
|
||||
|
||||
switch ch {
|
||||
case '}':
|
||||
// Normal ${xx} case
|
||||
value, found := sw.getEnv(name)
|
||||
if !found && sw.skipUnsetEnv {
|
||||
value, set := sw.getEnv(name)
|
||||
if !set && sw.skipUnsetEnv {
|
||||
return fmt.Sprintf("${%s}", name), nil
|
||||
}
|
||||
return value, nil
|
||||
case '?':
|
||||
word, _, err := sw.processStopOn('}')
|
||||
if err != nil {
|
||||
if sw.scanner.Peek() == scanner.EOF {
|
||||
return "", errors.New("syntax error: missing '}'")
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
newValue, found := sw.getEnv(name)
|
||||
if !found {
|
||||
if sw.skipUnsetEnv {
|
||||
return fmt.Sprintf("${%s?%s}", name, word), nil
|
||||
}
|
||||
message := "is not allowed to be unset"
|
||||
if word != "" {
|
||||
message = word
|
||||
}
|
||||
return "", errors.Errorf("%s: %s", name, message)
|
||||
}
|
||||
return newValue, nil
|
||||
case ':':
|
||||
// Special ${xx:...} format processing
|
||||
// Yes it allows for recursive $'s in the ... spot
|
||||
modifier := sw.scanner.Next()
|
||||
|
||||
nullIsUnset = true
|
||||
ch = sw.scanner.Next()
|
||||
chs += string(ch)
|
||||
fallthrough
|
||||
case '+', '-', '?':
|
||||
word, _, err := sw.processStopOn('}')
|
||||
if err != nil {
|
||||
if sw.scanner.Peek() == scanner.EOF {
|
||||
@@ -378,53 +362,44 @@ func (sw *shellWord) processDollar() (string, error) {
|
||||
|
||||
// Grab the current value of the variable in question so we
|
||||
// can use it to determine what to do based on the modifier
|
||||
newValue, found := sw.getEnv(name)
|
||||
|
||||
switch modifier {
|
||||
case '+':
|
||||
if newValue != "" {
|
||||
newValue = word
|
||||
}
|
||||
if !found && sw.skipUnsetEnv {
|
||||
return fmt.Sprintf("${%s:%s%s}", name, string(modifier), word), nil
|
||||
}
|
||||
return newValue, nil
|
||||
value, set := sw.getEnv(name)
|
||||
if sw.skipUnsetEnv && !set {
|
||||
return fmt.Sprintf("${%s%s%s}", name, chs, word), nil
|
||||
}
|
||||
|
||||
switch ch {
|
||||
case '-':
|
||||
if newValue == "" {
|
||||
newValue = word
|
||||
if !set || (nullIsUnset && value == "") {
|
||||
return word, nil
|
||||
}
|
||||
if !found && sw.skipUnsetEnv {
|
||||
return fmt.Sprintf("${%s:%s%s}", name, string(modifier), word), nil
|
||||
return value, nil
|
||||
case '+':
|
||||
if !set || (nullIsUnset && value == "") {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return newValue, nil
|
||||
|
||||
return word, nil
|
||||
case '?':
|
||||
if !found {
|
||||
if sw.skipUnsetEnv {
|
||||
return fmt.Sprintf("${%s:%s%s}", name, string(modifier), word), nil
|
||||
}
|
||||
if !set {
|
||||
message := "is not allowed to be unset"
|
||||
if word != "" {
|
||||
message = word
|
||||
}
|
||||
return "", errors.Errorf("%s: %s", name, message)
|
||||
}
|
||||
if newValue == "" {
|
||||
if nullIsUnset && value == "" {
|
||||
message := "is not allowed to be empty"
|
||||
if word != "" {
|
||||
message = word
|
||||
}
|
||||
return "", errors.Errorf("%s: %s", name, message)
|
||||
}
|
||||
return newValue, nil
|
||||
|
||||
return value, nil
|
||||
default:
|
||||
return "", errors.Errorf("unsupported modifier (%c) in substitution", modifier)
|
||||
return "", errors.Errorf("unsupported modifier (%s) in substitution", chs)
|
||||
}
|
||||
default:
|
||||
return "", errors.Errorf("unsupported modifier (%s) in substitution", chs)
|
||||
}
|
||||
return "", errors.Errorf("missing ':' in substitution")
|
||||
}
|
||||
|
||||
func (sw *shellWord) processName() string {
|
||||
|
||||
2
vendor/github.com/moby/buildkit/util/stack/stack.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/stack/stack.go
generated
vendored
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/containerd/typeurl"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
2
vendor/github.com/moby/buildkit/util/stack/stack.pb.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/stack/stack.pb.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.11.4
|
||||
// source: stack.proto
|
||||
|
||||
|
||||
Reference in New Issue
Block a user