vendor latest c/{buildah,common,image,storage}

Make sure everything passes for rc2.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-01-27 12:41:14 +01:00
parent c76c13f179
commit 141bd613b8
96 changed files with 2712 additions and 1225 deletions

View File

@@ -112,10 +112,15 @@ func (d *DirectiveParser) ParseAll(data []byte) ([]*Directive, error) {
// This allows for a flexible range of input formats, and appropriate syntax
// selection.
func DetectSyntax(dt []byte) (string, string, []Range, bool) {
return ParseDirective(keySyntax, dt)
return parseDirective(keySyntax, dt, true)
}
func ParseDirective(key string, dt []byte) (string, string, []Range, bool) {
return parseDirective(key, dt, false)
}
func parseDirective(key string, dt []byte, anyFormat bool) (string, string, []Range, bool) {
dt = discardBOM(dt)
dt, hadShebang, err := discardShebang(dt)
if err != nil {
return "", "", nil, false
@@ -131,6 +136,10 @@ func ParseDirective(key string, dt []byte) (string, string, []Range, bool) {
return syntax, cmdline, loc, true
}
if !anyFormat {
return "", "", nil, false
}
// use directive with different comment prefix, and search for //key=
directiveParser = DirectiveParser{line: line}
directiveParser.setComment("//")
@@ -171,3 +180,7 @@ func discardShebang(dt []byte) ([]byte, bool, error) {
}
return dt, false, nil
}
func discardBOM(dt []byte) []byte {
return bytes.TrimPrefix(dt, []byte{0xEF, 0xBB, 0xBF})
}

View File

@@ -291,7 +291,7 @@ func Parse(rwc io.Reader) (*Result, error) {
bytesRead := scanner.Bytes()
if currentLine == 0 {
// First line, strip the byte-order-marker if present
bytesRead = bytes.TrimPrefix(bytesRead, utf8bom)
bytesRead = discardBOM(bytesRead)
}
if isComment(bytesRead) {
comment := strings.TrimSpace(string(bytesRead[1:]))
@@ -522,8 +522,6 @@ func isEmptyContinuationLine(line []byte) bool {
return len(trimLeadingWhitespace(trimNewline(line))) == 0
}
var utf8bom = []byte{0xEF, 0xBB, 0xBF}
func trimContinuationCharacter(line []byte, d *directives) ([]byte, bool) {
if d.lineContinuationRegex.Match(line) {
line = d.lineContinuationRegex.ReplaceAll(line, []byte("$1"))

View File

@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package shell

View File

@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.35.1
// protoc-gen-go v1.35.2
// protoc v3.11.4
// source: github.com/moby/buildkit/util/stack/stack.proto