-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3437 from infosiftr/manifest-tool
Build manifest-tool from source to apply a minor patch
- Loading branch information
Showing
4 changed files
with
156 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
set -euo pipefail | ||
|
||
# usage: (from within another script) | ||
# eval "$(./.bashbrew-arch-to-goenv.sh)" | ||
# since we need those new environment variables in our other script | ||
|
||
bashbrewArch="$1"; shift # "amd64", "arm32v5", "windows-amd64", etc. | ||
|
||
os="${bashbrewArch%%-*}" | ||
[ "$os" != "$bashbrewArch" ] || os='linux' | ||
printf 'export GOOS="%s"\n' "$os" | ||
|
||
arch="${bashbrewArch#${os}-}" | ||
case "$arch" in | ||
arm32v*) | ||
printf 'export GOARCH="%s"\n' 'arm' | ||
printf 'export GOARM="%s"\n' "${arch#arm32v}" | ||
;; | ||
|
||
arm64v*) | ||
printf 'export GOARCH="%s"\n' 'arm64' | ||
# no GOARM for arm64 (yet?) -- https://github.com/golang/go/blob/1e72bf62183ea21b9affffd4450d44d994393899/src/cmd/internal/objabi/util.go#L40 | ||
#printf 'export GOARM="%s"\n' "${arch#arm64v}" | ||
printf 'unset GOARM\n' | ||
;; | ||
|
||
i386) | ||
printf 'export GOARCH="%s"\n' '386' | ||
printf 'unset GOARM\n' | ||
;; | ||
|
||
*) | ||
printf 'export GOARCH="%s"\n' "$arch" | ||
printf 'unset GOARM\n' | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ go/bin | |
go/pkg | ||
go/vendor/bin | ||
go/vendor/pkg | ||
!.bashbrew-arch-to-goenv.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
https://github.com/estesp/manifest-tool/issues/47 | ||
|
||
diff --git a/vendor/github.com/docker/distribution/reference/reference.go b/vendor/github.com/docker/distribution/reference/reference.go | ||
index 52da523..3cf3d98 100644 | ||
--- a/vendor/github.com/docker/distribution/reference/reference.go | ||
+++ b/vendor/github.com/docker/distribution/reference/reference.go | ||
@@ -100,6 +100,13 @@ func (f *Field) UnmarshalText(p []byte) error { | ||
return nil | ||
} | ||
|
||
+func remoteName(name string) string { | ||
+ if !strings.ContainsRune(name, '/') { | ||
+ return "library/" + name | ||
+ } | ||
+ return name | ||
+} | ||
+ | ||
// Named is an object with a full name | ||
type Named interface { | ||
Reference | ||
@@ -304,7 +311,7 @@ func (r reference) String() string { | ||
} | ||
|
||
func (r reference) Name() string { | ||
- return r.name | ||
+ return remoteName(r.name) | ||
} | ||
|
||
func (r reference) Tag() string { | ||
@@ -322,7 +329,7 @@ func (r repository) String() string { | ||
} | ||
|
||
func (r repository) Name() string { | ||
- return string(r) | ||
+ return remoteName(string(r)) | ||
} | ||
|
||
type digestReference digest.Digest | ||
@@ -345,7 +352,7 @@ func (t taggedReference) String() string { | ||
} | ||
|
||
func (t taggedReference) Name() string { | ||
- return t.name | ||
+ return remoteName(t.name) | ||
} | ||
|
||
func (t taggedReference) Tag() string { | ||
@@ -362,7 +369,7 @@ func (c canonicalReference) String() string { | ||
} | ||
|
||
func (c canonicalReference) Name() string { | ||
- return c.name | ||
+ return remoteName(c.name) | ||
} | ||
|
||
func (c canonicalReference) Digest() digest.Digest { |