Browse Source

Fix "DockerFrom" failure on "windows-amd64"-only tags

Tianon Gravi 8 years ago
parent
commit
2ec4c7cc64
1 changed files with 16 additions and 14 deletions
  1. 16 14
      diff-pr.sh

+ 16 - 14
diff-pr.sh

@@ -91,20 +91,22 @@ archesListTemplate='
 # TODO something less hacky than "git archive" hackery, like a "bashbrew archive" or "bashbrew context" or something
 template='
 {{- range $.Entries -}}
-	{{- $from := $.DockerFrom . -}}
-	git -C "$BASHBREW_CACHE/git" archive --format=tar
-	{{- " " -}}
-	{{- "--prefix=" -}}
-	{{- $.RepoName -}}
-	_
-	{{- .Tags | last -}}
-	{{- "/" -}}
-	{{- " " -}}
-	{{- .ArchGitCommit "'"$BASHBREW_ARCH"'" -}}
-	{{- ":" -}}
-	{{- $dir := .ArchDirectory "'"$BASHBREW_ARCH"'" -}}
-	{{- (eq $dir ".") | ternary "" $dir -}}
-	{{- "\n" -}}
+	{{- if .HasArchitecture arch -}}
+		{{- $from := $.DockerFrom . -}}
+		git -C "$BASHBREW_CACHE/git" archive --format=tar
+		{{- " " -}}
+		{{- "--prefix=" -}}
+		{{- $.RepoName -}}
+		_
+		{{- .Tags | last -}}
+		{{- "/" -}}
+		{{- " " -}}
+		{{- .ArchGitCommit arch -}}
+		{{- ":" -}}
+		{{- $dir := .ArchDirectory arch -}}
+		{{- (eq $dir ".") | ternary "" $dir -}}
+		{{- "\n" -}}
+	{{- end -}}
 {{- end -}}
 '