Browse Source

Allow tags and architectures to be properly empty

Tianon Gravi 6 years ago
parent
commit
5a6e2136a5
3 changed files with 5 additions and 5 deletions
  1. 1 1
      .template-helpers/arches.sh
  2. 1 1
      .template-helpers/git-prefetch.sh
  3. 3 3
      update.sh

+ 1 - 1
.template-helpers/arches.sh

@@ -27,4 +27,4 @@ bashbrew cat --format '
 			{{- ",\n" -}}
 		{{- end -}}
 	{{- end -}}
-' "$repo" | sort -u | tr '\n' ' ' | sed 's/, $/\n/'
+' "$repo" | sort -u | tr '\n' ' ' | sed -r -e 's/, $/\n/' -e 's/^[[:space:]]+|[[:space:]]+$//g'

+ 1 - 1
.template-helpers/git-prefetch.sh

@@ -23,7 +23,7 @@ templateArchVar='{{- $arch := $archSpecific | ternary arch ($e.HasArchitecture a
 tags="$(bashbrew list --uniq "$repo" | cut -d: -f2-)"
 tags=( $tags )
 toFetch=()
-for tag in "$tags"; do
+for tag in "${tags[@]}"; do
 	if ! bashbrew cat --format '
 		'"$templateHeader"'
 		{{- $e := $.TagEntry -}}

+ 3 - 3
update.sh

@@ -137,8 +137,8 @@ for image in "${images[@]}"; do
 			if [ -n "$ARCH_SPECIFIC_DOCS" ]; then
 				partial='**No supported tags found!**'$'\n\n''It is very likely that `%%REPO%%` does not support the currently selected architecture (`'"$BASHBREW_ARCH"'`).'
 			else
-				echo >&2 'error: missing TAGS for '"$repo"'!'
-				exit 1
+				# opensuse, etc
+				partial='**No supported tags**'
 			fi
 		elif [ -n "$ARCH_SPECIFIC_DOCS" ]; then
 			jenkinsJobUrl="https://doi-janky.infosiftr.net/job/multiarch/job/$BASHBREW_ARCH/job/$repo/"
@@ -149,7 +149,7 @@ for image in "${images[@]}"; do
 
 		echo '  ARCHES => arches.sh "'"$repo"'"'
 		arches="$("$helperDir/arches.sh" "$repo")"
-		[ "$arches" ]
+		[ -n "$arches" ] || arches='**No supported architectures**'
 		replace_field "$targetFile" 'ARCHES' "$arches"
 
 		echo '  CONTENT => '"$repo"'/content.md'