From 0feb2b93424385e1e663df6b602808b38c77bc74 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 16 Nov 2022 15:23:34 -0800 Subject: [PATCH] Fix depth check --- scripts/github-actions/generate.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/github-actions/generate.sh b/scripts/github-actions/generate.sh index 0ddfb0f..9562761 100755 --- a/scripts/github-actions/generate.sh +++ b/scripts/github-actions/generate.sh @@ -117,12 +117,13 @@ for tag in $tags; do ' )" - if parent="$(bashbrew parents "$bashbrewImage" | grep "^${tag%%:*}:")" && [ -n "$parent" ]; then + if parent="$(bashbrew parents --depth=1 "$bashbrewImage" | grep "^${tag%%:*}:")" && [ -n "$parent" ]; then if [ "$(wc -l <<<"$parent")" -ne 1 ]; then echo >&2 "error: '$tag' has multiple parents in the same repository and this script can't handle that yet!" echo >&2 "$parent" exit 1 fi + parent="$(bashbrew parents "$bashbrewImage" | grep "^${tag%%:*}:" | tail -1)" # get the "ultimate" this-repo parent parentBashbrewImage="${parent##*/}" # account for BASHBREW_NAMESPACE being set parent="$(bashbrew list --uniq "$parentBashbrewImage")" # normalize parentMeta="${metas["$parent"]}"