vendor: update containers/{common,storage,image,buildah}

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2023-11-09 14:02:31 +01:00
parent ee5f582fbc
commit 478afa728d
65 changed files with 445 additions and 15476 deletions

View File

@@ -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)

View File

@@ -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
}

View File

@@ -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)
}

View File

@@ -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 {

View File

@@ -9,7 +9,7 @@ import (
"strings"
"sync"
"github.com/containerd/typeurl"
"github.com/containerd/typeurl/v2"
"github.com/pkg/errors"
)

View File

@@ -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